Closed bribroder closed 2 months ago
Extra note, using an onUpload
command to fix permissions doesn't work, it doesn't seem to run at all if the sync errors
sync:
- path: ./app:/opt/app
uploadExcludeFile: .devspaceignore
onUpload:
exec:
- command: |-
find /opt/app -type d -exec chmod +X {} \;
Setting polling: true
doesn't work around the issue either
dev:app sync Initial sync completed
start_dev: initial sync: upstream: apply changes: apply creates: upload archive: after upload: rpc error: code = Unknown desc = untar all: decompress: create /opt/app/libs/asdf.py: open /opt/app/libs/asdf.py: permission denied
fatal exit status 1
I tracked this down to initial permissions of the subdirectories in the docker image
I tracked this down to initial permissions of the subdirectories in the docker image
Hey, i'm having the same problem on a project of mine and if I might ask, can you elaborate a little further on the solution? Did you create a new docker image with wider permissions so the devspace runner can do his initial work correctly?
@bribroder @rafilkmp3 I have the same issue. Anything that helps?
Never mind. The problem on my side was the securityContext set pretty restrictive for my pod (what is best practice). So i needed to get rid of the securityContext of my container:
dev:
app:
labelSelector:
app.kubernetes.io/name: myfancyapp
namespace: mynamespace
devImage: ghcr.io/loft-sh/devspace-containers/go:1.20-alpine
patches:
- op: remove
path: spec.containers[0].securityContext
sync:
- path: ./:/app
excludePaths:
- vendor/
Hope this helps folks.
What happened?
When devspace dev runs, during the initial sync I get a permissions error from inotify when it tries to descend into subdirectories of my container's working dir (/opt/app):
I can exec into the running pod and see that all the subdirectories of my working dir and the sync path have permissions set to 644 instead of 755 like on the host, so the directories can't be executed--although all files do have the correct ownership permissions matching the container user.
I can actually fix the sync issue after the pod deploys:
And then
devspace dev
will complete successfully and sync will work normally, until the container is killed and the initial sync needs to happen againNote that my pod does not run as root
How can we reproduce the bug? (as minimally and precisely as possible)
Create a sync into the working directory with some subdirectories?
My devspace.yaml:
Local Environment: