I ran the docker run command from the repo, and while I can open files I get these errors when trying to save any file:
root ERROR Request updateContent failed with error: EACCES: permission denied, open '/home/project/test.js' Error: EACCES: permission denied, open '/home/project/test.js'
root ERROR Error: Request 'updateContent' failed
at Proxy.<anonymous> (http://localhost:3000/bundle.js:53:134442)
at e.<anonymous> (http://localhost:3000/bundle.js:30:138832)
at http://localhost:3000/bundle.js:30:136389
at Object.next (http://localhost:3000/bundle.js:30:136494)
at http://localhost:3000/bundle.js:30:135407
at new Promise (<anonymous>)
at a (http://localhost:3000/bundle.js:30:135184)
at e.saveContentChanges (http://localhost:3000/bundle.js:30:138641)
at http://localhost:3000/bundle.js:19:522068
at http://localhost:3000/bundle.js:19:521467
root ERROR Request setContent failed with error: EACCES: permission denied, open '/home/project/test.js' Error: EACCES: permission denied, open '/home/project/test.js'
root ERROR Error: Request 'setContent' failed
at Proxy.<anonymous> (http://localhost:3000/bundle.js:53:134442)
at e.<anonymous> (http://localhost:3000/bundle.js:30:138500)
at http://localhost:3000/bundle.js:30:136389
at Object.next (http://localhost:3000/bundle.js:30:136494)
at a (http://localhost:3000/bundle.js:30:135240)
at <anonymous>
Hi @Mosho1
Did you use one of our docker images, mounting one of your host's directory as a workspace in the "docker run" command? e.g.:
docker run -d -i -p 3003:3000 -v "$(pwd):/home/project:cached" theiaide/theia:latest ?
If so there is a generic Docker issue at play, where your identity (linux uid) is different in the image vs the mounted volume host's permissions.
See this post and response for some more details and work-arounds: https://github.com/theia-ide/theia/issues/3198#issuecomment-430769441
I will close this issue for now; please re-open if you feel there is more to discuss
When you add your UID to the docker run command, then it should work:
docker run -u $UID -d -i -p 3003:3000 -v "$(pwd):/home/project:cached" theiaide/theia:latest
When you add your UID to the docker run command, then it should work:
docker run -u $UID -d -i -p 3003:3000 -v "$(pwd):/home/project:cached" theiaide/theia:latest
Thanks @ablochberger - that's actually really easy and kind-of works.
The only problem I see is that now some permissions inside the container no longer work as intended. For example the Theia app will attempt to create a folder in the user's home to save configs, but that breaks when the container runs as an unexpected user:
root ERROR Request getHostStoragePath failed with error: EACCES: permission denied, mkdir '/home/theia/.theia' Error: EACCES: permission denied, mkdir '/home/theia/.theia'
So some other little adjustments might be required
I faced this issue as well when trying to run Theia in Docker on Linux a solution and docs would be appreciated.
Thanks @marcdumais for the link. What worked great is changing the group (from current user to group 'docker') of the workspace.
chgrp -R 1001 <workspace folder>
This works even if the docker is already up & running.
Most helpful comment
I faced this issue as well when trying to run Theia in Docker on Linux a solution and docs would be appreciated.