Skip to content
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

Cannot create container for service xxx permission denied #76

Open
matt-lethargic opened this issue Feb 25, 2020 · 6 comments
Open

Cannot create container for service xxx permission denied #76

matt-lethargic opened this issue Feb 25, 2020 · 6 comments

Comments

@matt-lethargic
Copy link

Whenever I try and use the local-persist I'm getting this error:

ERROR: for nodered  Cannot create container for service nodered: open /mnt/data/volumes/nodered/data: permission denied

ERROR: for nodered  Cannot create container for service nodered: open /mnt/data/volumes/nodered/data: permission denied
ERROR: Encountered errors while bringing up the project.

The permissions on this folder I've set to 777 to try and get rid of this error, but it still happens.

I'm creating my own docker image as part of my docker-compose file and I've event tried setting the folder inside the container to 777, but still no luck.

Where do I go from here?

I'm using sudo to spin up my docker.compose. I've used volume inspect and that gives no clues

    {
        "CreatedAt": "0001-01-01T00:00:00Z",
        "Driver": "local-persist",
        "Labels": {
            "com.docker.compose.project": "smarthome",
            "com.docker.compose.version": "1.23.2",
            "com.docker.compose.volume": "nodered-data"
        },
        "Mountpoint": "/mnt/data/volumes/nodered/data",
        "Name": "smarthome_nodered-data",
        "Options": {
            "mountpoint": "/mnt/data/volumes/nodered/data"
        },
        "Scope": "local"
    }
]

Any help would be great as I've been trying to get this to work for weeks now

@CWSpear
Copy link
Collaborator

CWSpear commented Feb 25, 2020

What does your docker-compose.yml file(s) look like?

Is there any issue with the mount in general? Does mkdir -p /mnt/data/volumes/nodered/data and touch /mnt/data/volumes/nodered/data/test.txt work?

@matt-lethargic
Copy link
Author

docker.compose.yaml

nodered:
  ...blah
  volumes:
      - nodered-data:/data

....

volumes:
  nodered-data:
    driver: local-persist
    driver_opts:
      mountpoint: /mnt/data/volumes/nodered/data

the folder /mnt/data/volumes/nodered/data/ I could touch a file into,
owner root
group smarthome
mode 774 drwxrwxr

I deleted it and created it again and couldn't add empty file unless I used sudo

@CWSpear
Copy link
Collaborator

CWSpear commented Feb 25, 2020

If you can't create files in a folder with 774 permissions without
sudo, then something else is fishy...

@matt-lethargic
Copy link
Author

sorry, you mis-understood me, that config was the setup before I deleted the directory and ran

mkdir -p /mnt/data/volumes/nodered/data and then touch /mnt/data/volumes/nodered/data/test.txt

it was then that this touch command didn't work. I have configured the permissions back to what i've written above now.

(total aside, I was buying Fish Pie when I read your reply, totally smelled fish!!)

@matt-lethargic
Copy link
Author

No more thoughts? Anyone? :-(

@CWSpear
Copy link
Collaborator

CWSpear commented Mar 3, 2020

I'm sorry, I don't.

I am still a little confused... you keep saying that creating a file (via touch) doesn't work, but then saying it does. When does it work and when does it not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants