Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

I can't start from docker-compose (postgres fails) #38

Closed
RyanMarr opened this issue Feb 17, 2018 · 11 comments
Closed

I can't start from docker-compose (postgres fails) #38

RyanMarr opened this issue Feb 17, 2018 · 11 comments

Comments

@RyanMarr
Copy link

Every time I attempt to start from docker-compose up I get a permissions error with postgres starting:

image
This seems to stop the remaining services from starting also.

Here's my compose file:

version: "3.3"

services:
  vesta:
    image: niiknow/vestacp:1.1.6
    container_name: vesta
    volumes:
      - "./data/vestacp/backup:/backup"
      - "./data/vestacp/vesta:/vesta"
      - "./data/vestacp/home:/home"
    ports:
      - "2222:22"
      - "80:80"
      - "443:443"
      - "8083:8083"
    labels:
      - "Vesta Control Panel"
    restart: unless-stopped
@RyanMarr RyanMarr changed the title I can't start I can't start from docker-compose Feb 17, 2018
@RyanMarr RyanMarr changed the title I can't start from docker-compose I can't start from docker-compose (postgres fails) Feb 17, 2018
@noogen
Copy link
Contributor

noogen commented Feb 17, 2018

Is this a new or existing installation upgrade? If this is new and you're starting for the first time, have you try resetting?

$ mv ./data/vestacp/ ./data/vestacp2/
$ mkdir -p ./data/vestacp/

Then start again. The error is saying that it is missing files. Something must have went wrong during initial initialization and it didn't copy all the file it needed.

@RyanMarr
Copy link
Author

This is a new install. I'll give that a shot right now.

@RyanMarr
Copy link
Author

Same issue.

image

@noogen
Copy link
Contributor

noogen commented Feb 17, 2018

I double checked and all permissions look good for the folder. User postgres is in ssl-cert group. The strange thing is that it works for me. After searching around, I'm suspecting the issue is with docker on mapped on certain file system (aufs?):

sous-chefs/postgresql#156 (comment)
moby/moby#783

All point to this specific fix/workaround:
moby/moby#783 (comment)

I'm implementing the fix and working on the build. Will let you know when it can be tested. Thanks.

@RyanMarr
Copy link
Author

It's a weird one. I entered into the running container to manually check as the postgres user, and it still shows access denied.

image
With docker, one would think this behaviour would be constant, I'm not building locally I'm pulling the built container from docker hub. I'm on Ubuntu 14.04 if that's any help.

PS. Thanks for looking into this so quickly.

@noogen
Copy link
Contributor

noogen commented Feb 18, 2018

Can you try/test version 1.1.8? Sorry it took some time because the build server timed out on build of 1.1.7

@RyanMarr
Copy link
Author

I just tried 1.1.8. .... same issue. I'm really scratching my head here.

image

@noogen
Copy link
Contributor

noogen commented Feb 19, 2018

Not sure why it wouldn't work, here is the new permission in 1.1.8:

Screenshot

The folder now own by postgres user and the file is accessible through shell. I'll try to do some more research. I'm really shooting in the dark here as I cannot reproduce it on my end.

@RyanMarr
Copy link
Author

Very odd. Because of docker there should be no difference between environments. That's the whole point of docker. I'll run a test with exact settings on a different machine and I'll try one without volumes on my ubuntu 14.04 machine and see what outcomes occur.

@RyanMarr
Copy link
Author

Update. The version I ran without volumes in the docker-compose.yml file worked. So there must be some issue with my local Volumes. I don't have time to test at the moment but my hunch is that because the volume location is owned by my local user and the docker-compose up command is run by root, there's some permission issue that's cascading up somehow.

I'm going to move my project folder to a root directory owned by root, then run there, see what happens. I was reading that there is some really peculiar permissions scenarios around these key files.

@RyanMarr
Copy link
Author

That fixed it. Creating the volume folders are root user then running docker compose as root was the solution. Thanks for looking into this!

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

No branches or pull requests

2 participants