Docker-compose fail upgrade database


#1

Hi,

I use this one (https://github.com/getsentry/onpremise) but I have already a postgres server in my VPS and I want to use it.
So I change env variable in the docker-compose file.

version: '2'
services:
  base:
restart: unless-stopped
build: .
environment:
  # Run `docker-compose run web config generate-secret-key` to get the SENTRY_SECRET_KEY value.
  SENTRY_SECRET_KEY: 'w*71ods3&hv!fzcbf=(!j_f_lye=p+56*848u--bk@-#8dvg67'
  SENTRY_MEMCACHED_HOST: memcached
  SENTRY_REDIS_HOST: redis
  SENTRY_POSTGRES_HOST: 172.17.0.1
  SENTRY_DB_USER: MyUserName
  SENTRY_DB_PASSWORD: MyPassWord
  SENTRY_DB_NAME: sentry
  SENTRY_EMAIL_HOST: smtp
volumes:
  - ./data/sentry:/var/lib/sentry/files

  smtp:
restart: unless-stopped
image: tianon/exim4

  memcached:
restart: unless-stopped
image: memcached:1.4

  redis:
restart: unless-stopped
image: redis:3.2-alpine

#  postgres:
#    restart: unless-stopped
#    image: postgres:9.5
#    volumes:
#      - ./data/postgres:/var/lib/postgresql/data

  web:
restart: unless-stopped
extends: base
links:
  - redis
  - memcached
#      - postgres
  - smtp
ports:
  - '9000:9000'
networks:
      - reverse-proxy
  - back
environment:
  - VIRTUAL_HOST=sentry.brick-reader.com

  cron:
restart: unless-stopped
extends: base
command: run cron
links:
  - redis
  - memcached
 #     - postgres
  - smtp
  worker:
restart: unless-stopped
extends: base
command: run worker
links:
  - redis
  - memcached
#      - postgres
  - smtp

networks:
  reverse-proxy:
external:
  name: reverse-proxy
  back:
driver: bridge

the database is found but when I do this instruction, docker-compose run --rm web upgrade

I get :

ProgrammingError: ProgrammingError(‘relation “sentry_option” does not exist\nLINE 1: …ion".“value”, “sentry_option”.“last_updated” FROM "sentry_op…\n ^\n’,)
SQL: SELECT “sentry_option”.“id”, “sentry_option”.“key”, “sentry_option”.“value”, “sentry_option”.“last_updated” FROM “sentry_option” WHERE “sentry_option”.“key” = %s
02:43:47 [ERROR] sentry: option.failed-lookup (key=u’github.apps-install-url’)

Do you have any idea to fix that ?

thanks


#2

@Calion54 I’m running into the same issue, did you happen to find a fix for that ?
I’m suspecting the issue to be related with Postgres 10.4, which version are you running ?

Thanks