omaha-consulting / omaha-server

Google Omaha ("Chromium Update") server
https://omaha-consulting.com
Other
209 stars 83 forks source link

postgres service never starts up #363

Open dcaban-dgdeanwork opened 4 years ago

dcaban-dgdeanwork commented 4 years ago

I followed the instructions in the README and running make up results in the following error:

docker-compose -f docker-compose.dev.yml -p dev build web
Building web
Step 1/7 : FROM crystalnix/omaha-server-base:alpine
 ---> e4988a4d885b
Step 2/7 : RUN pipenv install --system --dev
 ---> Using cache
 ---> f7a58cec9ff0
Step 3/7 : ADD . $omaha
 ---> Using cache
 ---> d89837968971
Step 4/7 : RUN   mkdir /etc/nginx/sites-enabled/ &&   rm /etc/filebeat/filebeat.yml &&   rm /etc/nginx/conf.d/default.conf &&   rm /etc/nginx/nginx.conf &&   rm /etc/supervisord.conf &&   ln -s /srv/omaha/conf/nginx.conf /etc/nginx/ &&   ln -s /srv/omaha/conf/nginx-app.conf /etc/nginx/sites-enabled/ &&   ln -s /srv/omaha/conf/inflate_request.lua /var/lib/nginx &&   ln -s /srv/omaha/conf/supervisord.conf /etc/ &&   ln -s /srv/omaha/conf/filebeat.yml /etc/filebeat/ &&   chmod go-w /etc/filebeat/filebeat.yml
 ---> Using cache
 ---> 1021e15c370d
Step 5/7 : EXPOSE 80
 ---> Using cache
 ---> a40ac7fc5dc5
Step 6/7 : EXPOSE 8080
 ---> Using cache
 ---> c6d4c39ebd3c
Step 7/7 : CMD ["paver", "docker_run"]
 ---> Using cache
 ---> 7acdd58922c4
Successfully built 7acdd58922c4
Successfully tagged dev_web:latest
pipenv run paver up_local_dev_server
---> pavement.up_local_dev_server
docker-compose -f docker-compose.dev.yml -p dev up -d db
Starting dev_db_1 ... done
docker-compose -f docker-compose.dev.yml -p dev up -d web
Removing dev_web_1
Starting dev_db_1 ... 
Starting dev_db_1 ... done
Recreating 3026da679392_dev_web_1 ... error

ERROR: for 3026da679392_dev_web_1  Cannot start service web: Cannot link to a non running container: /dev_db_1 AS /dev_web_1/db

ERROR: for web  Cannot start service web: Cannot link to a non running container: /dev_db_1 AS /dev_web_1/db
ERROR: Encountered errors while bringing up the project.

Captured Task Output:
---------------------

---> pavement.up_local_dev_server
docker-compose -f docker-compose.dev.yml -p dev up -d db
docker-compose -f docker-compose.dev.yml -p dev up -d web

Build failed running pavement.up_local_dev_server: Subprocess return code: 1
Makefile:46: recipe for target 'up' failed
make: *** [up] Error 1

I also tried running make ps to see what was going on and it appears the db service closes as soon as it begins. I'm just trying to setup a local dev server to test this out.

Any ideas?

transilience commented 3 years ago

@dcaban-dgdeanwork we also faced the same issue while trying to setup our server.

it turned out that the postgress fails if password is not set This is the new docker-compose.common.yml

db:
  image: postgres:9.4
  environment:
    POSTGRES_HOST_AUTH_METHOD: trust

redis:
  image: redis:3

web:
  image: crystalnix/omaha-server:dev
  privileged: true
  ports:
    - "9090:80"
  environment:
    DB_HOST: db
    DB_PORT: 5432
    DB_USER: postgres
    DB_NAME: postgres
    DB_PASSWORD: ''
    HOST_NAME: '*'
    SECRET_KEY: 'SECRET_KEY'
    DJANGO_SETTINGS_MODULE: 'omaha_server.settings'
    AWS_ACCESS_KEY_ID: 'AWS_ACCESS_KEY_ID'
    AWS_SECRET_ACCESS_KEY: 'AWS_SECRET_ACCESS_KEY'
    AWS_STORAGE_BUCKET_NAME: 'AWS_STORAGE_BUCKET_NAME'
    REDIS_HOST: redis
    REDIS_PORT: 6379
    OMAHA_SERVER_PRIVATE: 'True'
    AWS_ROLE: 'omaha-private'
    DB_PUBLIC_USER: 'omaha_public'
    DB_PUBLIC_PASSWORD: 'omaha_public_password'
    UWSGI_PROCESSES: 10
    UWSGI_THREADS: 8
    FILEBEAT_HOST: 'localhost'
    FILEBEAT_PORT: '9021'
    ELK_HOST: ''
    ELK_PORT: ''
    FILEBEAT_DESTINATION: ''

then

sudo docker-compose up

starts the server