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

NPE when passing config file via PROXY_CONFIG in single binary mode #139

Closed
IljaN opened this issue Mar 12, 2020 · 2 comments · Fixed by owncloud/ocis-proxy#13
Closed

NPE when passing config file via PROXY_CONFIG in single binary mode #139

IljaN opened this issue Mar 12, 2020 · 2 comments · Fixed by owncloud/ocis-proxy#13
Assignees

Comments

@IljaN
Copy link
Contributor

IljaN commented Mar 12, 2020

It appears that the config can't be loaded:

ERR policy reva is not configured service=proxy
2020-03-12 21:23:00.592395 I | http: panic serving [::1]:51584: runtime error: invalid memory address or nil pointer dereference
goroutine 105 [running]:
net/http.(*conn).serve.func1(0xc001558320)
	/usr/local/Cellar/go/1.13.4/libexec/src/net/http/server.go:1767 +0x139
panic(0x55738e0, 0x6e291d0)
	/usr/local/Cellar/go/1.13.4/libexec/src/runtime/panic.go:679 +0x1b2
net/http/httputil.(*ReverseProxy).ServeHTTP(0xc000c87ef0, 0x5c3fce0, 0xc000162460, 0xc00033d200)
	/usr/local/Cellar/go/1.13.4/libexec/src/net/http/httputil/reverseproxy.go:206 +0x144
github.com/owncloud/ocis-proxy/pkg/proxy.(*MultiHostReverseProxy).ServeHTTP(0xc000c87ef0, 0x5c3fce0, 0xc000162460, 0xc00033d200)
	/Users/mbarz/go/pkg/mod/github.com/owncloud/[email protected]/pkg/proxy/proxy.go:119 +0x37e
net/http.serverHandler.ServeHTTP(0xc0001620e0, 0x5c3fce0, 0xc000162460, 0xc00033d200)
	/usr/local/Cellar/go/1.13.4/libexec/src/net/http/server.go:2802 +0xa4
net/http.(*conn).serve(0xc001558320, 0x5c49060, 0xc0014d6980)
	/usr/local/Cellar/go/1.13.4/libexec/src/net/http/server.go:1890 +0x875
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.13.4/libexec/src/net/http/server.go:2927 +0x38e
@IljaN IljaN added the bug label Mar 12, 2020
@IljaN IljaN self-assigned this Mar 12, 2020
@IljaN
Copy link
Contributor Author

IljaN commented Mar 12, 2020

This func is not called in single-binary mode: https://github.com/owncloud/ocis-proxy/blob/2aba428eb1ef177894fffc9477ad6a091d2cf676/pkg/command/root.go#L16

@refs Shouldn't this logic live inside the server command?

IljaN added a commit to owncloud/ocis-proxy that referenced this issue Mar 12, 2020
This is needed because he before hook which initializes the config is not executed correctly in the root cmd if
the service is called from single-binary.

This aligns the behaviour to match other commands
IljaN added a commit to owncloud/ocis-proxy that referenced this issue Mar 12, 2020
This is needed because he before hook which initializes the config is not executed correctly in the root cmd if
the service is called from single-binary.

This aligns the behaviour to match other commands. With this commit the --config-file argument needs to be passed to the
server sub-command.
@IljaN
Copy link
Contributor Author

IljaN commented Mar 12, 2020

Fix here: owncloud/ocis-proxy#12

  • After the fix is merged ocis-proxy version needs to be updated.
  • Update bridge documentation to reflect new argument position

IljaN added a commit to owncloud/ocis-proxy that referenced this issue Mar 12, 2020
This is needed because he before hook which initializes the config is not executed correctly in the root cmd if
the service is called from single-binary.

This aligns the behaviour to match other commands. With this commit the --config-file argument needs to be passed to the
server sub-command.
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

Successfully merging a pull request may close this issue.

1 participant