{"action":"created","issue":{"url":"https://api.github.com/repos/getsentry/onpremise/issues/99","repository_url":"https://api.github.com/repos/getsentry/onpremise","labels_url":"https://api.github.com/repos/getsentry/onpremise/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/onpremise/issues/99/comments","events_url":"https://api.github.com/repos/getsentry/onpremise/issues/99/events","html_url":"https://github.com/getsentry/onpremise/issues/99","id":335041071,"node_id":"MDU6SXNzdWUzMzUwNDEwNzE=","number":99,"title":"run sentry with traefik proxy ","user":{"login":"daton89","id":6856342,"node_id":"MDQ6VXNlcjY4NTYzNDI=","avatar_url":"https://avatars3.githubusercontent.com/u/6856342?v=4","gravatar_id":"","url":"https://api.github.com/users/daton89","html_url":"https://github.com/daton89","followers_url":"https://api.github.com/users/daton89/followers","following_url":"https://api.github.com/users/daton89/following{/other_user}","gists_url":"https://api.github.com/users/daton89/gists{/gist_id}","starred_url":"https://api.github.com/users/daton89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daton89/subscriptions","organizations_url":"https://api.github.com/users/daton89/orgs","repos_url":"https://api.github.com/users/daton89/repos","events_url":"https://api.github.com/users/daton89/events{/privacy}","received_events_url":"https://api.github.com/users/daton89/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-22T22:55:31Z","updated_at":"2018-07-13T15:11:17Z","closed_at":"2018-06-22T22:57:29Z","author_association":"NONE","body":"I'm trying to running sentry behind traefik proxy. \r\n\r\n```\r\n\r\nversion: '2'\r\nservices:\r\n  base:\r\n    hostname: base\r\n    restart: unless-stopped\r\n    build: .\r\n    environment:\r\n      # Run `docker-compose run web config generate-secret-key`\r\n      # to get the SENTRY_SECRET_KEY value.\r\n      SENTRY_SECRET_KEY: ${SENTRY_SECRET_KEY}\r\n      SENTRY_MEMCACHED_HOST: memcached\r\n      SENTRY_REDIS_HOST: redis\r\n      SENTRY_POSTGRES_HOST: postgres\r\n      SENTRY_EMAIL_HOST: smtp\r\n    volumes:\r\n      - ./data/sentry:/var/lib/sentry/files\r\n    networks:\r\n      - sentry_platform\r\n\r\n  smtp:\r\n    hostname: smtp\r\n    restart: unless-stopped\r\n    image: tianon/exim4\r\n    networks:\r\n      - sentry_platform\r\n\r\n  memcached:\r\n    hostname: memcached\r\n    restart: unless-stopped\r\n    image: memcached:1.4\r\n    networks:\r\n      - sentry_platform    \r\n\r\n  redis:\r\n    hostname: redis\r\n    restart: unless-stopped\r\n    image: redis:3.2-alpine\r\n    networks:\r\n      - sentry_platform    \r\n\r\n  postgres:\r\n    hostname: postgres\r\n    restart: unless-stopped\r\n    image: postgres:9.5\r\n    volumes:\r\n      - ./data/postgres:/var/lib/postgresql/data\r\n    networks:\r\n      - sentry_platform\r\n\r\n  web:\r\n    hostname: web\r\n    restart: unless-stopped\r\n    extends: base\r\n    links:\r\n      - redis\r\n      - postgres\r\n      - memcached\r\n      - smtp\r\n    labels:\r\n      - traefik.backend=web\r\n      - traefik.docker.network=traefik_proxy\r\n      - traefik.frontend.rule=Host:sentry.myhost.com\r\n      - traefik.port=9000\r\n    networks:\r\n      - traefik_proxy\r\n      - sentry_platform\r\n  \r\n  cron:\r\n    hostname: cron\r\n    restart: unless-stopped\r\n    extends: base\r\n    command: run cron\r\n    links:\r\n      - redis\r\n      - postgres\r\n      - memcached\r\n      - smtp\r\n    networks:\r\n      - sentry_platform\r\n\r\n  worker:\r\n    hostname: worker\r\n    restart: unless-stopped\r\n    extends: base\r\n    command: run worker\r\n    links:\r\n      - redis\r\n      - postgres\r\n      - memcached\r\n      - smtp\r\n    networks:\r\n      - sentry_platform\r\n\r\nnetworks:\r\n  traefik_proxy:\r\n    external: true\r\n  sentry_platform:\r\n    external: false\r\n    driver: bridge\r\n```\r\n\r\nthe first problem is when i run the migrate \r\n\r\n```\r\nroot@fedora-atomic:/home/fedora/sentry# docker-compose run --rm web upgrade\r\nStarting sentry_smtp_1 ...\r\nStarting sentry_postgres_1 ...\r\nStarting sentry_postgres_1 ... done\r\nStarting sentry_memcached_1 ... done\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/options/store.py\", line 165, in get_store\r\n    value = self.model.objects.get(key=key.name).value\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/manager.py\", line 151, in get\r\n    return self.get_queryset().get(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 304, in get\r\n    num = len(clone)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 77, in __len__\r\n    self._fetch_all()\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 857, in _fetch_all\r\n    self._result_cache = list(self.iterator())\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 220, in iterator\r\n    for row in compiler.results_iter():\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 713, in results_iter\r\n    for rows in self.execute_sql(MULTI):\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 786, in execute_sql\r\n    cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/raven/contrib/django/client.py\", line 112, in execute\r\n    return real_execute(self, sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/backends/util.py\", line 53, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/utils.py\", line 99, in __exit__\r\n    six.reraise(dj_exc_type, dj_exc_value, traceback)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/backends/util.py\", line 53, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 80, in inner\r\n    raise_the_exception(self.db, e)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 78, in inner\r\n    return func(self, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 22, in inner\r\n    return func(self, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 101, in inner\r\n    six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 94, in inner\r\n    return func(self, sql, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/base.py\", line 39, in execute\r\n    return self.cursor.execute(sql, params)\r\nProgrammingError: ProgrammingError('relation \"sentry_option\" does not exist\\nLINE 1: ...ion\".\"value\", \"sentry_option\".\"last_updated\" FROM \"sentry_op...\\n                                                             ^\\n',)\r\nSQL: SELECT \"sentry_option\".\"id\", \"sentry_option\".\"key\", \"sentry_option\".\"value\", \"sentry_option\".\"last_updated\" FROM \"sentry_option\" WHERE \"sentry_option\".\"key\" = %s\r\n14:05:26 [ERROR] sentry: option.failed-lookup (key=u'github.apps-install-url')\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/utils/raven.py\", line 75, in send\r\n    project = Project.objects.get_from_cache(id=settings.SENTRY_PROJECT)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/models/manager.py\", line 245, in get_from_cache\r\n    result = self.get(**kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/manager.py\", line 151, in get\r\n    return self.get_queryset().get(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 304, in get\r\n    num = len(clone)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 77, in __len__\r\n    self._fetch_all()\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 857, in _fetch_all\r\n    self._result_cache = list(self.iterator())\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/query.py\", line 220, in iterator\r\n    for row in compiler.results_iter():\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 713, in results_iter\r\n    for rows in self.execute_sql(MULTI):\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 786, in execute_sql\r\n    cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/raven/contrib/django/client.py\", line 112, in execute\r\n    return real_execute(self, sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/backends/util.py\", line 53, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/utils.py\", line 99, in __exit__\r\n    six.reraise(dj_exc_type, dj_exc_value, traceback)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/db/backends/util.py\", line 53, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 80, in inner\r\n    raise_the_exception(self.db, e)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 78, in inner\r\n    return func(self, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 22, in inner\r\n    return func(self, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 101, in inner\r\n    six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py\", line 94, in inner\r\n    return func(self, sql, *args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/sentry/db/postgres/base.py\", line 39, in execute\r\n    return self.cursor.execute(sql, params)\r\nProgrammingError: ProgrammingError('relation \"sentry_project\" does not exist\\nLINE 1: ...roject\".\"flags\", \"sentry_project\".\"platform\" FROM \"sentry_pr...\\n                                                             ^\\n',)\r\nSQL: SELECT \"sentry_project\".\"id\", \"sentry_project\".\"slug\", \"sentry_project\".\"name\", \"sentry_project\".\"forced_color\", \"sentry_project\".\"organization_id\", \"sentry_project\".\"team_id\", \"sentry_project\".\"public\", \"sentry_project\".\"date_added\", \"sentry_project\".\"status\", \"sentry_project\".\"first_event\", \"sentry_project\".\"flags\", \"sentry_project\".\"platform\" FROM \"sentry_project\" WHERE \"sentry_project\".\"id\" = %s\r\n14:05:26 [ERROR] sentry.errors: Unable to fetch internal project\r\n14:05:26 [INFO] sentry.plugins.github: apps-not-configured\r\n\r\nSyncing...\r\nCreating tables ...\r\nCreating table django_admin_log\r\nCreating table auth_permission\r\nCreating table auth_group_permissions\r\nCreating table auth_group\r\nCreating table django_content_type\r\nCreating table django_session\r\nCreating table django_site\r\nCreating table south_migrationhistory\r\nInstalling custom SQL ...\r\nInstalling indexes ...\r\nInstalled 0 object(s) from 0 fixture(s)\r\n... more\r\n```\r\n\r\nthen when i run docker-compose up -d it seems that the containers doesn't deal to each other... \r\n\r\ntraefik generate the ssl certificate so the result should be access sentry from https://sentry.myhost.com\r\nbut in the web container logs i have: sentry Unable to fetch ProjectKey for internal project\r\n\r\ni tried to use networks instead of links because when i use traefik i need to link the web on the traefik proxy network to make able traefik to proxy the request to web \r\n\r\nso i made a sentry_platform network to make containers talk to each other, and then i tried to use links and networks in the same time... \r\n\r\ni'm running docker on a digitalocean droplet with 3gb ram 1cpu and 60gb hd "},"comment":{"url":"https://api.github.com/repos/getsentry/onpremise/issues/comments/404862561","html_url":"https://github.com/getsentry/onpremise/issues/99#issuecomment-404862561","issue_url":"https://api.github.com/repos/getsentry/onpremise/issues/99","id":404862561,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDg2MjU2MQ==","user":{"login":"revolunet","id":124937,"node_id":"MDQ6VXNlcjEyNDkzNw==","avatar_url":"https://avatars0.githubusercontent.com/u/124937?v=4","gravatar_id":"","url":"https://api.github.com/users/revolunet","html_url":"https://github.com/revolunet","followers_url":"https://api.github.com/users/revolunet/followers","following_url":"https://api.github.com/users/revolunet/following{/other_user}","gists_url":"https://api.github.com/users/revolunet/gists{/gist_id}","starred_url":"https://api.github.com/users/revolunet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revolunet/subscriptions","organizations_url":"https://api.github.com/users/revolunet/orgs","repos_url":"https://api.github.com/users/revolunet/repos","events_url":"https://api.github.com/users/revolunet/events{/privacy}","received_events_url":"https://api.github.com/users/revolunet/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T15:11:17Z","updated_at":"2018-07-13T15:11:17Z","author_association":"CONTRIBUTOR","body":"Also, here's a traefik compatible docker-compose :\r\n\r\n```yml\r\nversion: '3.4'\r\nx-defaults: &defaults\r\n  restart: unless-stopped\r\n  build: .\r\n  environment:\r\n    # Run `docker-compose run web config generate-secret-key`\r\n    # to get the SENTRY_SECRET_KEY value.\r\n    SENTRY_SECRET_KEY: ''\r\n    SENTRY_MEMCACHED_HOST: memcached\r\n    SENTRY_REDIS_HOST: redis\r\n    SENTRY_POSTGRES_HOST: postgres\r\n    SENTRY_EMAIL_HOST: smtp\r\n  volumes:\r\n    - sentry-data:/var/lib/sentry/files\r\n\r\nservices:\r\n  smtp:\r\n    restart: unless-stopped\r\n    image: tianon/exim4\r\n    networks:\r\n      - sentry\r\n    labels:\r\n      - \"traefik.enable=false\"\r\n\r\n  memcached:\r\n    restart: unless-stopped\r\n    image: memcached:1.4\r\n    labels:\r\n      - \"traefik.enable=false\"\r\n    networks:\r\n      - sentry\r\n\r\n  redis:\r\n    restart: unless-stopped\r\n    image: redis:3.2-alpine\r\n    labels:\r\n      - \"traefik.enable=false\"\r\n    networks:\r\n      - sentry\r\n\r\n  postgres:\r\n    restart: unless-stopped\r\n    image: postgres:9.5\r\n    volumes:\r\n      - sentry-postgres:/var/lib/postgresql/data\r\n    labels:\r\n      - \"traefik.enable=false\"\r\n    networks:\r\n      - sentry\r\n\r\n  web:\r\n    <<: *defaults\r\n    labels:\r\n      - \"traefik.backend=sentry\"\r\n      - \"traefik.enable=true\"\r\n      - \"traefik.port=9000\"\r\n      - \"traefik.frontend.rule=Host:sentry.pouet.com\"\r\n      - \"traefik.docker.network=traefik_webgateway\"\r\n    networks:\r\n      - web\r\n      - sentry\r\n\r\n  cron:\r\n    <<: *defaults\r\n    command: run cron\r\n    labels:\r\n      - \"traefik.enable=false\"\r\n    networks:\r\n      - sentry\r\n\r\n  worker:\r\n    <<: *defaults\r\n    command: run worker\r\n    networks:\r\n      - sentry\r\n    labels:\r\n      - \"traefik.enable=false\"\r\n\r\nnetworks:\r\n  sentry:\r\n    driver: bridge\r\n  web:\r\n    external:\r\n      name: traefik_webgateway\r\n\r\nvolumes:\r\n    sentry-data:\r\n    sentry-postgres:\r\n```"}}
{"actor":{"display_login":"revolunet"}}