Skip to content

net/http.(*Server).Serve error #210

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

Open
ghost opened this issue Dec 14, 2019 · 5 comments
Open

net/http.(*Server).Serve error #210

ghost opened this issue Dec 14, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 14, 2019

Hi guys,

Hope you are all well !

I try to run qor-admin from a docker container, and it is triggering a weird error from net/http package.

ref. https://github.com/x0rzkov/oniontree

docker-compose up

gives me the following error

oniontree_1  | 2019/12/14 15:54:43 http: panic serving 172.19.0.3:35988: runtime error: invalid memory address or nil pointer dereference
oniontree_1  | goroutine 1022 [running]:
oniontree_1  | net/http.(*conn).serve.func1(0xc000152140)
oniontree_1  | 	/usr/local/go/src/net/http/server.go:1767 +0x139
oniontree_1  | panic(0xa52400, 0xf83e20)
oniontree_1  | 	/usr/local/go/src/runtime/panic.go:679 +0x1b2
oniontree_1  | html/template.(*Template).escape(0x0, 0x0, 0x0)
oniontree_1  | 	/usr/local/go/src/html/template/template.go:95 +0x42
oniontree_1  | html/template.(*Template).Execute(0x0, 0xbe44a0, 0xc000410000, 0xaebd40, 0xc000174000, 0x1, 0xc00009a090)
oniontree_1  | 	/usr/local/go/src/html/template/template.go:119 +0x2f
oniontree_1  | github.com/qor/admin.(*Context).Execute(0xc000174000, 0xaf396d, 0x9, 0x0, 0x0)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/context.go:227 +0x22c
oniontree_1  | github.com/qor/admin.(*Controller).Dashboard(...)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/controller.go:28
oniontree_1  | github.com/qor/admin.(*Admin).NewServeMux.func2(0xc000174000, 0xc0003ce3e0)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/route.go:176 +0x1e6
oniontree_1  | github.com/qor/admin.Middleware.Next(...)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/route.go:37
oniontree_1  | github.com/qor/admin.(*Admin).NewServeMux.func1(0xc000174000, 0xc0003ce3c0)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/route.go:166 +0x115
oniontree_1  | github.com/qor/admin.Middleware.Next(...)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/route.go:37
oniontree_1  | github.com/qor/admin.Admin.registerCompositePrimaryKeyCallback.func1(0xc000174000, 0xc000440700)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/composite_primary_key_callback.go:27 +0x24d
oniontree_1  | github.com/qor/admin.(*serveMux).ServeHTTP(0xc0000a0668, 0xbee3a0, 0xc000410000, 0xc000462100)
oniontree_1  | 	/go/pkg/mod/github.com/qor/[email protected]/route.go:267 +0x559
oniontree_1  | net/http.(*ServeMux).ServeHTTP(0xc000392a80, 0xbee3a0, 0xc000410000, 0xc000462100)
oniontree_1  | 	/usr/local/go/src/net/http/server.go:2387 +0x1bd
oniontree_1  | net/http.serverHandler.ServeHTTP(0xc0004101c0, 0xbee3a0, 0xc000410000, 0xc000462100)
oniontree_1  | 	/usr/local/go/src/net/http/server.go:2802 +0xa4
oniontree_1  | net/http.(*conn).serve(0xc000152140, 0xbefaa0, 0xc00044a0c0)
oniontree_1  | 	/usr/local/go/src/net/http/server.go:1890 +0x875
oniontree_1  | created by net/http.(*Server).Serve
oniontree_1  | 	/usr/local/go/src/net/http/server.go:2928 +0x384

Does anyone know what is happening ?

Cheers,
X

@sergolius
Copy link
Contributor

@x0rzkov out of box qor admin is not compatible with go modules.
The error occurred because template was not found.
qor/auth#23 (comment)

Accordingly to https://doc.getqor.com simples solution is to compile templates into binary via https://github.com/qor/bindatafs

@ghost
Copy link
Author

ghost commented Jan 20, 2020

Would be awesome to have a gist or repo with an example running bindatafs and qor admin.

@sergolius
Copy link
Contributor

@x0rzkov just follow https://doc.getqor.com/guides/bindatafs.html and dive into source code

repo: https://github.com/sergolius/qor_bindatafs_example
I tried to commit step by step

@ghost
Copy link
Author

ghost commented Jan 26, 2020

awesome, thank you very much !

@ghost
Copy link
Author

ghost commented Sep 9, 2020

@sergolius , hope you are all well !

I was just wondering if you have any idea how to sort another issue I posted qor/auth#42

I am locked and need to find at least some hints about how to do it ^^.

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

1 participant