acouvreur / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://acouvreur.github.io/sablier/
GNU Affero General Public License v3.0
1.17k stars 44 forks source link

invalid memory address or nil pointer dereference #207

Closed AGou-ops closed 5 months ago

AGou-ops commented 9 months ago

Describe the bug

Cannot run sablier in k8s cluster.

│ time="2023-09-22T01:43:59Z" level=warning msg="10.96.0.0 - sablier [22/Sep/2023:01:43:59 +0000] \"GET /api/strategies/dynamic\" 404 0 \"\" \"curl/8.0.1\" (1ms)" clientIP=10.96.0.0 dataLeng │
│ th=0 hostname=sablier latency=1 method=GET path=/api/strategies/dynamic referer= statusCode=404 userAgent=curl/8.0.1                                                                         │
│ panic: runtime error: invalid memory address or nil pointer dereference                                                                                                                      │
│ [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x16c9331]                                                                                                                     │
│                                                                                                                                                                                              │
│ goroutine 140 [running]:                                                                                                                                                                     │
│ github.com/acouvreur/sablier/app/providers.(*KubernetesProvider).Start(0x1b4c5d5?, {0xc000498053, 0x5})                                                                                      │
│     /go/src/sablier/app/providers/kubernetes.go:82 +0x71                                                                                                                                     │
│ github.com/acouvreur/sablier/app/sessions.(*SessionsManager).requestSessionInstance(0xc0000b9180, {0xc000498053, 0x5}, 0x0?)                                                                 │
│     /go/src/sablier/app/sessions/sessions_manager.go:187 +0x530                                                                                                                              │
│ github.com/acouvreur/sablier/app/sessions.(*SessionsManager).RequestSession.func1({0xc000498053, 0x5})                                                                                       │
│     /go/src/sablier/app/sessions/sessions_manager.go:151 +0x77                                                                                                                               │
│ created by github.com/acouvreur/sablier/app/sessions.(*SessionsManager).RequestSession in goroutine 137                                                                                      │
│     /go/src/sablier/app/sessions/sessions_manager.go:149 +0xe5      

Context

Expected behavior no error.

romancin commented 9 months ago

Same here :(

EDIT: In my case, it was the name of the deployment that contained a -character (code-server). Changed to codeserver and the problem is solved.

AGou-ops commented 9 months ago

@romancin It's weird, I think it shouldn't have much to do with the name, right? I didn't use - character, but still not working.

acouvreur commented 9 months ago

Thanks for bringing this issue, I will be looking into it.

In the meantime, can you share more details on the context ?

Like the specific configurations and the request you do to the API!

Thanks

AGou-ops commented 9 months ago

@acouvreur Of course, here is my yaml file.

https://gist.github.com/AGou-ops/e096d9e41a7e0f7d0a4908a1b30d94d3

danielheimburg commented 5 months ago

I also seem to have this issue, unfortunately we cannot change our deployment names . Any progress on this?

acouvreur commented 5 months ago

I'm quite busy at the moment, the change seems easy to fix though. If I have the time I'll submit a change to fix this.

However, feel free to contribute! It would be really appreciated!

acouvreur commented 5 months ago

:tada: This issue has been resolved in version 1.7.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

AGou-ops commented 5 months ago

Thank you @acouvreur ,it works now. You can close this issue then.

acouvreur commented 3 weeks ago

:tada: This issue has been resolved in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: