vue+sentry实现前端监控

4,945 阅读28分钟

前端代码线上出错如何解决?使用sentry

集成Sentry

1.登录官网 sentry.io,注册账号,建立组织(organization)和项目(project)

2.安装sentry sdk

yarn add @sentry/browser
yarn add @sentry/integrations

3.在.env.development.env.production.env.staging文件中定义sentry版本号的环境变量 VUE_APP_RELEASE_VERSION = 'vue-admin-template@0.0.2'

4.在main.js文件中初始化监控服务

import Vue from 'vue'
import * as Sentry from '@sentry/browser';
import { Vue as VueIntegration } from '@sentry/integrations';

Sentry.init({
  dsn: 'https://xxxxxxxxxxxxxxxxxxxx@xxxxxx.ingest.sentry.io/xxxxxx',
  integrations: [new VueIntegration({ Vue, attachProps: true })],
  release: process.env.VUE_APP_RELEASE_VERSION,
  logErrors: true
})

添加完毕后,运行 npm run dev,随便在某个组件地方制造一个错误,正常的话 sentry 会成功捕获到错误

比如我在src\views\dashboard\index.vue中制造如下错误

created() {
    const a = {}
    console.log(a.name.name)
    new Error('抛出错误')
}

刷新页面后,在谷歌浏览器按F12,切换到Network可看到,错误已通过post请求上报成功

登陆sentry官网可找到该错误信息

点击可展开更详细的错误信息

source map 上传

1.在项目根目录,新建文件.sentryclirc

[auth]
token = your token

[defaults]
url = https://sentry.io
org = zte-vw
project = vue-admin-template

2.安装webpack插件

npm install --save-dev @sentry/webpack-plugin

3.修改vue.config.js,增加如下代码

const SentryWebpackPlugin = require('@sentry/webpack-plugin')

configureWebpack: {
    name: name,
    resolve: {
      alias: {
        '@': resolve('src')
      }
    },
    plugins: [
      new SentryWebpackPlugin({
        include: './dist',
        release: process.env.VUE_APP_RELEASE_VERSION,
        configFile: 'sentry.properties',
        ignore: ['node_modules'],
        urlPrefix: '~/'
      })
    ]
  }

4.部署代码至服务器 将项目打包,部署至服务器,访问地址为: www.chmc.xyz:1020

同样的,刷新Dashboard页面,会看到错误上报

重点是,已经能够映射到具体的代码行位置了,这就是由于上传 source map 的原因

sentry还会给你的注册邮箱,发送错误监控的汇总信息,简直不要太贴心

Github Actions 部署项目

参考链接:

GitHub Actions 入门教程

Github Actions 部署vue项目

vue.config.js 文件记得要修改 publicPath,由于github pages默认的地址是包含子目录的,所以需要指定一下publicPath的路径为项目名

module.exports = {
  publicPath: process.env.NODE_ENV === 'production'
    ? '/your project name/'
    : '/',
  outputDir: 'dist',
  assetsDir: 'static',
  lintOnSave: process.env.NODE_ENV === 'development',
  productionSourceMap: true
}

附上我的Acitons yum文件内容

name: Build and Deploy
on: [push]
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
        with:
          persist-credentials: false

      - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
        run: |
          npm install
          npm run build:prod

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@releases/v3
        with:
          ACCESS_TOKEN: ${{ secrets.sentry_token }}
          BRANCH: gh-pages # The branch the action should deploy to.
          FOLDER: dist # The folder the action should deploy.

部署后地址

访问后再次登录sentry官网,可看到特定版本号上传的bug

点击可展开详情

Docker搭建Sentry

错误直接上报至sentry官网,存在信息安全的风险。因此在自己的服务器搭建一套sentry系统是很有必要的。可以用docker或python搭建本地sentry系统,推荐用docker

参考网址

Ubuntu离线安装docker-compose
CentOS离线安装docker-compose
Docker-Compose下载地址

Docker搭建Sentry官网教程
Sentry安装源码
Sentry使用者手册
Sentry开发者手册
Sentry官方论坛

Github提的issues_521
Github提的issues_449
Sentry论坛_8880

安装环境

$ uname -a
Linux szdev-PC 4.15.0-88-generic #88~16.04.1-Ubuntu SMP Wed Feb 12 04:19:15 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ docker -v
Docker version 18.09.7, build 2d0083d
$ docker-compose -v
docker-compose version 1.24.0, build 0aa59064

安装异常问题

onpremise/install.sh,第4行增加-v,会打印详细的注释,即 dc="docker-compose --no-ansi -v"

证书生成不了

./install.sh 运行到最后报错:

FAIL: Cannot read credentials back from relay/credentials.json.

因为 $dcr --no-deps -v $(pwd)/$RELAY_CONFIG_YML:/tmp/config.yml relay --config /tmp credentials generate --stdout > "$RELAY_CREDENTIALS_JSON" 语句不能向 relay/credentials.json 文件写入各种keys。搜索后有说和 docker-compose 版本有关,试了 1.19、1.23、1.24、1.26 都不行。

又搜索到有人用手工生成,写入 relay/credentials.json 文件,采纳之。

docker-compose run --rm --no-deps -v $(pwd)/relay/config.yml:/tmp/config.yml relay --config /tmp credentials generate --stdout

容器一直在复位

现象:docker-compose up -d 后某些服务始终在重启:

$ docker ps -a |grep Restarting
393816c1ca04  sentry-onpremise-local       "/bin/sh -c 'exec /d…"   14 hours ago    Restarting (1) 38 seconds ago  sentry_onpremise_ingest-consumer_1
56bf0b79f522  sentry-onpremise-local       "/bin/sh -c 'exec /d…"   14 hours ago    Restarting (1) 56 seconds ago  sentry_onpremise_post-process-forwarder_1
e271aeb54084  sentry-onpremise-local       "/bin/sh -c 'exec /d…"   14 hours ago    Restarting (1) 36 seconds ago  sentry_onpremise_cron_1
276fb182cfc9  sentry-onpremise-local       "/bin/sh -c 'exec /d…"   14 hours ago    Restarting (1) 43 seconds ago  sentry_onpremise_worker_1
f9022f652cef  sentry-onpremise-local       "/bin/sh -c 'exec /d…"   14 hours ago    Restarting (1) 32 seconds ago  sentry_onpremise_web_1
e62b2a0d5520  getsentry/relay:latest       "/bin/bash /docker-e…"   15 hours ago    Restarting (1) 56 seconds ago  sentry_onpremise_relay_1

前面5个容器都是基于同一个image(sentry-onpremise-local),复位原因也都一样:找不到 config 文件:

$ docker logs sentry_onpremise_web_1
Error: Configuration file does not exist. Use 'sentry init' to initialize the file.

基于 getsentry/relay image 的容器复位原因是打不开配置文件,没有权限:

$ docker logs sentry_onpremise_relay_1
error: could not open config file (file /work/.relay/config.yml)
  caused by: Permission denied (os error 13)

粗略猜测,2个报错是同一类原因:挂载到容器的文件,容器访问不了。

试一下手工挂载,能够看到config.yml

$ docker run -it --rm  -v $(pwd)/relay:/work/.relay --entrypoint="/bin/bash" getsentry/relay -c "ls -la /work/.relay"
total 16
drwxrwxrwx 2  1000  1000 4096 May 18 09:55 .
drwxr-xr-x 3 relay relay 4096 May 19 02:23 ..
-rwxrwxrwx 1  1000  1000  220 May 18 02:29 config.yml
-rw------- 1  1000  1000  163 May 18 09:57 credentials.json

但这种手工挂载其实背后是切换了用户权限的,不再使用 relay 容器中的 relay 用户,而是此容器中的 root,所以看到也是正常的,并不能说明 relay 用户能看到。

