consul icon indicating copy to clipboard operation
consul copied to clipboard

Unable to start Consul Docker container - node-id permission denied

Open chris-aeviator opened this issue 4 years ago • 3 comments

badger_1   | ==> failed to setup node ID: open /consul/data/node-id: permission denied
version: '3'

services:
  badger:
    image: consul:1.8.5
    volumes:
        - ./consul:/consul
    command: agent -server --data-dir=/consul/data -ui -node=server-1 -bootstrap-expect=1 -client=0.0.0.0
ls -la ./consul/data

drwxrwxrwx 4 root  root  4096 Oct 31 13:15 .
drwxrwxrwx 4 root  root  4096 Oct 31 13:07 ..
-rwxrwxrwx 1 korny korny  394 Oct 31 13:07 checkpoint-signature
-rwxrwxrwx 1 korny korny    0 Oct 31 13:15 node-id
drwxrwxrwx 3 korny korny 4096 Oct 31 13:07 raft
drwxrwxrwx 2 korny korny 4096 Oct 31 13:07 serf

what's going on here? Obviously no permission issue possible

chris-aeviator avatar Oct 31 '21 12:10 chris-aeviator

Hey @chris-aeviator

Apologies for the extremely late response, it seems like this fell through the cracks. Were you able to figure out this issue? We'd welcome you sharing any solution you fount to potentially help future users 😄

Amier3 avatar Jul 07 '22 20:07 Amier3

hard to recap - I think it had to do with permissions being set inside the container by consul or the dockerfile is that possible?

chris-aeviator avatar Jul 08 '22 07:07 chris-aeviator

Hey, i just had the same problem. I tried to create a user named consul, and then changed the directory owner to consul, and then succeeded

Allenwalker12345 avatar Jan 20 '23 02:01 Allenwalker12345