-
Notifications
You must be signed in to change notification settings - Fork 4
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
Caddy Restarting: invalid memory address or nil pointer dereference #14
Comments
Thank you for your report. I'll take a look soon. Do you observe some temporal pattern to it happening? |
Thanks for the response @hslatman So this appears to reoccur on an hourly basis. However there seems to be the odd occasion it appears on half hour intervals also. I get the error twice with the exception being logged below it. Then what I believe is docker-compose restarting the service based on having Below is output from my log collection showing the frequency of the error.
|
So, I think I know what's going on, but I'll need to verify if my understanding of Caddy configuration reloads and how these affect module (re)instantiation is correct. The https://github.com/lucaslorentz/caddy-docker-proxy module is capable of performing automatic Caddy configuration reloads. When the configuration is reloaded, I think the CrowdSec module is stopped, resulting in the storage being set to What I don't understand yet is why it happens at an hourly interval (mostly). The above hypothesis may be wrong, but from a quick skim this looks to be the way the |
Are there any temporary workarounds for this?
|
No, I run mine in docker so the container just restarts leaving me with very short downtime of a few seconds an hour. I can live with that but it's not really a workaround. |
A workaround that may be suitable is to disable the streaming mode ( That said, I'm working on some upgrades in #20 that improve the runtime. I think that's a good starting point for fixing this issue, so I'll do that after. |
In #23, which is part of https://github.com/hslatman/caddy-crowdsec-bouncer/releases/tag/v0.5.0, I've changed the behavior of the bouncer shutdown to not clean up the underlying store. This should prevent the nil pointer from happening when Caddy's configuration is reloaded. I've also changed the behavior of the goroutines that operate on the store, so they should be stopped in time now too. I'm keeping the issue open a little longer to verify it's fixed and to have a more complete solution for when (parts of) the configuration change that affect the bouncer itself. |
I had a similar issue here, but the trace looks different than what I see above
|
@AskAlice I've tagged https://github.com/hslatman/caddy-crowdsec-bouncer/releases/tag/v0.5.3. I couldn't reproduce the issue, but based solely on the version you used and the line numbers, I think this is the only cause for a nil pointer in this case. |
With the release of https://github.com/hslatman/caddy-crowdsec-bouncer/releases/tag/v0.6.0, which has more improvements related to configuration (re)loading and (re)instantiation of the module, this issue can be closed. While I haven't tested with https://github.com/lucaslorentz/caddy-docker-proxy specifically, any changes in configuration and (re)loading Caddy should now behave as expected. Feel free to reopen if the issue surfaces again. |
Hi, over the last few weeks I've noticed short interruptions in connectivity when using application running on a Caddy server. After digging into the logs to figure out the issue I've come across the following. This appears to be causing Caddy to restart.
I'm running Caddy 2.5.2 in Docker with the following plugins enabled:
Any assistance would be appreciated.
Thanks
The text was updated successfully, but these errors were encountered: