-
Notifications
You must be signed in to change notification settings - Fork 5.9k
"Insufficient permission" error on save #454
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
Setting wider access settings on those files/directories worked for me - from If access rights are not the case, you can use I believe it's due to trying to edit files by user 'docker' or something similar (since we're operating from inside of the container) and it is not issue with code-server itself. |
Reverting back to the |
Yeah, we recently changed the dockerfile to run as a regular user rather than root, so any previous files created as root will have to be fixed. You should be able to just |
@yusukeoshiro due to recent changes I proposed that are merged, you will need to fix the permissions. Your files are owned by root so you need to recursively own all files to the user. |
To which user? What user/group is the coder-server running? |
Ok, I circumvented this by passing Might not be the best approach but may be helpful for someone as quick workaround without dealing with directory, file ownership. |
@DavisAre that’s redundant. UID/GID is already 1000 when you exec the container |
I think @DavisAre's solution seems like the best path forward here, typically when I've needed to edit files from inside a container this has been the recommended approach. The alternative seems to be changing host file permissions which isn't great... I will note though that in my case when I try to run it with a forwarded user I get:
|
@cstoneham I'm dealing with the same situation. How do you deal with the errors you get with a forwarded user? |
I already logged a fix but its stuck at pending for god knows how long. |
I have the same permission issue described in the top screenshot and my set up is as follows. I use a host user with IDs 1007:1007 which launches a coder container through docker compose. When I bash into the coder container, the coder user has 1000:1000 IDs and the /home/coder/project dir is owned by 1007:1007 thus, anything I change in the Coder UI is halted by the permission issue error in the top description. If I try to change ownershipt from 1007:1007 to coder:coder, everything changes back to 1007:1007 at the first file change in the Coder UI. I am thinking this is because of the bind mount. I tried to 'usermod -u 1007 coder' and 'groupmod -g 1007 coder' and then set ownership of /home/coder to 1007:1007 but then the Coder UI is blank and the coder container logs say: coder_1 | INFO WebSocket opened / {"client":4,"ip":"[IP_REMOVED_BY_ME]"} Any hints here would be greatly appreciated! |
@acondura |
I already have it as o+w, the trouble is every time I update a file through VS and try to save, it still says 'insufficient permission' because it changes the UID of the dir to 1007, the local user. I've currently forked the coder github repo and I'm building an image of my own in order to fix the permission denied because I need it to work for 2 of my customers. |
The problem is the default user inside the container has UID 1000 but outside you've got 1007 @acondura, you just need to This needs to be a documented limitation of using a non root docker container. TBH I'm thinking we just switch back to root as this is very confusing I'm sure and there is no real good workaround. |
There is https://github.com/cdr/code-server/pull/640/files but iirc we tried that and |
I've created an image of my own which uses the coder binary + fixuid and it is working great! I combine that with docker compose commands and I'm able to spin up lots of coder instances for myself and colleagues. Image at https://hub.docker.com/r/acondura/code-server. |
services:
visual:
image: codercom/code-server:latest
restart: always
user: "0:0" It's not pretty but it solves the issue. |
I'll fix in #1307 |
code-server
version: 1.621Description
Files cannot be saved nor folders cannot be created from the editor.
This problem only started to occur on the latest release. (I think)
Steps to Reproduce
docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server:1.621 --allow-http --no-auth
Failed to save 'README.md': Insufficient permissions. Select 'Retry as Sudo' to retry as superuser.
.The text was updated successfully, but these errors were encountered: