The version of Sentry you're using
sentry 9.0.0
Whether you're using Docker or another installation method
pip install with systemd
Include a stacktrace or other logs when relevant
where i can get it?
https://docs.sentry.io/server/config/ - it doesn't contain any words about logs.
After fresh install on Ubuntu 18.04 via pip, i get this:
where i can find relevant inforamation about this error?
You should get a stacktrace at minimum that dumped either to the browser's console, or to the web server's logs.
@mattrobenolt, so am i getting right, that i have to run processes in foreground to retrieve logs?
ok. i got it
sentry web:
WSGI app 0 (mountpoint='') ready in 4 seconds on interpreter 0x55f29a84ec60 pid: 27001 (default app)
127.0.0.1 - - [27/Jun/2018:19:25:06 +0000] "GET / HTTP/1.1" 302 447 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
Traceback (most recent call last):
File "/www/sentry/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 "/www/sentry/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
return self.dispatch(request, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
return view_func(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 223, in dispatch
return self.handle(request, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/transaction.py", line 371, in inner
return func(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 157, in handle
return super(AuthLoginView, self).handle(request, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/web/frontend/base.py", line 236, in handle
return super(BaseView, self).dispatch(request, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
return handler(request, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/web/frontend/auth_login.py", line 175, in get
org = Organization.get_default()
File "/www/sentry/local/lib/python2.7/site-packages/sentry/models/organization.py", line 161, in get_default
)[0]
File "/www/sentry/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
19:25:08 [ERROR] django.request: Internal Server Error: /auth/login/ (status_code=500 request=<WSGIRequest: GET u'/auth/login/'>)
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/sentry/web/frontend/error_500.py", line 22, in get_embed_config
)[0]
File "/www/sentry/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
19:25:08 [ERROR] root: Unable to fetch ProjectKey for internal project
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/sentry/templatetags/sentry_react.py", line 67, in _get_public_dsn
)[0]
File "/www/sentry/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
19:25:08 [ERROR] root: Unable to fetch ProjectKey for internal project
It seems that you failed to run migrations or something during setup? Because none of the default organization/project stuff has been created.
what i've did:
sentry@server:~$ SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry upgrade
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Synced:
> django.contrib.admin
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.messages
> django.contrib.sessions
> django.contrib.sites
> django.contrib.staticfiles
> crispy_forms
> debug_toolbar
> raven.contrib.django.raven_compat
> rest_framework
> sentry.plugins.sentry_interface_types
> sentry.plugins.sentry_mail
> sentry.plugins.sentry_urls
> sentry.plugins.sentry_useragents
> sentry.plugins.sentry_webhooks
> sudo
> south
Not synced (use migrations):
- sentry
- sentry.nodestore
- sentry.search
- social_auth
- sentry.tagstore
(use ./manage.py migrate to migrate these)
Running migrations for sentry:
- Nothing to migrate.
- Loading initial data for sentry.
Installed 0 object(s) from 0 fixture(s)
Running migrations for nodestore:
- Nothing to migrate.
- Loading initial data for nodestore.
Installed 0 object(s) from 0 fixture(s)
Running migrations for search:
- Nothing to migrate.
- Loading initial data for search.
Installed 0 object(s) from 0 fixture(s)
Running migrations for social_auth:
- Nothing to migrate.
- Loading initial data for social_auth.
Installed 0 object(s) from 0 fixture(s)
Running migrations for tagstore:
- Nothing to migrate.
- Loading initial data for tagstore.
Installed 0 object(s) from 0 fixture(s)
Creating missing DSNs
Correcting Group.num_comments counter
that command i got here: https://docs.sentry.io/server/installation/python/#running-migrations
just tried to do that:
sentry@server:~$ SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry django migrate
Running migrations for sentry:
- Nothing to migrate.
- Loading initial data for sentry.
Installed 0 object(s) from 0 fixture(s)
Running migrations for nodestore:
- Nothing to migrate.
- Loading initial data for nodestore.
Installed 0 object(s) from 0 fixture(s)
Running migrations for search:
- Nothing to migrate.
- Loading initial data for search.
Installed 0 object(s) from 0 fixture(s)
Running migrations for social_auth:
- Nothing to migrate.
- Loading initial data for social_auth.
Installed 0 object(s) from 0 fixture(s)
Running migrations for tagstore:
- Nothing to migrate.
- Loading initial data for tagstore.
Installed 0 object(s) from 0 fixture(s)
If that's the end of your output, migrations definitely didn't run and I can't explain why. :/
What's in your south_migrationhistory table in the database?
last 6 rows:
440 | tagstore | 0003_auto__add_tagkey__add_unique_tagkey_project_id_environment_id_key__add | 2018-06-27 13:06:53.819691+00
441 | tagstore | 0004_auto__del_tagkey__del_unique_tagkey_project_id_environment_id_key__del | 2018-06-27 13:06:53.89067+00
442 | tagstore | 0005_auto__add_tagvalue__add_unique_tagvalue_project_id__key_value__add_ind | 2018-06-27 13:06:53.993774+00
443 | tagstore | 0006_auto__del_unique_eventtag_event_id_key_value__add_unique_eventtag_proj | 2018-06-27 13:06:54.034081+00
444 | tagstore | 0007_auto__chg_field_tagkey_environment_id__chg_field_tagkey_project_id__ch | 2018-06-27 13:06:54.374277+00
445 | tagstore | 0008_auto__chg_field_tagkey_environment_id | 2018-06-27 13:06:54.416227+00
(445 rows)
Hmm, interesting. So they did run.
Then I can't explain how the defaults didn't get created.
Do you have any rows whatsoever in sentry_project ?
These get created off a hook after everything is synced for the first time.
You should have a Sentry row in sentry_organization as well as an internal sentry_project row.
its empty :(
sentry=# select * from sentry_project;
id | name | public | date_added | status | slug | organization_id | first_event | forced_color | flags | platform
----+------+--------+------------+--------+------+-----------------+-------------+--------------+-------+----------
(0 rows)
sentry=# select * from sentry_organization ;
id | name | status | date_added | slug | flags | default_role
----+------+--------+------------+------+-------+--------------
(0 rows)
is it possible to manually put there something to hotfix it?
Well, we can try to do something here. :)
Run sentry shell, which will give you a python REPL within Sentry env.
Then do:
from sentry.models import Project
from sentry.receivers.core import create_default_projects
create_default_projects([Project])
This should get those defaults created. But it seems you're also (or I'm assuming) lacking a superuser? Not sure if you were prompted for that.
here it is:
sentry@server:~$ SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry shell
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from sentry.models import Project
>>> from sentry.receivers.core import create_default_projects
>>> create_default_projects([Project])
Created internal Sentry project (slug=internal, id=1)
and it worked, thanks:
sentry=# select * from sentry_project;
id | name | public | date_added | status | slug | organization_id | first_event | forced_color | flags | platform
----+----------+--------+-------------------------------+--------+----------+-----------------+-------------+--------------+-------+----------
1 | Internal | f | 2018-06-27 19:50:35.441199+00 | 0 | internal | 1 | | | 0 |
(1 row)
sentry=# select * from sentry_organization;
id | name | status | date_added | slug | flags | default_role
----+--------+--------+-------------------------------+--------+-------+--------------
1 | Sentry | 0 | 2018-06-27 19:50:35.418925+00 | sentry | 1 | member
(1 row)
and now with sentry createuser
sentry@server:~$ SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry createuser
Email: [email protected]
Password:
Repeat for confirmation:
Should this user be a superuser? [y/N]: y
Traceback (most recent call last):
File "/www/sentry/bin/sentry", line 11, in <module>
sys.exit(main())
File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 162, in main
cli(prog_name=get_prog(), obj={}, max_content_width=100)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
return ctx.invoke(f, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/commands/createuser.py", line 87, in createuser
user.save()
File "/www/sentry/local/lib/python2.7/site-packages/sentry/models/user.py", line 123, in save
return super(User, self).save(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
force_update=force_update, update_fields=update_fields)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/base.py", line 573, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/base.py", line 654, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/base.py", line 687, in _do_insert
using=using, raw=raw)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/manager.py", line 232, in _insert
return insert_query(self.model, objs, fields, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 1514, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 903, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: IntegrityError('duplicate key value violates unique constraint "auth_user_username_key"\nDETAIL: Key (username)=([email protected]) already exists.\n',)
SQL: INSERT INTO "auth_user" ("password", "last_login", "username", "first_name", "email", "is_staff", "is_active", "is_superuser", "is_managed", "is_password_expired", "last_password_change", "flags", "session_nonce", "date_joined", "last_active") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "auth_user"."id"
Cool, so seems like you should be all good to go now?
btw the createuser just failed because apparently you already had that user. So things seem to be working.
yep, starting processes... got to the login screen!
THANKS A LOT!
nope. after night i tried to use it... and some problems persists.
i cant add new organization:
in logs i see this:
127.0.0.1 - - [28/Jun/2018:07:43:34 +0000] "GET /_static/1530171742/sentry/dist/sentry-pattern.png HTTP/1.1" 200 28417 "https://sentry.teamcore.us/_static/1530171742/sentry/dist/sentry.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [28/Jun/2018:07:43:34 +0000] "GET /sentry/_static/1530171742/sentry/images/icons/apple-touch-icon.png/ HTTP/1.1" 200 4350 "https://sentry.teamcore.us/organizations/new/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [28/Jun/2018:07:43:36 +0000] "POST /api/0/organizations/ HTTP/1.1" 401 482 "https://sentry.teamcore.us/organizations/new/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [28/Jun/2018:07:43:36 +0000] "GET /organizations/new/ HTTP/1.1" 200 4389 "https://sentry.teamcore.us/organizations/new/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [28/Jun/2018:07:43:37 +0000] "GET /api/0/organizations/?member=1 HTTP/1.1" 200 842 "https://sentry.teamcore.us/organizations/new/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [28/Jun/2018:07:43:37 +0000] "GET /api/0/internal/health/ HTTP/1.1" 200 207 "https://sentry.teamcore.us/organizations/new/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
127.0.0.1 - - [28/Jun/2018:07:43:37 +0000] "GET /sentry/_static/1530171742/sentry/images/icons/apple-touch-icon.png/ HTTP/1.1" 200 4389 "https://sentry.teamcore.us/organizations/new/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36"
in web i see this:

It's probably OOM issue, related to getsentry/docker-sentry#110 - I've been installing Sentry 9.0 few times today and running migrations was at some point consuming 100% of 2 CPUs and almost 100% 2GB RAM and it was killed. When run with docker-compose run --rm sentry upgrade it's killed silently (no info), but when running inside container there is Killed in output. Every time when I had to run upgrade several times to execute all migrations Sentry instance was bricked. I've managed to install it with --noinput and some htop / kill magic ;-) So crucial thing is that everything is done in one run at least to the point:
> sentry:0423_auto__add_index_grouphashtombstone_deleted_at
Created internal Sentry project (slug=internal, id=1)
Then it's working. I could rename organization and project, invite members, add new teams and projects. I can't add new organization - I get 401 without any data in response.
also.
now it starts and shuts down in 5 mins:
Jul 1 19:47:29 server systemd[1]: Started Sentry Beat Service.
Jul 1 19:47:29 server systemd[1]: Started Sentry Main Service.
Jul 1 19:47:29 server systemd[1]: Started Sentry Background Worker.
Jul 1 19:47:44 server sentry[30106]: Traceback (most recent call last):
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/bin/sentry", line 11, in <module>
Jul 1 19:47:44 server sentry[30106]: sys.exit(main())
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 162, in main
Jul 1 19:47:44 server sentry[30106]: cli(prog_name=get_prog(), obj={}, max_content_width=100)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
Jul 1 19:47:44 server sentry[30106]: return self.main(*args, **kwargs)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 697, in main
Jul 1 19:47:44 server sentry[30106]: rv = self.invoke(ctx)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jul 1 19:47:44 server sentry[30106]: return _process_result(sub_ctx.command.invoke(sub_ctx))
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jul 1 19:47:44 server sentry[30106]: return _process_result(sub_ctx.command.invoke(sub_ctx))
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
Jul 1 19:47:44 server sentry[30106]: return ctx.invoke(self.callback, **ctx.params)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jul 1 19:47:44 server sentry[30106]: return callback(*args, **kwargs)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jul 1 19:47:44 server sentry[30106]: return f(get_current_context(), *args, **kwargs)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 73, in inner
Jul 1 19:47:44 server sentry[30106]: return ctx.invoke(f, *args, **kwargs)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jul 1 19:47:44 server sentry[30106]: return callback(*args, **kwargs)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jul 1 19:47:44 server sentry[30106]: return f(get_current_context(), *args, **kwargs)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 35, in inner
Jul 1 19:47:44 server sentry[30106]: configure()
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 125, in configure
Jul 1 19:47:44 server sentry[30106]: configure(ctx, py, yaml, skip_service_validation)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/settings.py", line 152, in configure
Jul 1 19:47:44 server sentry[30104]: Traceback (most recent call last):
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/bin/sentry", line 11, in <module>
Jul 1 19:47:44 server sentry[30104]: sys.exit(main())
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 162, in main
Jul 1 19:47:44 server sentry[30104]: cli(prog_name=get_prog(), obj={}, max_content_width=100)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
Jul 1 19:47:44 server sentry[30104]: return self.main(*args, **kwargs)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 697, in main
Jul 1 19:47:44 server sentry[30104]: rv = self.invoke(ctx)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jul 1 19:47:44 server sentry[30104]: return _process_result(sub_ctx.command.invoke(sub_ctx))
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jul 1 19:47:44 server sentry[30104]: return _process_result(sub_ctx.command.invoke(sub_ctx))
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
Jul 1 19:47:44 server sentry[30104]: return ctx.invoke(self.callback, **ctx.params)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jul 1 19:47:44 server sentry[30104]: return callback(*args, **kwargs)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jul 1 19:47:44 server sentry[30104]: return f(get_current_context(), *args, **kwargs)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 73, in inner
Jul 1 19:47:44 server sentry[30104]: return ctx.invoke(f, *args, **kwargs)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jul 1 19:47:44 server sentry[30104]: return callback(*args, **kwargs)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jul 1 19:47:44 server sentry[30104]: return f(get_current_context(), *args, **kwargs)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 35, in inner
Jul 1 19:47:44 server sentry[30104]: configure()
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 125, in configure
Jul 1 19:47:44 server sentry[30104]: configure(ctx, py, yaml, skip_service_validation)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/settings.py", line 152, in configure
Jul 1 19:47:44 server sentry[30103]: Traceback (most recent call last):
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/bin/sentry", line 11, in <module>
Jul 1 19:47:44 server sentry[30103]: sys.exit(main())
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 162, in main
Jul 1 19:47:44 server sentry[30103]: cli(prog_name=get_prog(), obj={}, max_content_width=100)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
Jul 1 19:47:44 server sentry[30103]: return self.main(*args, **kwargs)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 697, in main
Jul 1 19:47:44 server sentry[30103]: rv = self.invoke(ctx)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jul 1 19:47:44 server sentry[30103]: return _process_result(sub_ctx.command.invoke(sub_ctx))
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
Jul 1 19:47:44 server sentry[30103]: return _process_result(sub_ctx.command.invoke(sub_ctx))
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
Jul 1 19:47:44 server sentry[30103]: return ctx.invoke(self.callback, **ctx.params)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jul 1 19:47:44 server sentry[30103]: return callback(*args, **kwargs)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jul 1 19:47:44 server sentry[30103]: return f(get_current_context(), *args, **kwargs)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 73, in inner
Jul 1 19:47:44 server sentry[30103]: return ctx.invoke(f, *args, **kwargs)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
Jul 1 19:47:44 server sentry[30103]: return callback(*args, **kwargs)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
Jul 1 19:47:44 server sentry[30103]: return f(get_current_context(), *args, **kwargs)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 35, in inner
Jul 1 19:47:44 server sentry[30103]: configure()
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 125, in configure
Jul 1 19:47:44 server sentry[30103]: configure(ctx, py, yaml, skip_service_validation)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/settings.py", line 152, in configure
Jul 1 19:47:44 server sentry[30106]: skip_service_validation=skip_service_validation
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 319, in initialize_app
Jul 1 19:47:44 server sentry[30106]: validate_options(settings)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 371, in validate_options
Jul 1 19:47:44 server sentry[30106]: default_manager.validate(settings.SENTRY_OPTIONS, warn=True)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/manager.py", line 265, in validate
Jul 1 19:47:44 server sentry[30106]: self.validate_option(k, v)
Jul 1 19:47:44 server sentry[30106]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/manager.py", line 275, in validate_option
Jul 1 19:47:44 server sentry[30106]: raise TypeError('%r: got %r, expected %r' % (key, _type(value), opt.type))
Jul 1 19:47:44 server sentry[30106]: TypeError: 'slack.client-id': got <type 'float'>, expected string
Jul 1 19:47:44 server sentry[30104]: skip_service_validation=skip_service_validation
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 319, in initialize_app
Jul 1 19:47:44 server sentry[30104]: validate_options(settings)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 371, in validate_options
Jul 1 19:47:44 server sentry[30104]: default_manager.validate(settings.SENTRY_OPTIONS, warn=True)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/manager.py", line 265, in validate
Jul 1 19:47:44 server sentry[30104]: self.validate_option(k, v)
Jul 1 19:47:44 server sentry[30104]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/manager.py", line 275, in validate_option
Jul 1 19:47:44 server sentry[30104]: raise TypeError('%r: got %r, expected %r' % (key, _type(value), opt.type))
Jul 1 19:47:44 server sentry[30104]: TypeError: 'slack.client-id': got <type 'float'>, expected string
Jul 1 19:47:44 server sentry[30103]: skip_service_validation=skip_service_validation
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 319, in initialize_app
Jul 1 19:47:44 server sentry[30103]: validate_options(settings)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 371, in validate_options
Jul 1 19:47:44 server sentry[30103]: default_manager.validate(settings.SENTRY_OPTIONS, warn=True)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/manager.py", line 265, in validate
Jul 1 19:47:44 server sentry[30103]: self.validate_option(k, v)
Jul 1 19:47:44 server sentry[30103]: File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/manager.py", line 275, in validate_option
Jul 1 19:47:44 server sentry[30103]: raise TypeError('%r: got %r, expected %r' % (key, _type(value), opt.type))
Jul 1 19:47:44 server sentry[30103]: TypeError: 'slack.client-id': got <type 'float'>, expected string
Jul 1 19:47:44 server systemd[1]: sentry-cron.service: Main process exited, code=exited, status=1/FAILURE
Jul 1 19:47:44 server systemd[1]: sentry-cron.service: Failed with result 'exit-code'.
Jul 1 19:47:44 server systemd[1]: sentry-web.service: Main process exited, code=exited, status=1/FAILURE
Jul 1 19:47:44 server systemd[1]: sentry-web.service: Failed with result 'exit-code'.
Jul 1 19:47:44 server systemd[1]: sentry-worker.service: Main process exited, code=exited, status=1/FAILURE
Jul 1 19:47:44 server systemd[1]: sentry-worker.service: Failed with result 'exit-code'.
Also having that if including the following configuration of slack to the config.yml
slack.client-id: %HIDDEN_ID%
slack.client-secret: %HIDDEN_ID%
slack.verification-token: %HIDDEN_ID%
Just to clarify: I had 401 when creating organization because of SENTRY_SINGLE_ORGANIZATION was (as default) set to True. But probably "Create new organization" should be hidden with this default config.
@Wirone What about you say OOM issue, could you tell me some specific steps
@Wxtrkbc I don't know proper reproducing path, but I can tell what was our case:
docker-compose from onpremise imageWhen migrations were running, at some point CPU usage drastically rose and Sentry's process was killed. I've stopped Rancher and Traefik at some point, but it ended the same way. So I've been watching htop and was killing non-Sentry processes (mostly Rancher) and somehow I managed to go through all migrations at once - then it was working :)
@Wirone ths !!!
At some point we should look into why migrations are using too much memory (assuming that’s the problem). They really shouldn’t and it’s possible it’s because it’s loading them all in memory.
it there any simple way to fully reinit database?
@mrPsycho nothing special to Sentry -- just drop the database and recreate it. Once done you can run 'sentry upgrade'.
I've confirmed there's a memory leak in South (the migration tool we're using). It's not an easy fix, and seemingly requires 1.5-2gb of memory on my laptop to run the migration suite.
You could stage migrations, so e.g. sentry django migrate sentry 100; sentry django migrate sentry 200; sentry django migrate sentry 300; sentry django migrate sentry 400; sentry django migrate sentry and likely get through it.
thanks!
but...
i dropped db, and tried to do:
SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry django migrate sentry 100
and got very long stacktrace.
last 2 errors:
Error in sys.excepthook:
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/raven/base.py", line 274, in handle_exception
self.captureException(exc_info=exc_info, level='fatal')
File "/www/sentry/local/lib/python2.7/site-packages/raven/base.py", line 814, in captureException
'raven.events.Exception', exc_info=exc_info, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py", line 46, in capture
return super(SentryInternalClient, self).capture(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 297, in capture
result = super(DjangoClient, self).capture(event_type, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/raven/base.py", line 641, in capture
self.send(**data)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py", line 75, in send
key = ProjectKey.get_default(settings.SENTRY_PROJECT)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/models/projectkey.py", line 121, in get_default
)[0]
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 132, in __getitem__
return list(qs)[0]
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 96, in __iter__
self._fetch_all()
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: ProgrammingError('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"."status" = %s AND "sentry_projectkey"."roles" = ("sentry_projectkey"."roles" | 1)) LIMIT 1
Original exception was:
Traceback (most recent call last):
File "/www/sentry/bin/sentry", line 11, in <module>
sys.exit(main())
File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/__init__.py", line 162, in main
cli(prog_name=get_prog(), obj={}, max_content_width=100)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/decorators.py", line 36, in inner
return ctx.invoke(f, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/runner/commands/django.py", line 25, in django
execute_from_command_line(argv=[ctx.command_path] + list(management_args))
File "/www/sentry/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/www/sentry/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/www/sentry/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/www/sentry/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/www/sentry/local/lib/python2.7/site-packages/south/management/commands/migrate.py", line 115, in handle
ignore_ghosts=ignore_ghosts,
File "/www/sentry/local/lib/python2.7/site-packages/south/migration/__init__.py", line 214, in migrate_app
applied_all = check_migration_histories(applied_all, delete_ghosts, ignore_ghosts)
File "/www/sentry/local/lib/python2.7/site-packages/south/migration/__init__.py", line 85, in check_migration_histories
for h in histories:
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 96, in __iter__
self._fetch_all()
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: ProgrammingError('relation "south_migrationhistory" does not exist\nLINE 1: ...gration", "south_migrationhistory"."applied" FROM "south_mig...\n ^\n',)
SQL: SELECT "south_migrationhistory"."id", "south_migrationhistory"."app_name", "south_migrationhistory"."migration", "south_migrationhistory"."applied" FROM "south_migrationhistory" WHERE "south_migrationhistory"."applied" IS NOT NULL ORDER BY "south_migrationhistory"."applied" ASC
sorry... missed button (
can you please attach initial dump of db, if is possible?
SENTRY_CONF=/etc/sentry /www/sentry/bin/sentry upgrade
also fails with lots of errors like:
ResponseError: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
13:27:02 [ERROR] sentry.errors: Unable to incr internal metric
> sentry:0415_auto__add_relay
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/metrics.py", line 64, in worker
tsdb.incr(tsdb.models.internal, full_key, count=amount)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/services.py", line 91, in <lambda>
context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/tsdb/redis.py", line 214, in incr
self.incr_multi([(model, key)], timestamp, count, environment_id)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/tsdb/redis.py", line 242, in incr_multi
self.calculate_expiry(rollup, max_values, timestamp),
File "/www/sentry/local/lib/python2.7/site-packages/rb/clients.py", line 625, in __exit__
self.mapping_client.join(timeout=timeout)
File "/www/sentry/local/lib/python2.7/site-packages/rb/clients.py", line 413, in join
command_buffer.wait_for_responses(self)
File "/www/sentry/local/lib/python2.7/site-packages/rb/clients.py", line 226, in wait_for_responses
self.connection, command_name, **options)
File "/www/sentry/local/lib/python2.7/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/www/sentry/local/lib/python2.7/site-packages/redis/connection.py", line 582, in read_response
raise response
ResponseError: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
13:27:04 [ERROR] sentry.errors: Unable to incr internal metric
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/metrics.py", line 64, in worker
tsdb.incr(tsdb.models.internal, full_key, count=amount)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/services.py", line 91, in <lambda>
context[key] = (lambda f: lambda *a, **k: getattr(self, f)(*a, **k))(key)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/tsdb/redis.py", line 214, in incr
self.incr_multi([(model, key)], timestamp, count, environment_id)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/tsdb/redis.py", line 242, in incr_multi
self.calculate_expiry(rollup, max_values, timestamp),
File "/www/sentry/local/lib/python2.7/site-packages/rb/clients.py", line 625, in __exit__
self.mapping_client.join(timeout=timeout)
File "/www/sentry/local/lib/python2.7/site-packages/rb/clients.py", line 413, in join
command_buffer.wait_for_responses(self)
File "/www/sentry/local/lib/python2.7/site-packages/rb/clients.py", line 226, in wait_for_responses
self.connection, command_name, **options)
File "/www/sentry/local/lib/python2.7/site-packages/redis/client.py", line 585, in parse_response
response = connection.read_response()
File "/www/sentry/local/lib/python2.7/site-packages/redis/connection.py", line 582, in read_response
raise response
ResponseError: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
13:27:08 [ERROR] sentry.errors: Unable to incr internal metric
Many of the errors here are misconfiguration issues, and this isn't a support forum. Please take general questions to https://forum.sentry.io. The only valid issue here is Sentry requiring a lot of memory to run upgrades, but you can either do what I said or you can use a machine that has a reasonable amount of memory (e.g. 4gb).
hmmmm....
this is strange. cause only one difference form installing from scratch - is enabling this:
symbolserver.enabled: true
symbolserver.options:
url: http://127.0.0.1:3000
@dcramer it is very hard to post on forum.
only two links for new posts... limited number of charts..
how to add logs?
anyway.
i reinstalled sentry from the beginning. with simple configs.
and i still have problems with migrating.
my account approved.
thanks to that guy.
but, it look like nobody cares: https://forum.sentry.io/t/how-to-install-sentry-via-pip-with-symbol-server-for-ios/4275
here i'm posting link only for information.
When upgrade was interrepted by some reason likes cpu or memory limit , i occured the same problem; after remove volumes and container, i tried again, it succeeded.
I created an installation guide for those who have problems.
[My install guide](https://github.com/tecnoe/sentry/blob/master/setup.sh)
The most frequent problems with the installation that I have noticed, the database is not created correctly.
Note. Do not run sentry run web and sentry run worker as root user.
I finished the installation without any errors, but my CPU is always at 90%. Someone has an idea of what is happening or I need a server with more capacity.
@tecnoe if its at 90% during installation, you're probably fine. It has to pull down a lot of stuff. The bootup time can also be expensive. I wont say Sentry requires huge amounts of cpu/resources, but its also fairly complex and does a lot of things.
I will note that It does roughly require at least 3GB of memory to run the migrations during setup. We'd like to fix that, but frankly it's not our code that runs migrations and it's quite hard to grok exactly why its doing everything the way it is.
@tecnoe thanks a lot!
but... on clean database i see this:
(sentry) sentry@server:/root$ SENTRY_CONF=/etc/sentry sentry upgrade
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/store.py", line 165, in get_store
value = self.model.objects.get(key=key.name).value
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
return self.get_queryset().get(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
num = len(clone)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
self._fetch_all()
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
ProgrammingError: ProgrammingError('relation "sentry_option" does not exist\nLINE 1: ...ion"."value", "sentry_option"."last_updated" FROM "sentry_op...\n ^\n',)
SQL: SELECT "sentry_option"."id", "sentry_option"."key", "sentry_option"."value", "sentry_option"."last_updated" FROM "sentry_option" WHERE "sentry_option"."key" = %s
21:48:00 [ERROR] sentry: option.failed-lookup (key=u'system.url-prefix')
Top level Sentry exception caught - failed creating log record
option.failed-lookup
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/raven/handlers/logging.py", line 94, in emit
return self._emit(record)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/handlers.py", line 33, in _emit
return super(SentryHandler, self)._emit(record, request=request)
File "/www/sentry/local/lib/python2.7/site-packages/raven/handlers/logging.py", line 187, in _emit
**kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py", line 46, in capture
return super(SentryInternalClient, self).capture(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 297, in capture
result = super(DjangoClient, self).capture(event_type, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/raven/base.py", line 641, in capture
self.send(**data)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py", line 75, in send
key = ProjectKey.get_default(settings.SENTRY_PROJECT)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/models/projectkey.py", line 121, in get_default
)[0]
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 132, in __getitem__
return list(qs)[0]
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 96, in __iter__
self._fetch_all()
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
ProgrammingError: ProgrammingError('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"."status" = %s AND "sentry_projectkey"."roles" = ("sentry_projectkey"."roles" | 1)) LIMIT 1
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/sentry/options/store.py", line 165, in get_store
value = self.model.objects.get(key=key.name).value
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/manager.py", line 151, in get
return self.get_queryset().get(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 304, in get
num = len(clone)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 77, in __len__
self._fetch_all()
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
ProgrammingError: ProgrammingError('relation "sentry_option" does not exist\nLINE 1: ...ion"."value", "sentry_option"."last_updated" FROM "sentry_op...\n ^\n',)
SQL: SELECT "sentry_option"."id", "sentry_option"."key", "sentry_option"."value", "sentry_option"."last_updated" FROM "sentry_option" WHERE "sentry_option"."key" = %s
21:48:00 [ERROR] sentry: option.failed-lookup (key=u'system.url-prefix')
Top level Sentry exception caught - failed creating log record
option.failed-lookup
Traceback (most recent call last):
File "/www/sentry/local/lib/python2.7/site-packages/raven/handlers/logging.py", line 94, in emit
return self._emit(record)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/handlers.py", line 33, in _emit
return super(SentryHandler, self)._emit(record, request=request)
File "/www/sentry/local/lib/python2.7/site-packages/raven/handlers/logging.py", line 187, in _emit
**kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py", line 46, in capture
return super(SentryInternalClient, self).capture(*args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 297, in capture
result = super(DjangoClient, self).capture(event_type, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/raven/base.py", line 641, in capture
self.send(**data)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/utils/raven.py", line 75, in send
key = ProjectKey.get_default(settings.SENTRY_PROJECT)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/models/projectkey.py", line 121, in get_default
)[0]
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 132, in __getitem__
return list(qs)[0]
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 96, in __iter__
self._fetch_all()
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/www/sentry/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/raven/contrib/django/client.py", line 123, in execute
return real_execute(self, sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/www/sentry/local/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 80, in inner
raise_the_exception(self.db, e)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 78, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 22, in inner
return func(self, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 101, in inner
six.reraise(exc_info[0], exc_info[0](msg), exc_info[2])
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/decorators.py", line 94, in inner
return func(self, sql, *args, **kwargs)
File "/www/sentry/local/lib/python2.7/site-packages/sentry/db/postgres/base.py", line 47, in execute
return self.cursor.execute(sql, params)
ProgrammingError: ProgrammingError('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"."status" = %s AND "sentry_projectkey"."roles" = ("sentry_projectkey"."roles" | 1)) LIMIT 1
Syncing...
but then, it finishes without errrors.... and yes, it asked for a creating user!
last log:
Running migrations for tagstore:
- Migrating forwards to 0008_auto__chg_field_tagkey_environment_id.
> tagstore:0001_initial
> tagstore:0002_auto__del_tagkey__del_unique_tagkey_project_id_environment_id_key__del
> tagstore:0003_auto__add_tagkey__add_unique_tagkey_project_id_environment_id_key__add
> tagstore:0004_auto__del_tagkey__del_unique_tagkey_project_id_environment_id_key__del
> tagstore:0005_auto__add_tagvalue__add_unique_tagvalue_project_id__key_value__add_ind
> tagstore:0006_auto__del_unique_eventtag_event_id_key_value__add_unique_eventtag_proj
> tagstore:0007_auto__chg_field_tagkey_environment_id__chg_field_tagkey_project_id__ch
> tagstore:0008_auto__chg_field_tagkey_environment_id
- Loading initial data for tagstore.
Installed 0 object(s) from 0 fixture(s)
Creating missing DSNs
Correcting Group.num_comments counter
is first errors are critical?
So this is how I managed to get through this:
sentry django syncdb
sentry django migrate --merge --ignore-ghost-migrations --noinput sentry 0100
sentry django migrate --merge --ignore-ghost-migrations --noinput sentry 0200
sentry django migrate --merge --ignore-ghost-migrations --noinput sentry 0300
sentry django migrate --merge --ignore-ghost-migrations --noinput sentry 0400
sentry upgrade
After this, you probably have not created the organization, do that (as explained above):
Run sentry shell, which will give you a python REPL within Sentry env.
Then do:
from sentry.models import Project
from sentry.receivers.core import create_default_projects
create_default_projects([Project])
At this point, hopefully you can create the user:
sentry createuser
Another thing I did, was to create a 2GB swap file.
# sudo dd if=/dev/zero of=/swapfile bs=500M count=4
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile
Closing due to staleness and multiple comments with working solutions. This boils down to failed migrations at the start and we should ideally handle this better. These are being tracked in other issues so closing this one.
@BYK can you point out a working workaround to me? Migrating 100 migrations at a time does not work since sentry django migrate does not take any arguments:
CommandError: Command doesn't accept any arguments
This is with the latest Docker image (sentry:9.1.1).
@agronholm have you tried running docker-compose run --rm web upgrade?
What does docker-compose have to do with this? I run Sentry on Kubernetes.
For the record, I was able to get the upgrade from start to end by recreating the db and then running the migrations on my laptop against the Kubernetes PostgreSQL instance by port-forwarding the service to my laptop.
I suspect that the underlying problem is that South does not use transactions when it does migrations so the schema will end up in an inconsistent state if the migration is interrupted. And don't even get me started on why all the migrations since the dawn of time have to be run in order to get a working database.
The workaround is to have more RAM. I think 3G is enough to be fine. It’s a problem with South, we’re aware, but using this much avoids the issue.
Now, because you’re being just so nice and friendly, I’ll address your other points.
I suspect that the underlying problem is that South does not use transactions when it does migrations so the schema will end up in an inconsistent state if the migration is interrupted.
Some do, some don’t. This isn’t South behavior, it’s our behavior. South by default runs each migration individually in its own transaction in Postgres. But in a lot of cases for us, we have to opt out of this behavior and skip using transactions because depending on the migrations, the long lived transactions have the ability to, I don’t know, take down a production Postgres.
And don't even get me started on why all the migrations since the dawn of time have to be run in order to get a working database.
Yeah, less than ideal. I get it. An alternative is to squash them and provide no upgrade path between versions. Remember that we also use these for ourselves, so we need the incremental migrations, or for anyone tagging along on master, etc. so the migrations are needed to get between arbitrary points. BUT, in your defense, we don’t need the, for all of history. We could squash some of the really old ones. But then where do we pick this point in time? 🤷♂ We are planning to do this actually at the same time we switch over to Django native migrations which will also solve the memory issue and just accept that we are breaking upgrade paths for users.
Please be nicer in the future for your free software.
I've been trying to get Sentry working for two days which has left me somewhat irate, so I apologize if my posts came out as a bit aggressive.. My Kubernetes cluster is set up using the minimum settings (7 Gb of RAM per node) as I did not expect to need much RAM on any single node.
As far as the migration approach goes, our own app is set up in such a way that the initialization command creates the latest schema directly when setting up a new instance. Migrations are only done on upgrade. I don't know if this approach would work for you. It's a tradeoff, but I felt that doing all the migrations from day 1 each time would make the installation process longer and longer as more schema changes came along. And if the process is as brittle as it is in Sentry's case, it might be worth considering a change to the approach. I'm just saying because there are a lot of people complaining about issues caused by this.
Again, apologies for the rudeness.
@agronholm
What does docker-compose have to do with this? I run Sentry on Kubernetes.
You never mentioned this earlier so I assumed you were running the officially supported version at getsentry/onpremise which uses docker-compose.
Also, next time please prefer the Community Forums for questions.
You never mentioned this earlier so I assumed you were running the officially supported version at getsentry/onpremise which uses docker-compose.
I installed Sentry using the Helm chart from the stable repository (stable/sentry). The latest version of this chart uses the sentry:9.1.1 image. I did not know about this other image.
Probably worth noting that the helm chart is not ours and we do not maintain it. I’m not sure how we can communicate that or make it clear. I don’t use helm, so have little context here on what we can do.
Probably worth noting that the helm chart is not ours and we do not maintain it. I’m not sure how we can communicate that or make it clear. I don’t use helm, so have little context here on what we can do.
Most often the helm charts, even official ones, are not tied to the vendor of the image, and I wasn't expecting this one to be either. But for the record, should that chart be using the getsentry/onpremise image instead of the sentry image? If so, what is the sentry image for?
If you'd like, I can start a new topic on the community forum instead of continuing here. But this issue is what I found on Google while trying to get answers.
@agronholm getsentry/onpremise is not an image, it is a sample repo that has config for all services needed for Sentry using docker-compose. Is still uses the main sentry image from getsentry/docker-sentry.
Let's continue over the forums if you have more to share or discuss around this.
wow, in kubernetes land (self-hosted cluster) this post just saved my bacon, thanks!
(using chart stable/sentry v4.2.1) came up from fresh install pretty broken, hours of sorting through...
kubectl exec -it -n${NS?} deploy/production-sentry-web -- sh -c 'sentry upgrade'
Most helpful comment
Well, we can try to do something here. :)
Run
sentry shell, which will give you a python REPL within Sentry env.Then do:
This should get those defaults created. But it seems you're also (or I'm assuming) lacking a superuser? Not sure if you were prompted for that.