这种故障常见于 docker 容器中不使用 root,而是自己创建了新用户(比如 relay 创建了 relay 用户、sentry 创建了 sentry 用户),导致新用户无法访问以 root 权限挂载到容器的文件。

这篇 issue Configuration file does not exist while setting up database in ./install.sh 中有比较详细的说明。

解决办法有2种:

  1. chmod 777 -R relay sentry —— 最简单、高效
  2. 修改 docker-compose.yml,增加 uid:gid 字段,让 sentry 用户对应到 host 用户上。
    • Docker容器运行的时候,如果没有专门指定user, 默认以root用户运行。
    • 可以指定容器内 uid/gid 与 host 上的 uid/gid 的对应关系,以便操作 host 上的文件。

502 Bad Gateway

容器貌似都正确跑起来了,访问 http://<ip>:9000 时被重定向到 http://<ip>:9000/auth/login

然后报错:

502 Bad Gateway nginx/1.16.1

直接搜了一把官方的论坛,有这样几个帖子:

自己来查吧,先看看 nginx.conf

upstream sentry {
    server web:9000;
}
……
location / {
    proxy_pass http://sentry;
}

重定向到了 web 这个服务的 auth/login 了,从 docker-compose.yml 中可以看到:

web:
  << : *sentry_defaults

web 就是一个sentry。

$ docker logs sentry_onpremise_web_1
.......
django.db.utils.ProgrammingError: UndefinedTable('relation "sentry_projectkey" does not exist\nLINE 1: ...te_limit_window", "sentry_projectkey"."data" FROM "sentry_pr...\n^\n',)
SQL: SELECT "sentry_projectkey"."id", "sentry_projectkey"."project_id", "sentry_projectkey"."label", "sentry_projectkey"."public_key", "sentry_projectkey"."secret_key", "sentry_projectkey"."roles", "sentry_projectkey"."status", "sentry_projectkey"."date_added", "sentry_projectkey"."rate_limit_count", "sentry_projectkey"."rate_limit_window", "sentry_projectkey"."data" FROM "sentry_projectkey" WHERE ("sentry_projectkey"."project_id" = %s AND "sentry_projectkey"."roles" = (("sentry_projectkey"."roles" | %s))) LIMIT 1

查看 web 服务的log,似乎找不到 sentry_projectkey 表,难道数据库没有初始化没有成功?进入 postgres 看看

$ docker exec -it sentry_onpremise_postgres_1 /bin/bash
root@ad78ec3d0143:/# psql -U postgres
psql (9.6.18)
Type "help" for help.

postgres=# \l

果然看不到sentry需要的数据库和表。

如何在 PostgreSql 中建库和建表呢?经过一番学习,了解到 sentry upgrade 就是干这个的,install.sh 中也在 web 容器中执行了此命令,并且放在了数据库的段落里。

报此错误说明 install.sh 中的

$dcr web upgrade

没有执行成功,瞎猜估计也是权限问题,容器中没有执行此命令的权限。那就手工进入容器执行一下吧。

$ docker exec -it sentry_onpremise_web_1 /bin/bash
root@146cbbecb265:/# sentry --version
sentry, version 10.1.0.dev0 (bdf6f6418d25)
root@146cbbecb265:/# sentry upgrade
......

看打印应该是执行了建库和建表操作了,期间还要求设置 admin 的账号和密码。执行完成后再次进 postgres 中看看:

$ docker exec -it sentry_onpremise_postgres_1 /bin/bash
root@ad78ec3d0143:/# psql -U postgres
psql (9.6.18)
Type "help" for help.

postgres=# \l
                                 List of databases
   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
-----------+----------+----------+------------+------------+-----------------------
 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 | 

......

postgres=# \dt
                        List of relations
 Schema |                Name                 | Type  |  Owner   
--------+-------------------------------------+-------+----------
 public | auth_authenticator                  | table | postgres
 public | auth_group                          | table | postgres
 public | auth_group_permissions              | table | postgres
 public | auth_permission                     | table | postgres
 public | auth_user                           | table | postgres
 public | django_admin_log                    | table | postgres

恩,非常好!一切都似乎OK了。

再次 http://<ip>:9000 ,可以了!

无法创建项目

打开 http://<ip>:9000/organizations/sentry/projects/ 会报错 Unable to fetch all project stats

打开 http://<ip>:9000/organizations/sentry/discover/queries/ 会报错 Internal Error

查看 web 服务的 log

$ docker logs sentry_onpremise_web_1
QueryExecutionError: [60] DB::Exception: Table default.sentry_local doesn't exist.. Stack trace:

0. 0x564001aa6e90 StackTrace::StackTrace() /usr/bin/clickhouse
1. 0x564001aa6c65 DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) /usr/bin/clickhouse
2. 0x564004e06241 DB::Context::getTableImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Exception*) const /usr/bin/clickhouse
3. 0x564004e06431 DB::Context::getTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/bin/clickhouse
4. 0x564004e76581 DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
5. 0x564004e766c7 DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
6. 0x564004e9a9db DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
7. 0x564004e52988 DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum) /usr/bin/clickhouse
8. 0x564004f9cc1a ? /usr/bin/clickhouse
9. 0x564004f9e09e DB::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, bool) /usr/bin/clickhouse
10. 0x564001b30514 DB::TCPHandler::runImpl() /usr/bin/clickhouse
11. 0x564001b30f5b DB::TCPHandler::run() /usr/bin/clickhouse
12. 0x564005a54df0 Poco::Net::TCPServerConnection::start() /usr/bin/clickhouse
13. 0x564005a5550d Poco::Net::TCPServerDispatcher::run() /usr/bin/clickhouse
14. 0x56400712b6b1 Poco::PooledThread::run() /usr/bin/clickhouse
15. 0x56400712945c Poco::ThreadImpl::runnableEntry(void*) /usr/bin/clickhouse
16. 0x56400789f5c0 ? /usr/bin/clickhouse
17. 0x7fdc747ec6db start_thread /lib/x86_64-linux-gnu/libpthread-2.27.so
18. 0x7fdc7410988f __clone /lib/x86_64-linux-gnu/libc-2.27.so

参考 forum.sentry.io/t/sentry-10…

$ docker-compose run --rm snuba-api migrate
[root@localhost onpremise]# docker-compose run --rm snuba-api migrate
Starting sentry_onpremise_clickhouse_1 ... one
Starting sentry_onpremise_redis_1      ... done
Starting sentry_onpremise_clickhouse_1 ... done
Starting sentry_onpremise_kafka_1      ... done
+ '[' m = - ']'
+ snuba migrate --help
+ set -- snuba migrate
+ set gosu snuba snuba migrate
+ exec gosu snuba snuba migrate
2020-06-02 05:45:33,497 Creating tables for storage events
2020-06-02 05:45:33,975 Migrating storage events
2020-06-02 05:45:34,051 Creating tables for storage errors
2020-06-02 05:45:34,124 Migrating storage errors
2020-06-02 05:45:34,175 Creating tables for storage groupedmessages
2020-06-02 05:45:34,179 Migrating storage groupedmessages
2020-06-02 05:45:34,192 Creating tables for storage groupassignees
2020-06-02 05:45:34,195 Migrating storage groupassignees
2020-06-02 05:45:34,208 Creating tables for storage outcomes_raw
2020-06-02 05:45:34,212 Migrating storage outcomes_raw
2020-06-02 05:45:34,224 Creating tables for storage outcomes_hourly
2020-06-02 05:45:34,281 Migrating storage outcomes_hourly
2020-06-02 05:45:34,287 Creating tables for storage sessions_raw
2020-06-02 05:45:34,291 Migrating storage sessions_raw
2020-06-02 05:45:34,305 Creating tables for storage sessions_hourly
2020-06-02 05:45:34,396 Migrating storage sessions_hourly
2020-06-02 05:45:34,414 Creating tables for storage transactions
2020-06-02 05:45:34,422 Migrating storage transactions

再次访问 http://<ip>:9000/organizations/sentry/projects/http://<ip>:9000/organizations/sentry/discover/queries/ 就不会报错了。也可以新建项目了。

完整安装过程

$ ./install.sh
Checking minimum requirements...
docker-compose version 1.24.0, build 0aa59064
docker-compose version 1.24.0, build 0aa59064

Creating volumes for persistent storage...
Created sentry-data.
Created sentry-postgres.
Created sentry-redis.
Created sentry-zookeeper.
Created sentry-kafka.
Created sentry-clickhouse.
Created sentry-symbolicator.

Creating sentry/sentry.conf.py...
Creating sentry/config.yml...
Creating sentry/requirements.txt...

Generating secret key...
Secret key written to sentry/config.yml

Fetching and updating Docker images...

docker-compose version 1.24.0, build 0aa59064
latest: Pulling from getsentry/sentry
Digest: sha256:9458435f20a198c1a0953c1252c227b8ca26e7928d9bac3e6e9ce06715ea4c64
Status: Image is up to date for getsentry/sentry:latest

Building and tagging Docker images...

docker-compose version 1.24.0, build 0aa59064
docker-compose version 1.24.0, build 0aa59064

Docker images built.
./install.sh: 第 177 行: [: docker-compose version 1.24.0, build 0aa59064: 需要整数表达式
Bootstrapping and migrating Snuba...
docker-compose version 1.24.0, build 0aa59064


Setting up database...
docker-compose version 1.24.0, build 0aa59064
Migrating file storage...
docker-compose version 1.24.0, build 0aa59064

Generating Relay credentials...
Relay credentials written to relay/credentials.json
FAIL: Cannot read credentials back from relay/credentials.json.
      Please ensure this file is readable and contains valid credentials.

$ docker-compose run --rm --no-deps -v $(pwd)/relay/config.yml:/tmp/config.yml relay --config /tmp credentials generate --stdout
Creating volume "sentry_onpremise_sentry-secrets" with default driver
Creating volume "sentry_onpremise_sentry-smtp" with default driver
Creating volume "sentry_onpremise_sentry-zookeeper-log" with default driver
Creating volume "sentry_onpremise_sentry-kafka-log" with default driver
Creating volume "sentry_onpremise_sentry-smtp-log" with default driver
Creating volume "sentry_onpremise_sentry-clickhouse-log" with default driver
{"secret_key":"2ofhSDo8YR4E8MbVDIx_HOl7y8WcVSuLUnCxDszAKQg","public_key":"CJjhNxmLHYjIHED_SEMTltQPMhlu3foPPehh7LDDnVs","id":"e2c7173c-0134-4bd1-a27c-ded95eadc211"}


$ ./install.sh
Checking minimum requirements...
docker-compose version 1.24.0, build 0aa59064
docker-compose version 1.24.0, build 0aa59064

Creating volumes for persistent storage...
Created sentry-data.
Created sentry-postgres.
Created sentry-redis.
Created sentry-zookeeper.
Created sentry-kafka.
Created sentry-clickhouse.
Created sentry-symbolicator.

sentry/sentry.conf.py already exists, skipped creation.
sentry/config.yml already exists, skipped creation.
sentry/requirements.txt already exists, skipped creation.

Fetching and updating Docker images...

docker-compose version 1.24.0, build 0aa59064
latest: Pulling from getsentry/sentry
Digest: sha256:9458435f20a198c1a0953c1252c227b8ca26e7928d9bac3e6e9ce06715ea4c64
Status: Image is up to date for getsentry/sentry:latest

Building and tagging Docker images...

docker-compose version 1.24.0, build 0aa59064
docker-compose version 1.24.0, build 0aa59064

Docker images built.
./install.sh: 第 177 行: [: docker-compose version 1.24.0, build 0aa59064: 需要整数表达式
Bootstrapping and migrating Snuba...
docker-compose version 1.24.0, build 0aa59064


Setting up database...
docker-compose version 1.24.0, build 0aa59064
Migrating file storage...
docker-compose version 1.24.0, build 0aa59064
Relay public key written to sentry/sentry.conf.py

Cleaning up...

----------------
You're all done! Run the following command to get Sentry running:

  docker-compose up -d

$ docker-compose up -d
Creating sentry_onpremise_symbolicator-cleanup_1 ... done
Creating sentry_onpremise_zookeeper_1            ... done
Creating sentry_onpremise_memcached_1            ... done
Creating sentry_onpremise_smtp_1                 ... done
Creating sentry_onpremise_symbolicator_1         ... done
Creating sentry_onpremise_postgres_1             ... done
Creating sentry_onpremise_redis_1                ... done
Creating sentry_onpremise_clickhouse_1           ... done
Creating sentry_onpremise_kafka_1                ... done
Creating sentry_onpremise_snuba-api_1               ... done
Creating sentry_onpremise_snuba-cleanup_1           ... done
Creating sentry_onpremise_snuba-replacer_1          ... done
Creating sentry_onpremise_relay_1                   ... done
Creating sentry_onpremise_snuba-consumer_1          ... done
Creating sentry_onpremise_snuba-outcomes-consumer_1 ... done
Creating sentry_onpremise_web_1                     ... done
Creating sentry_onpremise_ingest-consumer_1         ... done
Creating sentry_onpremise_post-process-forwarder_1  ... done
Creating sentry_onpremise_sentry-cleanup_1          ... done
Creating sentry_onpremise_worker_1                  ... done
Creating sentry_onpremise_cron_1                    ... done
Creating sentry_onpremise_nginx_1                   ... done

$ docker ps -a |grep sentry
e8290bed9fef        nginx:1.16                                              "nginx -g 'daemon of…"   7 minutes ago       Up 7 minutes                            0.0.0.0:9000->80/tcp                sentry_onpremise_nginx_1
f661e5b33014        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   7 minutes ago       Up Less than a second                   9000/tcp                            sentry_onpremise_worker_1
1e6fe70488c1        sentry-cleanup-onpremise-local                          "/entrypoint.sh '0 0…"   7 minutes ago       Up 7 minutes                            9000/tcp                            sentry_onpremise_sentry-cleanup_1
6590bdae7ec0        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   7 minutes ago       Restarting (1) 5 seconds ago                                                sentry_onpremise_web_1
f6b962a8834b        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   7 minutes ago       Restarting (1) Less than a second ago                                       sentry_onpremise_cron_1
131b65a83587        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   7 minutes ago       Restarting (1) 1 second ago                                                 sentry_onpremise_ingest-consumer_1
d7e918e5da9d        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   7 minutes ago       Restarting (1) 6 seconds ago                                                sentry_onpremise_post-process-forwarder_1
91e8f1082b09        getsentry/snuba:latest                                  "./docker_entrypoint…"   7 minutes ago       Up 7 minutes                            1218/tcp                            sentry_onpremise_snuba-outcomes-consumer_1
4ce8ab3910b9        getsentry/snuba:latest                                  "./docker_entrypoint…"   7 minutes ago       Up 7 minutes                            1218/tcp                            sentry_onpremise_snuba-replacer_1
c8e28840d751        getsentry/relay:latest                                  "/bin/bash /docker-e"   7 minutes ago       Restarting (1) 35 seconds ago                                               sentry_onpremise_relay_1
899f28b30b69        getsentry/snuba:latest                                  "./docker_entrypoint…"   7 minutes ago       Up 7 minutes                            1218/tcp                            sentry_onpremise_snuba-api_1
64529430d1bd        snuba-cleanup-onpremise-local                           "/entrypoint.sh '*/5…"   7 minutes ago       Up 7 minutes                            1218/tcp                            sentry_onpremise_snuba-cleanup_1
8f429689c64f        getsentry/snuba:latest                                  "./docker_entrypoint…"   7 minutes ago       Up 7 minutes                            1218/tcp                            sentry_onpremise_snuba-consumer_1
fc108045672d        confluentinc/cp-kafka:5.5.0                             "/etc/confluent/dock…"   7 minutes ago       Up 3 minutes                            9092/tcp                            sentry_onpremise_kafka_1
2fc5f562fe8e        redis:5.0-alpine                                        "docker-entrypoint.s…"   7 minutes ago       Up 7 minutes                            6379/tcp                            sentry_onpremise_redis_1
3376e6bb3601        yandex/clickhouse-server:19.17                          "/entrypoint.sh"         7 minutes ago       Up 7 minutes                            8123/tcp, 9000/tcp, 9009/tcp        sentry_onpremise_clickhouse_1
eed5f91e4fbf        postgres:9.6                                            "docker-entrypoint.s…"   7 minutes ago       Up 7 minutes                            5432/tcp                            sentry_onpremise_postgres_1
726ec4230e82        memcached:1.5-alpine                                    "docker-entrypoint.s…"   7 minutes ago       Up 7 minutes                            11211/tcp                           sentry_onpremise_memcached_1
6d48eb09c78a        confluentinc/cp-zookeeper:5.5.0                         "/etc/confluent/dock…"   7 minutes ago       Up 7 minutes                            2181/tcp, 2888/tcp, 3888/tcp        sentry_onpremise_zookeeper_1
b4335fb60ddc        symbolicator-cleanup-onpremise-local                    "/entrypoint.sh '55 …"   7 minutes ago       Up 7 minutes                            3021/tcp                            sentry_onpremise_symbolicator-cleanup_1
ef8e1f190ebf        tianon/exim4                                            "docker-entrypoint.s…"   7 minutes ago       Up 7 minutes                            25/tcp                              sentry_onpremise_smtp_1
841650c27d71        getsentry/symbolicator:latest                           "/bin/bash /docker-e"   7 minutes ago       Up 7 minutes                            3021/tcp                            sentry_onpremise_symbolicator_1

$ docker ps -a |grep Restarting
f661e5b33014        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   9 minutes ago       Restarting (1) 42 seconds ago                                       sentry_onpremise_worker_1
6590bdae7ec0        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   9 minutes ago       Restarting (1) 39 seconds ago                                       sentry_onpremise_web_1
f6b962a8834b        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   9 minutes ago       Restarting (1) 44 seconds ago                                       sentry_onpremise_cron_1
131b65a83587        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   9 minutes ago       Restarting (1) 45 seconds ago                                       sentry_onpremise_ingest-consumer_1
d7e918e5da9d        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   9 minutes ago       Restarting (1) 41 seconds ago                                       sentry_onpremise_post-process-forwarder_1
c8e28840d751        getsentry/relay:latest                                  "/bin/bash /docker-e…"   9 minutes ago       Restarting (1) 52 seconds ago                                       sentry_onpremise_relay_1

$ docker logs sentry_onpremise_web_1
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'

$ chmod 777 -R relay sentry
$ docker-compose restart
Restarting sentry_onpremise_nginx_1                   ... done
Restarting sentry_onpremise_worker_1                  ... done
Restarting sentry_onpremise_sentry-cleanup_1          ... done
Restarting sentry_onpremise_web_1                     ... done
Restarting sentry_onpremise_cron_1                    ... done
Restarting sentry_onpremise_ingest-consumer_1         ... done
Restarting sentry_onpremise_post-process-forwarder_1  ... done
Restarting sentry_onpremise_snuba-outcomes-consumer_1 ... done
Restarting sentry_onpremise_snuba-replacer_1          ... done
Restarting sentry_onpremise_relay_1                   ... done
Restarting sentry_onpremise_snuba-api_1               ... done
Restarting sentry_onpremise_snuba-cleanup_1           ... done
Restarting sentry_onpremise_snuba-consumer_1          ... done
Restarting sentry_onpremise_kafka_1                   ... done
Restarting sentry_onpremise_redis_1                   ... done
Restarting sentry_onpremise_clickhouse_1              ... done
Restarting sentry_onpremise_postgres_1                ... done
Restarting sentry_onpremise_memcached_1               ... done
Restarting sentry_onpremise_zookeeper_1               ... done
Restarting sentry_onpremise_symbolicator-cleanup_1    ... done
Restarting sentry_onpremise_smtp_1                    ... done
Restarting sentry_onpremise_symbolicator_1            ... done

$ docker ps -a |grep sentry
e8290bed9fef        nginx:1.16                                              "nginx -g 'daemon of…"   14 minutes ago      Up About a minute   0.0.0.0:9000->80/tcp                sentry_onpremise_nginx_1
f661e5b33014        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   14 minutes ago      Up About a minute   9000/tcp                            sentry_onpremise_worker_1
1e6fe70488c1        sentry-cleanup-onpremise-local                          "/entrypoint.sh '0 0…"   14 minutes ago      Up About a minute   9000/tcp                            sentry_onpremise_sentry-cleanup_1
6590bdae7ec0        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   14 minutes ago      Up About a minute   9000/tcp                            sentry_onpremise_web_1
f6b962a8834b        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   14 minutes ago      Up About a minute   9000/tcp                            sentry_onpremise_cron_1
131b65a83587        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   14 minutes ago      Up About a minute   9000/tcp                            sentry_onpremise_ingest-consumer_1
d7e918e5da9d        sentry-onpremise-local                                  "/bin/sh -c 'exec /d…"   14 minutes ago      Up About a minute   9000/tcp                            sentry_onpremise_post-process-forwarder_1
91e8f1082b09        getsentry/snuba:latest                                  "./docker_entrypoint…"   14 minutes ago      Up About a minute   1218/tcp                            sentry_onpremise_snuba-outcomes-consumer_1
4ce8ab3910b9        getsentry/snuba:latest                                  "./docker_entrypoint…"   14 minutes ago      Up About a minute   1218/tcp                            sentry_onpremise_snuba-replacer_1
c8e28840d751        getsentry/relay:latest                                  "/bin/bash /docker-e"   14 minutes ago      Up About a minute   3000/tcp                            sentry_onpremise_relay_1
899f28b30b69        getsentry/snuba:latest                                  "./docker_entrypoint…"   14 minutes ago      Up About a minute   1218/tcp                            sentry_onpremise_snuba-api_1
64529430d1bd        snuba-cleanup-onpremise-local                           "/entrypoint.sh '*/5…"   14 minutes ago      Up About a minute   1218/tcp                            sentry_onpremise_snuba-cleanup_1
8f429689c64f        getsentry/snuba:latest                                  "./docker_entrypoint…"   14 minutes ago      Up About a minute   1218/tcp                            sentry_onpremise_snuba-consumer_1
fc108045672d        confluentinc/cp-kafka:5.5.0                             "/etc/confluent/dock…"   14 minutes ago      Up 58 seconds       9092/tcp                            sentry_onpremise_kafka_1
2fc5f562fe8e        redis:5.0-alpine                                        "docker-entrypoint.s…"   15 minutes ago      Up About a minute   6379/tcp                            sentry_onpremise_redis_1
3376e6bb3601        yandex/clickhouse-server:19.17                          "/entrypoint.sh"         15 minutes ago      Up About a minute   8123/tcp, 9000/tcp, 9009/tcp        sentry_onpremise_clickhouse_1
eed5f91e4fbf        postgres:9.6                                            "docker-entrypoint.s…"   15 minutes ago      Up About a minute   5432/tcp                            sentry_onpremise_postgres_1
726ec4230e82        memcached:1.5-alpine                                    "docker-entrypoint.s…"   15 minutes ago      Up About a minute   11211/tcp                           sentry_onpremise_memcached_1
6d48eb09c78a        confluentinc/cp-zookeeper:5.5.0                         "/etc/confluent/dock…"   15 minutes ago      Up About a minute   2181/tcp, 2888/tcp, 3888/tcp        sentry_onpremise_zookeeper_1
b4335fb60ddc        symbolicator-cleanup-onpremise-local                    "/entrypoint.sh '55 …"   15 minutes ago      Up About a minute   3021/tcp                            sentry_onpremise_symbolicator-cleanup_1
ef8e1f190ebf        tianon/exim4                                            "docker-entrypoint.s…"   15 minutes ago      Up About a minute   25/tcp                              sentry_onpremise_smtp_1
841650c27d71        getsentry/symbolicator:latest                           "/bin/bash /docker-e"   15 minutes ago      Up About a minute   3021/tcp                            sentry_onpremise_symbolicator_1

打开 http://:9000/auth/login/ 时页面会提示 502 Bad Gateway nginx 通过查看日志发现,没有建数据表,因此进入web容器,运行 sentry upgrade 初始化数据库表结构,初始化完成后,会创建管理员账号和密码

$ docker exec -it sentry_onpremise_web_1 /bin/bash
root@6590bdae7ec0:/# sentry --version
sentry, version 10.1.0.dev0 (b7df514f7477)
root@6590bdae7ec0:/# sentry upgrade
06:16:52 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:16:56 [INFO] sentry.plugins.github: apps-not-configured
Operations to perform:
  Apply all migrations: admin, auth, contenttypes, jira_ac, nodestore, sentry, sessions, sites, social_auth
Running migrations:
  Applying sentry.0001_initial... OK
  Applying contenttypes.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0001_initial... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying jira_ac.0001_initial... OK
  Applying nodestore.0001_initial... OK
  Applying sentry.0002_912_to_recent... OK
  Applying sentry.0003_auto_20191022_0122... OK
  Applying sentry.0004_bitfieldtestmodel_blankjsonfieldtestmodel_callabledefaultmodel_jsonfieldtestmodel_jsonfieldwithdefau... OK
  Applying sentry.0005_fix_content_types... OK
  Applying sentry.0006_sentryapp_date_published... OK
  Applying sentry.0007_auto_20191029_0131... OK
  Applying sentry.0008_auto_20191030_0016... OK
  Applying sentry.0009_auto_20191101_1608... OK
  Applying sentry.0010_auto_20191104_1641... OK
  Applying sentry.0011_remove_pagerdutyservice_service_id_from_state... OK
  Applying sentry.0012_remove_pagerdutyservice_service_id... OK
  Applying sentry.0013_auto_20191111_1829... OK
  Applying sentry.0014_delete_sentryappwebhookerror... OK
  Applying sentry.0015_delete_sentryappwebhookerror_db... OK
  Applying sentry.0016_delete_alert_rule_deprecated_fields... OK
  Applying sentry.0017_incident_aggregation... OK
  Applying sentry.0018_discoversavedquery_version... OK
  Applying sentry.0019_auto_20191114_2040... OK
  Applying sentry.0020_auto_20191125_1420... OK
  Applying sentry.0021_auto_20191203_1803... OK
  Applying sentry.0021_auto_20191202_1716... OK
  Applying sentry.0022_merge... OK
  Applying sentry.0023_hide_environment_none_20191126... OK
  Applying sentry.0024_auto_20191230_2052...Nothing to do, skipping migration.

 OK
  Applying sentry.0025_organizationaccessrequest_requester... OK
  Applying sentry.0026_delete_event... OK
  Applying sentry.0027_exporteddata... OK
  Applying sentry.0028_user_reports... OK
  Applying sentry.0029_discover_query_upgrade... OK
  Applying sentry.0030_auto_20200201_0039... OK
  Applying sentry.0031_delete_alert_rules_and_incidents... OK
  Applying sentry.0032_delete_alert_email... OK
  Applying sentry.0033_auto_20200210_2137... OK
  Applying sentry.0034_auto_20200210_2311... OK
  Applying sentry.0035_auto_20200127_1711... OK
  Applying sentry.0036_auto_20200213_0106... OK
  Applying sentry.0037_auto_20200213_0140... OK
  Applying sentry.0038_auto_20200213_1904... OK
  Applying sentry.0039_delete_incidentsuspectcommit... OK
  Applying sentry.0040_remove_incidentsuspectcommittable... OK
  Applying sentry.0041_incidenttrigger_date_modified... OK
  Applying sentry.0042_auto_20200214_1607... OK
  Applying sentry.0043_auto_20200218_1903... OK
  Applying sentry.0044_auto_20200219_0018... OK
  Applying sentry.0045_remove_incidentactivity_event_stats_snapshot... OK
  Applying sentry.0046_auto_20200221_1735... OK
  Applying sentry.0047_auto_20200224_2319... OK
  Applying sentry.0048_auto_20200302_1825... OK
  Applying sentry.0049_auto_20200304_0254... OK
  Applying sentry.0050_auto_20200306_2346... OK
  Applying sentry.0051_fix_auditlog_pickled_data... OK
  Applying sentry.0052_organizationonboardingtask_completion_seen... OK
  Applying sentry.0053_migrate_alert_task_onboarding... OK
  Applying sentry.0054_create_key_transaction... OK
  Applying sentry.0055_query_subscription_status... OK
  Applying sentry.0056_remove_old_functions... OK
  Applying sentry.0057_remove_unused_project_flag... OK
  Applying sentry.0058_project_issue_alerts_targeting... OK
  Applying sentry.0059_add_new_sentry_app_features... OK
  Applying sentry.0060_add_file_eventattachment_index... OK
  Applying sentry.0061_alertrule_partial_index... OK
  Applying sentry.0062_key_transactions_unique_with_owner... OK
  Applying sentry.0063_drop_alertrule_constraint... OK
  Applying sentry.0064_project_has_transactions... OK
  Applying sentry.0065_add_incident_status_method... OK
  Applying sentry.0066_alertrule_manager... OK
  Applying sentry.0067_migrate_rules_alert_targeting... OK
  Applying sentry.0068_project_default_flags... OK
  Applying sentry.0069_remove_tracked_superusers... OK
  Applying sentry.0070_incident_snapshot_support... OK
  Applying sentry.0071_add_default_fields_model_subclass... OK
  Applying sentry.0072_alert_rules_query_changes... OK
  Applying sentry.0073_migrate_alert_query_model... OK
  Applying sentry.0074_add_metric_alert_feature... OK
  Applying sentry.0075_metric_alerts_fix_releases... OK
  Applying sentry.0076_alert_rules_disable_constraints... OK
  Applying sentry.0077_alert_query_col_drop_state... OK
  Applying sentry.0078_incident_field_updates... OK
  Applying sentry.0079_incidents_remove_query_field_state... OK
  Applying sentry.0080_alert_rules_drop_unused_tables_cols... OK
  Applying sentry.0081_add_integraiton_upgrade_audit_log... OK
  Applying sentry.0082_alert_rules_threshold_float... OK
  Applying sessions.0001_initial... OK
  Applying sites.0001_initial... OK
  Applying sites.0002_alter_domain_unique... OK
  Applying social_auth.0001_initial... OK
06:18:30 [WARNING] sentry: Cannot initiate onboarding for organization (1) due to missing owners
Created internal Sentry project (slug=internal, id=1)

Would you like to create a user account now? [Y/n]: y
Email: denyan7373@163.com
Password:
Repeat for confirmation:
User created: denyan7373@163.com
Added to organization: sentry
Creating missing DSNs
Correcting Group.num_comments counter
root@6590bdae7ec0:/#exit

打开 http://:9000/organizations/sentry/projects/,报错信息为 Unable to fetch all project stats
打开 http://:9000/organizations/sentry/discover/queries/,报错信息为 Internal Error

所以我再次查看了web容器的日志,发现 DB::Exception: Table default.sentry_local doesn't exist..,似乎是有一个数据表不存在

$ docker logs sentry_onpremise_web_1
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
!! Configuration error: IOError: [Errno 13] Unable to load configuration file (Permission denied): u'/etc/sentry/sentry.conf.py'
06:09:42 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:09:47 [INFO] sentry.plugins.github: apps-not-configured
*** Starting uWSGI 2.0.18 (64bit) on [Mon Jun  1 06:09:47 2020] ***
compiled with version: 8.3.0 on 24 May 2020 22:34:17
os: Linux-4.15.0-88-generic #88~16.04.1-Ubuntu SMP Wed Feb 12 04:19:15 UTC 2020
nodename: 6590bdae7ec0
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to TCP address 0.0.0.0:9000 fd 3
Python version: 2.7.16 (default, Oct 17 2019, 07:39:30)  [GCC 8.3.0]
Set PythonHome to /usr/local
Python main interpreter initialized at 0x55a62864c980
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
setting request body buffering size to 65536 bytes
mapped 1087040 bytes (1061 KB) for 6 cores
*** Operational MODE: preforking+threaded ***
spawned uWSGI master process (pid: 17)
spawned uWSGI worker 1 (pid: 21, cores: 2)
spawned uWSGI worker 2 (pid: 22, cores: 2)
spawned uWSGI worker 3 (pid: 23, cores: 2)
06:09:48 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:09:49 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:09:49 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:09:53 [INFO] sentry.plugins.github: apps-not-configured
06:09:53 [INFO] sentry.plugins.github: apps-not-configured
06:09:53 [INFO] sentry.plugins.github: apps-not-configured
WSGI app 0 (mountpoint='') ready in 6 seconds on interpreter 0x55a62864c980 pid: 22 (default app)
WSGI app 0 (mountpoint='') ready in 6 seconds on interpreter 0x55a62864c980 pid: 21 (default app)
WSGI app 0 (mountpoint='') ready in 7 seconds on interpreter 0x55a62864c980 pid: 23 (default app)
SIGINT/SIGQUIT received...killing workers...
worker 1 buried after 1 seconds
worker 2 buried after 1 seconds
worker 3 buried after 1 seconds
goodbye to uWSGI.
06:10:47 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:11:02 [INFO] sentry.plugins.github: apps-not-configured
*** Starting uWSGI 2.0.18 (64bit) on [Mon Jun  1 06:11:03 2020] ***
compiled with version: 8.3.0 on 24 May 2020 22:34:17
os: Linux-4.15.0-88-generic #88~16.04.1-Ubuntu SMP Wed Feb 12 04:19:15 UTC 2020
nodename: 6590bdae7ec0
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: enabled
uwsgi socket 0 bound to TCP address 0.0.0.0:9000 fd 3
Python version: 2.7.16 (default, Oct 17 2019, 07:39:30)  [GCC 8.3.0]
Set PythonHome to /usr/local
Python main interpreter initialized at 0x55b8b4b6a980
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
setting request body buffering size to 65536 bytes
mapped 1087040 bytes (1061 KB) for 6 cores
*** Operational MODE: preforking+threaded ***
spawned uWSGI master process (pid: 17)
spawned uWSGI worker 1 (pid: 21, cores: 2)
spawned uWSGI worker 2 (pid: 22, cores: 2)
spawned uWSGI worker 3 (pid: 23, cores: 2)
06:11:05 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:11:06 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:11:06 [WARNING] sentry.utils.geo: settings.GEOIP_PATH_MMDB not configured.
06:11:11 [INFO] sentry.plugins.github: apps-not-configured
WSGI app 0 (mountpoint='') ready in 9 seconds on interpreter 0x55b8b4b6a980 pid: 23 (default app)
06:11:12 [INFO] sentry.plugins.github: apps-not-configured
06:11:12 [INFO] sentry.plugins.github: apps-not-configured
WSGI app 0 (mountpoint='') ready in 9 seconds on interpreter 0x55b8b4b6a980 pid: 22 (default app)
WSGI app 0 (mountpoint='') ready in 9 seconds on interpreter 0x55b8b4b6a980 pid: 21 (default app)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 227, in dispatch
    return self.handle(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py", line 185, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 223, in handle
    return super(AuthLoginView, self).handle(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 240, in handle
    return super(BaseView, self).dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 241, in get
    org = Organization.get_default()
  File "/usr/local/lib/python2.7/site-packages/sentry/models/organization.py", line 156, in get_default
    return cls.objects.filter(status=OrganizationStatus.ACTIVE)[0]
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 289, in __getitem__
    return list(qs)[0]
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 250, in __iter__
    self._fetch_all()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
ProgrammingError: UndefinedTable('relation "sentry_organization" does not exist\nLINE 1: ...default_role", "sentry_organization"."flags" FROM "sentry_or...\n                                                             ^\n',)
SQL: SELECT "sentry_organization"."id", "sentry_organization"."name", "sentry_organization"."slug", "sentry_organization"."status", "sentry_organization"."date_added", "sentry_organization"."default_role", "sentry_organization"."flags" FROM "sentry_organization" WHERE "sentry_organization"."status" = %s LIMIT 1
06:13:38 [ERROR] django.request: Internal Server Error: /auth/login/ (status_code=500 request=<WSGIRequest: GET u'/auth/login/'>)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/excepthook.py", line 59, in sentry_sdk_excepthook
    hub.capture_event(event, hint=hint)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/hub.py", line 323, in capture_event
    rv = client.capture_event(event, hint, scope)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/client.py", line 323, in capture_event
    event_opt = self._prepare_event(event, hint, scope)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/client.py", line 157, in _prepare_event
    event_ = scope.apply_to_event(event, hint)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/scope.py", line 57, in wrapper
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/scope.py", line 328, in apply_to_event
    return _drop(event, event_processor, "event processor")
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/scope.py", line 283, in _drop
    logger.info("%s (%s) dropped event (%s)", ty, cause, event)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1174, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1293, in _log
    self.handle(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1303, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/logging.py", line 83, in sentry_patched_callhandlers
    return old_callhandlers(self, record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 1343, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python2.7/logging/__init__.py", line 766, in handle
    self.emit(record)
  File "/usr/local/lib/python2.7/site-packages/sentry/logging/handlers.py", line 98, in emit
    logger.log(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/../structlog/stdlib.py", line 102, in log
    return self._proxy_to_logger(_LEVEL_TO_NAME[level], event, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/sentry/../structlog/stdlib.py", line 119, in _proxy_to_logger
    **event_kw)
  File "/usr/local/lib/python2.7/site-packages/sentry/../structlog/_base.py", line 176, in _proxy_to_logger
    args, kw = self._process_event(method_name, event, event_kw)
  File "/usr/local/lib/python2.7/site-packages/sentry/../structlog/_base.py", line 136, in _process_event
    event_dict = proc(self._logger, method_name, event_dict)
  File "/usr/local/lib/python2.7/site-packages/sentry/../structlog/stdlib.py", line 275, in __call__
    event_dict['event'] = event_dict['event'] % args
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 226, in __repr__
    data = list(self[:REPR_OUTPUT_SIZE + 1])
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 250, in __iter__
    self._fetch_all()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
ProgrammingError: UndefinedTable('relation "sentry_projectkey" does not exist\nLINE 1: ...te_limit_window", "sentry_projectkey"."data" FROM "sentry_pr...\n                                                             ^\n',)
SQL: SELECT "sentry_projectkey"."id", "sentry_projectkey"."project_id", "sentry_projectkey"."label", "sentry_projectkey"."public_key", "sentry_projectkey"."secret_key", "sentry_projectkey"."roles", "sentry_projectkey"."status", "sentry_projectkey"."date_added", "sentry_projectkey"."rate_limit_count", "sentry_projectkey"."rate_limit_window", "sentry_projectkey"."data" FROM "sentry_projectkey" WHERE ("sentry_projectkey"."project_id" = %s AND "sentry_projectkey"."roles" = (("sentry_projectkey"."roles" | %s))) LIMIT 1
06:13:38 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/wsgi.py", line 36, in __call__
    response = super(FileWrapperWSGIHandler, self).__call__(environ, start_response)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/django/__init__.py", line 118, in sentry_patched_wsgi_handler
    return SentryWsgiMiddleware(bound_old_app)(environ, start_response)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/wsgi.py", line 127, in __call__
    reraise(*_capture_exception(hub))
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/wsgi.py", line 124, in __call__
    partial(_sentry_start_response, start_response, span),
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 157, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python2.7/site-packages/sentry_sdk/integrations/django/__init__.py", line 152, in sentry_patched_get_response
    return old_get_response(self, request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 124, in get_response
    response = self._middleware_chain(request)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 43, in inner
    response = response_for_exception(request, exc)
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 93, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 143, in handle_uncaught_exception
    return callback(request, **param_dict)
  File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/error_500.py", line 38, in dispatch
    return render_to_response("sentry/500.html", status=500, context=context, request=request)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/helpers.py", line 97, in render_to_response
    response = HttpResponse(render_to_string(template, context, request))
  File "/usr/local/lib/python2.7/site-packages/sentry/web/helpers.py", line 93, in render_to_string
    return loader.render_to_string(template, context=context, request=request)
  File "/usr/local/lib/python2.7/site-packages/django/template/loader.py", line 68, in render_to_string
    return template.render(context, request)
  File "/usr/local/lib/python2.7/site-packages/django/template/backends/django.py", line 66, in render
    return self.template.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 207, in render
    return self._render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 990, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 177, in render
    return compiled_parent._render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 990, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 177, in render
    return compiled_parent._render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 990, in render
    bit = node.render_annotated(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py", line 957, in render_annotated
    return self.render(context)
  File "/usr/local/lib/python2.7/site-packages/django/template/library.py", line 203, in render
    output = self.func(*resolved_args, **resolved_kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/templatetags/sentry_react.py", line 13, in get_react_config
    context = get_client_config(context.get("request", None))
  File "/usr/local/lib/python2.7/site-packages/sentry/web/client_config.py", line 144, in get_client_config
    public_dsn = _get_public_dsn()
  File "/usr/local/lib/python2.7/site-packages/sentry/web/client_config.py", line 90, in _get_public_dsn
    key = _get_project_key(project_id)
  File "/usr/local/lib/python2.7/site-packages/sentry/web/client_config.py", line 76, in _get_project_key
    )[0]
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 289, in __getitem__
    return list(qs)[0]
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 250, in __iter__
    self._fetch_all()
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
django.db.utils.ProgrammingError: UndefinedTable('relation "sentry_projectkey" does not exist\nLINE 1: ...te_limit_window", "sentry_projectkey"."data" FROM "sentry_pr...\n                                                             ^\n',)
SQL: SELECT "sentry_projectkey"."id", "sentry_projectkey"."project_id", "sentry_projectkey"."label", "sentry_projectkey"."public_key", "sentry_projectkey"."secret_key", "sentry_projectkey"."roles", "sentry_projectkey"."status", "sentry_projectkey"."date_added", "sentry_projectkey"."rate_limit_count", "sentry_projectkey"."rate_limit_window", "sentry_projectkey"."data" FROM "sentry_projectkey" WHERE ("sentry_projectkey"."project_id" = %s AND "sentry_projectkey"."roles" = (("sentry_projectkey"."roles" | %s))) LIMIT 1
06:21:49 [INFO] sentry.superuser: superuser.logged-in (user_id=1 ip_address=u'10.137.170.163')
06:21:49 [INFO] sentry.auth: user.auth.success (username=u'denyan7373@163.com' organization_id=1L ip_address=u'10.137.170.163')
06:21:49 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/auth/login/' method=u'GET' ip_address=u'10.137.170.163')
06:21:49 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/organizations/sentry/issues/' method=u'GET' ip_address=u'10.137.170.163')
06:21:50 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/internal/health/' method=u'GET' ip_address=u'10.137.170.163')
06:21:50 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/?member=1' method=u'GET' ip_address=u'10.137.170.163')
06:21:50 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/assistant/?v2' method=u'GET' ip_address=u'10.137.170.163')
06:21:50 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/internal/options/?query=is:required' method=u'GET' ip_address=u'10.137.170.163')
06:21:50 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/internal/options/?query=is:required' method=u'GET' ip_address=u'10.137.170.163')
06:24:12 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/internal/options/?query=is:required' method=u'PUT' ip_address=u'10.137.170.163')
06:24:12 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/?detailed=0' method=u'GET' ip_address=u'10.137.170.163')
06:24:12 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/teams/' method=u'GET' ip_address=u'10.137.170.163')
06:24:12 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/projects/?all_projects=1' method=u'GET' ip_address=u'10.137.170.163')
/usr/local/lib/python2.7/site-packages/sentry/models/project.py:179: DeprecationWarning: Project.callsign is deprecated. Use Group.get_short_id() instead.
  "Project.callsign is deprecated. Use Group.get_short_id() instead.", DeprecationWarning
06:24:12 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/projects/?per_page=50' method=u'GET' ip_address=u'10.137.170.163')
06:24:12 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/broadcasts/' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/searches/?use_org_level=1' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/users/' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/tags/?statsPeriod=14d&use_cache=1' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/issues/?limit=25&query=is%3Aunresolved&shortIdLookup=1&statsPeriod=14d' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/processingissues/' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/recent-searches/?query=&type=0&limit=3' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/projects/?per_page=1' method=u'GET' ip_address=u'10.137.170.163')
06:24:13 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/sent-first-event/?is_member=true' method=u'GET' ip_address=u'10.137.170.163')
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 90, in handle_exception
    response = super(Endpoint, self).handle_exception(exc)
  File "/usr/local/lib/python2.7/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 207, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/endpoints/organization_tags.py", line 22, in get
    use_cache=request.GET.get("use_cache", "0") == "1",
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/services.py", line 105, in <lambda>
    context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
  File "/usr/local/lib/python2.7/site-packages/sentry/tagstore/snuba/backend.py", line 342, in get_tag_keys_for_projects
    **optimize_kwargs
  File "/usr/local/lib/python2.7/site-packages/sentry/tagstore/snuba/backend.py", line 258, in __get_tag_keys_for_projects
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/snuba.py", line 656, in query
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/snuba.py", line 549, in raw_query
    return bulk_raw_query([snuba_params], referrer=referrer)[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/snuba.py", line 613, in bulk_raw_query
    error["message"]
QueryExecutionError: [60] DB::Exception: Table default.sentry_local doesn't exist.. Stack trace:

0. 0x564001aa6e90 StackTrace::StackTrace() /usr/bin/clickhouse
1. 0x564001aa6c65 DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) /usr/bin/clickhouse
2. 0x564004e06241 DB::Context::getTableImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Exception*) const /usr/bin/clickhouse
3. 0x564004e06431 DB::Context::getTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/bin/clickhouse
4. 0x564004e76581 DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
5. 0x564004e766c7 DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
6. 0x564004e9a9db DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
7. 0x564004e52988 DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum) /usr/bin/clickhouse
8. 0x564004f9cc1a ? /usr/bin/clickhouse
9. 0x564004f9e09e DB::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, bool) /usr/bin/clickhouse
10. 0x564001b30514 DB::TCPHandler::runImpl() /usr/bin/clickhouse
11. 0x564001b30f5b DB::TCPHandler::run() /usr/bin/clickhouse
12. 0x564005a54df0 Poco::Net::TCPServerConnection::start() /usr/bin/clickhouse
13. 0x564005a5550d Poco::Net::TCPServerDispatcher::run() /usr/bin/clickhouse
14. 0x56400712b6b1 Poco::PooledThread::run() /usr/bin/clickhouse
15. 0x56400712945c Poco::ThreadImpl::runnableEntry(void*) /usr/bin/clickhouse
16. 0x56400789f5c0 ? /usr/bin/clickhouse
17. 0x7fdc747ec6db start_thread /lib/x86_64-linux-gnu/libpthread-2.27.so
18. 0x7fdc7410988f __clone /lib/x86_64-linux-gnu/libc-2.27.so

06:24:15 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/assistant/' method=u'PUT' ip_address=u'10.137.170.163')
06:24:16 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/user-teams/' method=u'GET' ip_address=u'10.137.170.163')
06:24:16 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/teams/sentry/sentry/members/' method=u'GET' ip_address=u'10.137.170.163')
06:24:16 [INFO] sentry.superuser: superuser.request (user_id=1 url=u'http://10.7.226.102/api/0/organizations/sentry/projects/?statsPeriod=24h&query=id%3A1' method=u'GET' ip_address=u'10.137.170.163')
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 90, in handle_exception
    response = super(Endpoint, self).handle_exception(exc)
  File "/usr/local/lib/python2.7/site-packages/rest_framework/views.py", line 449, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 207, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/endpoints/organization_projects.py", line 125, in get
    paginator_cls=OffsetPaginator,
  File "/usr/local/lib/python2.7/site-packages/sentry/api/base.py", line 285, in paginate
    results = on_results(cursor_result.results)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/endpoints/organization_projects.py", line 118, in serialize_on_result
    return serialize(result, request.user, serializer)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/base.py", line 41, in serialize
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/models/project.py", line 293, in get_attrs
    attrs = super(ProjectSummarySerializer, self).get_attrs(item_list, user)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/models/project.py", line 257, in get_attrs
    attrs = super(ProjectWithTeamSerializer, self).get_attrs(item_list, user)
  File "/usr/local/lib/python2.7/site-packages/sentry/api/serializers/models/project.py", line 143, in get_attrs
    environment_ids=self.environment_id and [self.environment_id],
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/services.py", line 105, in <lambda>
    context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
  File "/usr/local/lib/python2.7/site-packages/sentry/tsdb/redissnuba.py", line 89, in method
    return getattr(self.backends[backend], key)(*a, **kw)
  File "/usr/local/lib/python2.7/site-packages/sentry/tsdb/snuba.py", line 356, in get_range
    group_on_time=True,
  File "/usr/local/lib/python2.7/site-packages/sentry/tsdb/snuba.py", line 284, in get_data
    is_grouprelease=(model == TSDBModel.frequent_releases_by_group),
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/snuba.py", line 656, in query
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/snuba.py", line 549, in raw_query
    return bulk_raw_query([snuba_params], referrer=referrer)[0]
  File "/usr/local/lib/python2.7/site-packages/sentry/utils/snuba.py", line 613, in bulk_raw_query
    error["message"]
QueryExecutionError: [60] DB::Exception: Table default.sentry_local doesn't exist.. Stack trace:

0. 0x564001aa6e90 StackTrace::StackTrace() /usr/bin/clickhouse
1. 0x564001aa6c65 DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) /usr/bin/clickhouse
2. 0x564004e06241 DB::Context::getTableImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Exception*) const /usr/bin/clickhouse
3. 0x564004e06431 DB::Context::getTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const /usr/bin/clickhouse
4. 0x564004e76581 DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
5. 0x564004e766c7 DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
6. 0x564004e9a9db DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) /usr/bin/clickhouse
7. 0x564004e52988 DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum) /usr/bin/clickhouse
8. 0x564004f9cc1a ? /usr/bin/clickhouse
9. 0x564004f9e09e DB::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, bool) /usr/bin/clickhouse
10. 0x564001b30514 DB::TCPHandler::runImpl() /usr/bin/clickhouse
11. 0x564001b30f5b DB::TCPHandler::run() /usr/bin/clickhouse
12. 0x564005a54df0 Poco::Net::TCPServerConnection::start() /usr/bin/clickhouse
13. 0x564005a5550d Poco::Net::TCPServerDispatcher::run() /usr/bin/clickhouse
14. 0x56400712b6b1 Poco::PooledThread::run() /usr/bin/clickhouse
15. 0x56400712945c Poco::ThreadImpl::runnableEntry(void*) /usr/bin/clickhouse
16. 0x56400789f5c0 ? /usr/bin/clickhouse
17. 0x7fdc747ec6db start_thread /lib/x86_64-linux-gnu/libpthread-2.27.so
18. 0x7fdc7410988f __clone /lib/x86_64-linux-gnu/libc-2.27.so

在Sentry官方论坛无意中发现一个帖子 forum.sentry.io/t/sentry-10…, 在执行 docker-compose run --rm snuba-api migrate 后, 所有问题都解决了。

$ docker-compose run --rm snuba-api migrate
[root@localhost onpremise]# docker-compose run --rm snuba-api migrate
Starting sentry_onpremise_clickhouse_1 ... one
Starting sentry_onpremise_redis_1      ... done
Starting sentry_onpremise_clickhouse_1 ... done
Starting sentry_onpremise_kafka_1      ... done
+ '[' m = - ']'
+ snuba migrate --help
+ set -- snuba migrate
+ set gosu snuba snuba migrate
+ exec gosu snuba snuba migrate
2020-06-02 05:45:33,497 Creating tables for storage events
2020-06-02 05:45:33,975 Migrating storage events
2020-06-02 05:45:34,051 Creating tables for storage errors
2020-06-02 05:45:34,124 Migrating storage errors
2020-06-02 05:45:34,175 Creating tables for storage groupedmessages
2020-06-02 05:45:34,179 Migrating storage groupedmessages
2020-06-02 05:45:34,192 Creating tables for storage groupassignees
2020-06-02 05:45:34,195 Migrating storage groupassignees
2020-06-02 05:45:34,208 Creating tables for storage outcomes_raw
2020-06-02 05:45:34,212 Migrating storage outcomes_raw
2020-06-02 05:45:34,224 Creating tables for storage outcomes_hourly
2020-06-02 05:45:34,281 Migrating storage outcomes_hourly
2020-06-02 05:45:34,287 Creating tables for storage sessions_raw
2020-06-02 05:45:34,291 Migrating storage sessions_raw
2020-06-02 05:45:34,305 Creating tables for storage sessions_hourly
2020-06-02 05:45:34,396 Migrating storage sessions_hourly
2020-06-02 05:45:34,414 Creating tables for storage transactions
2020-06-02 05:45:34,422 Migrating storage transactions