panic: runtime error: invalid memory address or nil pointer dereference #44

Closed
opened 2025-12-29 14:23:09 +01:00 by adam · 5 comments
Owner

Originally created by @l-SK-l on GitHub (Mar 2, 2025).

Try to run on LXC Docker container (Debian 12 with root user by default)
Default config, No SSL certificates, I added only login and password.

ghcr.io/yusing/godoxy:latest

03-02 13:33 INF GoDoxy version v0.9.9
03-02 13:33 INF loaded route providers
                  • docker@local 2 routes
03-02 13:33 INF server started addr=:80 module=server name=proxy
03-02 13:33 INF homepage overrides config loaded, 0 items
03-02 13:33 INF icon cache loaded (0 icons)
panic: runtime error: invalid memory address or nil pointer dereference
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xc65503]
goroutine 36 [running]:
github.com/yusing/go-proxy/internal/docker.(*SharedClient).Close(0x0)
	/src/internal/docker/client.go:90 +0x43
github.com/yusing/go-proxy/internal/watcher.DockerWatcher.EventsWithOptions.func1.1()
	/src/internal/watcher/docker_watcher.go:66 +0x6e
panic({0xf94e60?, 0x1a45500?})
	/usr/local/go/src/runtime/panic.go:785 +0x132
github.com/yusing/go-proxy/internal/watcher.DockerWatcher.EventsWithOptions.func1()
	/src/internal/watcher/docker_watcher.go:69 +0xdf
created by github.com/yusing/go-proxy/internal/watcher.DockerWatcher.EventsWithOptions in goroutine 1
	/src/internal/watcher/docker_watcher.go:62 +0x156
