Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handler crashed with error reflect: call of reflect.Value.Int on string Value #26

Open
ramosisw opened this issue Sep 27, 2019 · 1 comment

Comments

@ramosisw
Copy link

How can I solve this error?
Environment
Platform: Raspberry Pi 3 B +
OS: linux
Architecture: arm
The source was compiled on the Raspberry Pi.

Action: Update the configuration of the default profile
Initially I had to comment on that configuration in the code because it gave me the same error.
Log

[ORM]2019/09/27 15:15:01  -[Queries/default] - [  OK / db.QueryRow /     0.2ms] - [SELECT `id`, `profile`, `port`, `proto`, `ca`, `cert`, `key`, `cipher`, `keysize`, `auth`, `dh`, `server`, `ifconfig_pool_persist`, `keepalive`, `max_clients`, `management` FROM `o_v_config` WHERE `profile` = ? ] - `default`
2019/09/27 15:15:01 [D] [utils.go:49] {
,
	"Profile": "default",
	"Port": 0,
	"Proto": "",
	"Ca": "",
	"Cert": "",
	"Key": "",
	"Cipher": "",
	"Keysize": 0,
	"Auth": "",
	"Dh": "",
	"Server": "",
	"IfconfigPoolPersist": "",
	"Keepalive": "",
	"MaxClients": 0,
	"Management": ""
} 
2019/09/27 15:15:01 [C] [panic.go:679] the request url is  /ov/config
2019/09/27 15:15:01 [C] [panic.go:679] Handler crashed with error reflect: call of reflect.Value.Int on string Value
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/runtime/panic.go:679
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/reflect/value.go:986
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/db.go:214
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/db.go:92
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/db.go:617
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/orm/orm.go:239
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/controllers/ovconfig.go:61
2019/09/27 15:15:01 [C] [panic.go:679] /go/src/github.com/adamwalach/openvpn-web-ui/vendor/github.com/astaxie/beego/router.go:787
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/net/http/server.go:2802
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/net/http/server.go:1890
2019/09/27 15:15:01 [C] [panic.go:679] /usr/local/go/src/runtime/asm_arm.s:868
@d3vilh
Copy link

d3vilh commented Oct 1, 2021

have kind the same issue on RPI 4b:

ebat@netm:~/tempo $ cat /etc/debian_version
10.10
ebat@netm:~/tempo $ uname -a
Linux netm 5.10.60-v7l+ #1449 SMP Wed Aug 25 15:00:44 BST 2021 armv7l GNU/Linux

Managed to build everything for arm v71, but it can't run properly.
DB seems on the place, instances and users were created, but it throws following, when I run it:

2021/10/01 12:12:56 [D] [models.go:88] {1 default openvpn:2080 tcp /etc/openvpn/ 127.0.0.1 2021-10-01 09:26:49.944566004 +0000 UTC 2021-10-01 09:26:49.944570911 +0000 UTC}
[ORM]2021/10/01 12:12:56  -[Queries/default] - [  OK / db.QueryRow /     0.1ms] - [SELECT `id`, `profile`, `port`, `proto`, `ca`, `cert`, `key`, `cipher`, `keysize`, `auth`, `dh`, `server`, `ifconfig_pool_persist`, `keepalive`, `max_clients`, `management` FROM `o_v_config` WHERE `profile` = ? ] - `default`
panic: reflect: call of reflect.Value.Int on string Value

goroutine 1 [running]:
reflect.Value.Int(...)
	/usr/local/go/src/reflect/value.go:1334

Update:
As a WA you can disable default profile configuration submit to o_v_config table by commenting out createDefaultOVConfig() function as part of init() in models.go:

func init() {
	initDB()
	createDefaultUsers()
	createDefaultSettings()
//	createDefaultOVConfig()
}

This will skip createDefaultOVConfig and web server starts normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants