-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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 reload command returns successfully but does not work #5735
Comments
And what's in your container logs (i.e. Caddy's stdout/stderr) after you attempt to reload? |
Thanks for opening an issue! We'll look into this. It's not immediately clear to me what is going on, so I'll need your help to understand it better. Ideally, we need to be able to reproduce the bug in the most minimal way possible using the latest version of Caddy. This allows us to write regression tests to verify the fix is working. If we can't reproduce it, then you'll have to test our changes for us until it's fixed -- and then we can't add test cases, either. I've attached a template below that will help make this easier and faster! This will require some effort on your part -- please understand that we will be dedicating time to fix the bug you are reporting if you can just help us understand it and reproduce it easily. This template will ask for some information you've already provided; that's OK, just fill it out the best you can. 👍 I've also included some helpful tips below the template. Feel free to let me know if you have any questions! Thank you again for your report, we look forward to resolving it! Template
Instructions -- please heed otherwise we cannot help you (help us help you!)
Example of a tutorial: Create a config file: |
@mholt @francislavoie, I've updated my initial post to precise things. |
Pretty sure, that's due to how podman/docker handle bind mounts. You should be able to compare the inode numbers with |
@emilylange, impressive !
I've googled a bit, I managed to fix the issue using the solution in this Stackoverflow's post
As the issue is related to the docker/podman itself, you may close this issue. You may also update the |
Hello team, I just encountered this bug and thanks to @knacky34, I was able to resolve this issue. Could this be updated in the the |
I know this was closed, but the proper solution/explanation/reasoning(?) is not here yet, i think. This behavior isn't actually a bug in docker or podman, it's a consequence of backupcopy=auto in vim (default almost everywhere), the "edited" file is actually a new file that's been just renamed to the original file's name, the bind mount is still (correctly) pointing to the old file's inode. If you want to actually change the file in place, you have to use "backupcopy=yes", this can be set in vim with ":set backupcopy=yes" in vim or in .vimrc with "set backupcopy=yes". If you use a different editor and see this behavior, it's the same case, just find out how to reconfigure your editor. Bind mounting a directory is a workaround, it doesn't address the cause. TL;DR: use ":set backupcopy=yes" in vim or "set backupcopy" in .vimrc |
@TheSiman I'm having this issue and use vscode to control my server. I ssh in using the remote ssh plugin for vscode. So I have confirmed that the inode is different on the host and inside my container. You're saying that what vscode is doing is creating a new file in place of the old one? I don't know which setting will fix this, any ideas? |
I just opened a PR to finally update the docs. |
@purple-emily Yes, that's what I'm saying. I'm not familiar with the plugin unfortunately. @BjoernLudwigPTB Some wires got crossed when linking the PR, here's the correct link: docker-library/docs#2483 (same thing with this issue's link in the PR comment) |
@BjoernLudwigPTB I don't agree with that change to the docs. The problem is with the text editor you're using, not with the Docker setup. |
Thanks for considering my contribution! As mentioned in the PR I will come up with a better wording to reflect the actual scope of the problem addressed shortly. |
Environement
Step to reproduce
curl localhost
, outputHello World
respond "Goodbye World"
podman exec -w /etc/caddy caddy caddy reload
curl localhost
, outputHello World
instead ofGoodbye World
Workaround
Restart the container with
podman restart caddy
Log Output after run
caddy reload
Also Tried
Seeing the log output, I think maybe it does not detect a change of the value in respond. So I tried adding a new directive, but it still does not work. Furthermore, the log output still say
config is unchanged
Caddyfile
and addheader Custom-Header "My value"
podman exec -w /etc/caddy caddy caddy reload
curl -v localhost
, I should see the newly added header in the response but it's not thereThe text was updated successfully, but these errors were encountered: