-
Notifications
You must be signed in to change notification settings - Fork 889
Panic when trying to open terminal session #3870
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
Comments
Thanks for your detailed report @skerit! I created #3871 to fix the nil pointer deref you ran into with reconnecting PTY, however it won't help with your underlying problem. I'm assuming you're using There's something odd going on with your setup though, are you sure DNS is the only thing you changed? Especially this error: Regarding the |
My pleasure @mafredri, it's the least I can do 😄 I'm actually not running coder itself inside a docker container. I used the install script (on an Arch linux server) Here's my systemd service (which I copied from this repository, I believe)
And the environment file:
I've cleared the entire Postgres database & started fresh, but I'm still getting the same I thought the install script was the preferred way of installing coder, but I can try the docker way too. |
I was under the impression that you were seeing I think it'd help if you could share the exact template you're using and we can see if there's something odd there. (E.g. (That socket error you're seeing is likely just from wrong permissions on the socket, e.g. an ugly workaround is to |
Yes indeed, the Here's the template. Saved it again as a zip so I could upload it on Github. (But again: it's just the docker-code-server example with a different dns server... 😬) About the permission error when running the server in docker: ok, I thought maybe the docker image would have the correct permissions set automatically, but I guess I can just connect to the container's console and change the permissions like that then. |
Alright, the template you shared definitely matches the example, like you said. Then I suppose we'll have to figure out where Perhaps there would be some hints in the environment of the workspace? $ docker exec -it coder-skerit-test1 /bin/bash
coder@test1:~$ env
... Variables like
Yes, feel free to run it however you like. The problem is most likely not with the Coder server here. |
Interesting:
I have no idea how that
To clarify: skerit is my account on the host server itself (uid 1000) My other containers (the one running coder's postgres database for example) do not have |
Ok, thanks. It's as I suspected, but I am confused as to why it happens. I think you can solve this (for you) by updating your template: resource "docker_container" "workspace" {
...
user = "coder:coder"
} (Or alternatively, adding However, it would be great to understand why this happens. Are you running Docker rootless for instance? There are some hints in Docker run reference: ENV:
And since the It may very well be that we should update our example template(s), or some at least. |
If you want me to run any more test: no problem. I'm not running rootless docker. Or at least: I did not install it that way. It's just a plain
So I tested this in 2 ways now:
Both had the issue. Updating the templateI added the
*Edit: Ah, seems I've got another error now. somehow the token is invalid inside the container?
I've restarted coder, deleted the workspaces, deleted the template & created it again, but now I always get the "Agent token is invalid" error. This seems to prevent code-server from starting, but I can open a terminal session via the web interface now. |
Since I've got a good workaround for the original issue, I'll ask for help for the "Agent token is invalid" error on Discord! |
After a lot of investigation on Discord, @skerit found this was caused by the Btrfs driver for Docker. Somehow the host filesystem got mounted inside the Docker container which resulted in a wrong This may have been tied to performing Btrfs rollbacks from snapshots. But somehow the issue only affected the I'm closing this since the reported nil pointer dereference has been fixed and the rest is not a bug in Coder. |
Uh oh!
There was an error while loading. Please reload this page.
Coder version & template
I'm using coder v0.8.11.
The template in question is the
docker-code-server
example template.(The only thing I changed in it was the DNS setting)
Error
When I try to open a terminal session via the web interface, my docker container crashes with this error:
And when I try to connect using
coder ssh testspace
it just fails:Opening a console via docker just works though. (And /bin/bash exists just fine)
Also...
I can't open code-server either, not sure if it's a related issue:
Which might be because the agent can't seem to connect to coder?
I'm getting a
failed to dial
error in the logs, immediately after starting the workspace:After restarting the workspace, I'm getting slightly different agent errors:
Weird that now the error turned into a Agent trying to connect from non-latest build error, when the template has not been changed.
The text was updated successfully, but these errors were encountered: