sentry 9.1.1docker版onepremise过程记录

sentry安装:
https://github.com/getsentry/onpremise
正确使用此文档安装步骤,安装版本9.1.1-onbuild,这个需要自改Dockerfile。

 

备注:构建数据库命令不会一次执行全部完成,需要多次运行:

docker-compose run --rm web upgrade

 

故障定位问题:
使用:docker logs --tail 30 onpremise_web_1 -f查看日志发现如下:

Traceback (most recent call last): 
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, 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 69, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 225, in dispatch
return self.handle(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/db/transaction.py", line 371, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 193, in handle
return super(AuthLoginView, self).handle(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 238, in handle
return super(BaseView, self).dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
return handler(request, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 211, in get
org = Organization.get_default()
File "/usr/local/lib/python2.7/site-packages/sentry/models/organization.py", line 164, in get_default
)[0]
File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py", line 132, in __getitem__
return list(qs)[0]
IndexError: list index out of range

解决方案:
访问地址:https://docs.sentry.io/server/faq/
章节示例:How do I script the Sentry installation to bootstrap things like projects and users?


步骤:
1.复制以上代码到文件fixed.py;
2.复制代码文件到容器内:docker cp ~/onpremise/fixed.py onpremise_web_1:/usr/src/sentry/fixed.py
3.进入容器内:docker exec -it onpremise_web_1 /bin/bash
4.执行修复脚本:python fixed.py
5.使用fixed.py里的账户登录:http://localhost:9000
6.完善初始化你的配置信息

posted @ 2019-05-27 03:54  kylinfish  阅读(874)  评论(0编辑  收藏  举报