Originally created by @l-SK-l on GitHub (Mar 2, 2025). Try to run on [LXC Docker container](https://community-scripts.github.io/ProxmoxVE/scripts?id=docker) (Debian 12 with root user by default) Default config, No SSL certificates, I added only login and password. ghcr.io/yusing/godoxy:latest ``` 03-02 13:33 INF GoDoxy version v0.9.9 03-02 13:33 INF loaded route providers • docker@local 2 routes 03-02 13:33 INF server started addr=:80 module=server name=proxy 03-02 13:33 INF homepage overrides config loaded, 0 items 03-02 13:33 INF icon cache loaded (0 icons) panic: runtime error: invalid memory address or nil pointer dereference panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xc65503] goroutine 36 [running]: github.com/yusing/go-proxy/internal/docker.(*SharedClient).Close(0x0) /src/internal/docker/client.go:90 +0x43 github.com/yusing/go-proxy/internal/watcher.DockerWatcher.EventsWithOptions.func1.1() /src/internal/watcher/docker_watcher.go:66 +0x6e panic({0xf94e60?, 0x1a45500?}) /usr/local/go/src/runtime/panic.go:785 +0x132 github.com/yusing/go-proxy/internal/watcher.DockerWatcher.EventsWithOptions.func1() /src/internal/watcher/docker_watcher.go:69 +0xdf created by github.com/yusing/go-proxy/internal/watcher.DockerWatcher.EventsWithOptions in goroutine 1 /src/internal/watcher/docker_watcher.go:62 +0x156 ```
adam closed this issue 2025-12-29 14:23:09 +01:00
Author
Owner

@yusing commented on GitHub (Mar 2, 2025):

Fixed

@yusing commented on GitHub (Mar 2, 2025): Fixed
Author
Owner

@l-SK-l commented on GitHub (Mar 4, 2025):

I'm waiting update for ghcr.io/yusing/godoxy:latest, now it's "Created": "2025-03-01T07:57:58.98507553Z"

@l-SK-l commented on GitHub (Mar 4, 2025): I'm waiting update for ghcr.io/yusing/godoxy:latest, now it's "Created": "2025-03-01T07:57:58.98507553Z"
Author
Owner

@yusing commented on GitHub (Mar 4, 2025):

I'm waiting update for ghcr.io/yusing/godoxy:latest, now it's "Created": "2025-03-01T07:57:58.98507553Z"

https://github.com/yusing/godoxy/actions/runs/13616173827

I did update the stable build v0.9.9-1. Does it still not work?

@yusing commented on GitHub (Mar 4, 2025): > I'm waiting update for ghcr.io/yusing/godoxy:latest, now it's "Created": "2025-03-01T07:57:58.98507553Z" https://github.com/yusing/godoxy/actions/runs/13616173827 I did update the stable build v0.9.9-1. Does it still not work?
Author
Owner

@l-SK-l commented on GitHub (Mar 5, 2025):

root@godoxy:~# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/yusing/godoxy/main/scripts/setup.sh)"
Using curl for downloads
Setting up GoDoxy
Branch: main
Creating directory "config"
Do you want to overwrite ".env"? (y/n): y
Downloading ".env.example" to ".env"
Done
Europe/Belgrade
Downloading "compose.example.yml" to "compose.yml"
Done
Downloading "config.example.yml" to "config/config.yml"
Done
Setting up login user
Enter login username: admin
Enter login password: admin
Setting up login user "admin" with password "admin"
Setting up autocert for SSL certificate
Do you want to enable autocert? (y/n): n
Setup finished

Changing in compose.yml image: ghcr.io/yusing/godoxy:latest to v0.9.9-1 (latest didn't changed)

root@godoxy:~# docker compose up -d
[+] Running 2/2
 ✔ Container godoxy-frontend  Started                                                                                                                                                  0.4s 
 ✔ Container godoxy           Started   

Trying to login and see in logs

root@godoxy:~# docker logs e4
03-05 07:47 INF GoDoxy version v0.9.9-1
03-05 07:47 INF loaded route providers
                  • docker@local 2 routes
03-05 07:47 INF server started addr=:80 module=server name=proxy
03-05 07:47 INF homepage overrides config loaded, 0 items
03-05 07:47 INF icon cache loaded (0 icons)
03-05 07:47 INF prometheus metrics enabled
03-05 07:47 INF server started addr=127.0.0.1:8888 module=server name=api
03-05 07:47 WRN service went down name=godoxy
03-05 07:47 INF event occurred
                  • updated
                    • godoxy name=local type=docker
03-05 07:47 WRN service went down name=godoxy
03-05 07:47 INF service is up name=godoxy
2025/03/05 07:48:09 net/http: invalid Cookie.Domain ".0.0.1"; dropping domain attribute

If I use

Do you want to enable autocert? (y/n): y
Setting up autocert
Enter domain (e.g. example.com): test.local
Enter email for Let's Encrypt: ss@gmail.com
Are you using cloudflare? (y/n): n

The result the same

@l-SK-l commented on GitHub (Mar 5, 2025): ``` root@godoxy:~# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/yusing/godoxy/main/scripts/setup.sh)" Using curl for downloads Setting up GoDoxy Branch: main Creating directory "config" Do you want to overwrite ".env"? (y/n): y Downloading ".env.example" to ".env" Done Europe/Belgrade Downloading "compose.example.yml" to "compose.yml" Done Downloading "config.example.yml" to "config/config.yml" Done Setting up login user Enter login username: admin Enter login password: admin Setting up login user "admin" with password "admin" Setting up autocert for SSL certificate Do you want to enable autocert? (y/n): n Setup finished ``` Changing in compose.yml image: ghcr.io/yusing/godoxy:latest to v0.9.9-1 (latest didn't changed) ``` root@godoxy:~# docker compose up -d [+] Running 2/2 ✔ Container godoxy-frontend Started 0.4s ✔ Container godoxy Started ``` Trying to login and see in logs ``` root@godoxy:~# docker logs e4 03-05 07:47 INF GoDoxy version v0.9.9-1 03-05 07:47 INF loaded route providers • docker@local 2 routes 03-05 07:47 INF server started addr=:80 module=server name=proxy 03-05 07:47 INF homepage overrides config loaded, 0 items 03-05 07:47 INF icon cache loaded (0 icons) 03-05 07:47 INF prometheus metrics enabled 03-05 07:47 INF server started addr=127.0.0.1:8888 module=server name=api 03-05 07:47 WRN service went down name=godoxy 03-05 07:47 INF event occurred • updated • godoxy name=local type=docker 03-05 07:47 WRN service went down name=godoxy 03-05 07:47 INF service is up name=godoxy 2025/03/05 07:48:09 net/http: invalid Cookie.Domain ".0.0.1"; dropping domain attribute ``` If I use ``` Do you want to enable autocert? (y/n): y Setting up autocert Enter domain (e.g. example.com): test.local Enter email for Let's Encrypt: ss@gmail.com Are you using cloudflare? (y/n): n ``` The result the same
Author
Owner

@yusing commented on GitHub (Mar 15, 2025):

I'm sure the panic has been fixed on v0.9.9-1. The panic is from the docker.(*SharedClient).Close method, so it isn't related to 'Are you using cloudflare? (y/n): n'

@yusing commented on GitHub (Mar 15, 2025): I'm sure the panic has been fixed on v0.9.9-1. The panic is from the `docker.(*SharedClient).Close` method, so it isn't related to 'Are you using cloudflare? (y/n): n'
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/godoxy-yusing#44