Getting Internal Error After Restarting the sentry
Self-Hosted Version
23.9.1
CPU Architecture
x86_64
Docker Version
Docker version 24.0.6, build ed223bc
Docker Compose Version
docker-compose version 1.29.2, build 5becea4c
Steps to Reproduce
- ./install.sh
- docker compose up -d
- got the error : https://www.dragonflydb.io/error-solutions/redis-exceptions-busyloadingerror-redis-is-loading-the-dataset-in-memory (web-api-container unhealhty )
- tried after a while it worked, sentry is up and running 5, got internal errors now in dashboard on issues page and projects page
Expected Result
Page Should show up the issues list
Actual Result
Internal error
Event ID
No response
What error logs are you getting in your redis/web containers? Could this be a redis issue on your side rather than a self-hosted Sentry specific issue?
@hubertdeng123 Seems we lost the redis volume data, when restarted it created a new redis-volume this seems issue how we can restore the redis to in sync with database again
redis logs
1:M 22 Mar 2024 00:43:32.019 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 00:43:33.780 * Background saving started by pid 6957
6957:C 22 Mar 2024 00:48:41.393 * DB saved on disk
6957:C 22 Mar 2024 00:48:42.557 * RDB: 551 MB of memory used by copy-on-write
1:M 22 Mar 2024 00:48:44.094 * Background saving terminated with success
1:M 22 Mar 2024 00:49:45.085 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 00:49:46.885 * Background saving started by pid 7030
7030:C 22 Mar 2024 00:54:54.412 * DB saved on disk
7030:C 22 Mar 2024 00:54:55.614 * RDB: 370 MB of memory used by copy-on-write
1:M 22 Mar 2024 00:54:57.130 * Background saving terminated with success
1:M 22 Mar 2024 00:55:58.020 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 00:55:59.844 * Background saving started by pid 7109
7109:C 22 Mar 2024 01:01:07.794 * DB saved on disk
7109:C 22 Mar 2024 01:01:08.998 * RDB: 378 MB of memory used by copy-on-write
1:M 22 Mar 2024 01:01:10.670 * Background saving terminated with success
1:M 22 Mar 2024 01:02:11.041 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 01:02:12.827 * Background saving started by pid 7182
7182:C 22 Mar 2024 01:07:18.933 * DB saved on disk
7182:C 22 Mar 2024 01:07:20.096 * RDB: 542 MB of memory used by copy-on-write
1:M 22 Mar 2024 01:07:21.714 * Background saving terminated with success
1:M 22 Mar 2024 01:08:22.094 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 01:08:23.917 * Background saving started by pid 7255
7255:C 22 Mar 2024 01:13:29.980 * DB saved on disk
7255:C 22 Mar 2024 01:13:31.114 * RDB: 536 MB of memory used by copy-on-write
1:M 22 Mar 2024 01:13:32.676 * Background saving terminated with success
1:M 22 Mar 2024 01:14:33.049 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 01:14:34.900 * Background saving started by pid 7329
7329:C 22 Mar 2024 01:19:41.856 * DB saved on disk
7329:C 22 Mar 2024 01:19:43.028 * RDB: 581 MB of memory used by copy-on-write
1:M 22 Mar 2024 01:19:44.625 * Background saving terminated with success
1:M 22 Mar 2024 01:20:45.008 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 01:20:46.868 * Background saving started by pid 7408
7408:C 22 Mar 2024 01:25:56.578 * DB saved on disk
7408:C 22 Mar 2024 01:25:57.776 * RDB: 561 MB of memory used by copy-on-write
1:M 22 Mar 2024 01:25:59.312 * Background saving terminated with success
1:M 22 Mar 2024 01:27:00.099 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 01:27:02.001 * Background saving started by pid 7482
7482:C 22 Mar 2024 01:32:10.786 * DB saved on disk
7482:C 22 Mar 2024 01:32:12.005 * RDB: 565 MB of memory used by copy-on-write
1:M 22 Mar 2024 01:32:13.615 * Background saving terminated with success
1:M 22 Mar 2024 01:33:14.002 * 10000 changes in 60 seconds. Saving...
1:M 22 Mar 2024 01:33:15.846 * Background saving started by pid 7555
web logs
` return func(self, sql, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/base.py", line 86, in execute return self.cursor.execute(sql, clean_bad_params(params)) django.db.utils.ProgrammingError: UndefinedTable('relation "sentry_notificationsetting" does not exist\nLINE 1: ..."type", "sentry_notificationsetting"."value" FROM "sentry_no...\n ^\n') SQL: SELECT "sentry_notificationsetting"."id", "sentry_notificationsetting"."scope_type", "sentry_notificationsetting"."scope_identifier", "sentry_notificationsetting"."target_id", "sentry_notificationsetting"."team_id", "sentry_notificationsetting"."user_id", "sentry_notificationsetting"."provider", "sentry_notificationsetting"."type", "sentry_notificationsetting"."value" FROM "sentry_notificationsetting" WHERE ((("sentry_notificationsetting"."scope_identifier" IN (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) AND "sentry_notificationsetting"."scope_type" = %s) OR ("sentry_notificationsetting"."scope_identifier" = %s AND "sentry_notificationsetting"."scope_type" = %s)) AND "sentry_notificationsetting"."type" = %s AND "sentry_notificationsetting"."user_id" = %s) 01:36:41 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.organization_teams.OrganizationTeamsEndpoint' response=500 user_id='87' is_app='None' token_type='None' is_frontend_request='True' organization_id='1' auth_id='None' path='/api/0/organizations/shipsy/teams/' caller_ip='65.108.218.124' user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.0404658317565918 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None') 01:36:41 [ERROR] django.request: Internal Server Error: /api/0/organizations/shipsy/teams/ (status_code=500 request=<WSGIRequest: GET '/api/0/organizations/shipsy/teams/'>) 01:36:42 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.organization_processingissues.OrganizationProcessingIssuesEndpoint' response=200 user_id='87' is_app='None' token_type='None' is_frontend_request='True' organization_id='1' auth_id='None' path='/api/0/organizations/shipsy/processingissues/' caller_ip='65.108.218.124' user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.04148077964782715 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None') Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 91, in inner return func(self, sql, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/base.py", line 86, in execute return self.cursor.execute(sql, clean_bad_params(params)) psycopg2.errors.UndefinedTable: relation "sentry_notificationsetting" does not exist LINE 1: ..."type", "sentry_notificationsetting"."value" FROM "sentry_no... ^
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 77, in inner raise_the_exception(self.db, e) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 75, in inner return func(self, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 18, in inner return func(self, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 95, in inner raise exc_info0.with_traceback(exc_info[2]) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 91, in inner return func(self, sql, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/base.py", line 86, in execute return self.cursor.execute(sql, clean_bad_params(params)) psycopg2.errors.UndefinedTable: UndefinedTable('relation "sentry_notificationsetting" does not exist\nLINE 1: ..."type", "sentry_notificationsetting"."value" FROM "sentry_no...\n ^\n') SQL: SELECT "sentry_notificationsetting"."id", "sentry_notificationsetting"."scope_type", "sentry_notificationsetting"."scope_identifier", "sentry_notificationsetting"."target_id", "sentry_notificationsetting"."team_id", "sentry_notificationsetting"."user_id", "sentry_notificationsetting"."provider", "sentry_notificationsetting"."type", "sentry_notificationsetting"."value" FROM "sentry_notificationsetting" WHERE ((("sentry_notificationsetting"."scope_identifier" IN (%s) AND "sentry_notificationsetting"."scope_type" = %s) OR ("sentry_notificationsetting"."scope_identifier" = %s AND "sentry_notificationsetting"."scope_type" = %s)) AND "sentry_notificationsetting"."type" = %s AND "sentry_notificationsetting"."user_id" = %s)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sentry/api/base.py", line 250, in handle_exception
response = super().handle_exception(exc)
File "/usr/local/lib/python3.8/site-packages/sentry/../rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.8/site-packages/sentry/../rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.8/site-packages/sentry/api/base.py", line 374, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/api/helpers/group_index/index.py", line 140, in wrapper
response = function(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/api/endpoints/organization_group_index.py", line 346, in get
context = serialize(
File "/usr/local/lib/python3.8/site-packages/sentry/api/serializers/base.py", line 69, in serialize
attrs = serializer.get_attrs(
File "/usr/local/lib/python3.8/site-packages/sentry/api/serializers/models/group_stream.py", line 212, in get_attrs
attrs = super().get_attrs(item_list, user)
File "/usr/local/lib/python3.8/site-packages/sentry/api/serializers/models/group.py", line 231, in get_attrs
subscriptions = self._get_subscriptions(item_list, user)
File "/usr/local/lib/python3.8/site-packages/sentry/api/serializers/models/group.py", line 614, in _get_subscriptions
notifications_service.get_settings_for_user_by_projects(
File "/usr/local/lib/python3.8/site-packages/sentry/services/hybrid_cloud/notifications/impl.py", line 145, in get_settings_for_user_by_projects
return [
File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 280, in iter
self._fetch_all()
File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 1324, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 51, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
File "/usr/local/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python3.8/site-packages/sentry/../sentry_sdk/integrations/django/init.py", line 616, in execute
return real_execute(self, sql, params)
File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/site-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 77, in inner
raise_the_exception(self.db, e)
File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 75, in inner
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 18, in inner
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 95, in inner
raise exc_info0.with_traceback(exc_info[2])
File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/decorators.py", line 91, in inner
return func(self, sql, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sentry/db/postgres/base.py", line 86, in execute
return self.cursor.execute(sql, clean_bad_params(params))
django.db.utils.ProgrammingError: UndefinedTable('relation "sentry_notificationsetting" does not exist\nLINE 1: ..."type", "sentry_notificationsetting"."value" FROM "sentry_no...\n ^\n')
SQL: SELECT "sentry_notificationsetting"."id", "sentry_notificationsetting"."scope_type", "sentry_notificationsetting"."scope_identifier", "sentry_notificationsetting"."target_id", "sentry_notificationsetting"."team_id", "sentry_notificationsetting"."user_id", "sentry_notificationsetting"."provider", "sentry_notificationsetting"."type", "sentry_notificationsetting"."value" FROM "sentry_notificationsetting" WHERE ((("sentry_notificationsetting"."scope_identifier" IN (%s) AND "sentry_notificationsetting"."scope_type" = %s) OR ("sentry_notificationsetting"."scope_identifier" = %s AND "sentry_notificationsetting"."scope_type" = %s)) AND "sentry_notificationsetting"."type" = %s AND "sentry_notificationsetting"."user_id" = %s)
01:36:42 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.organization_group_index.OrganizationGroupIndexEndpoint' response=500 user_id='87' is_app='None' token_type='None' is_frontend_request='True' organization_id='1' auth_id='None' path='/api/0/organizations/shipsy/issues/' caller_ip='65.108.218.124' user_agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36' rate_limited='False' rate_limit_category='None' request_duration_seconds=0.253847599029541 rate_limit_type='DNE' concurrent_limit='None' concurrent_requests='None' reset_time='None' group='None' limit='None' remaining='None')
01:36:42 [ERROR] django.request: Internal Server Error: /api/0/organizations/shipsy/issues/ (status_code=500 request=<WSGIRequest: GET '/api/0/organizations/shipsy/issues/?collapse=stats&expand=owners&expand=inbox&limit=25&project=28&query=is%3Aunresolved&shortIdLookup=1&statsPeriod=1h'>)
01:36:43 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.artifact_lookup.ProjectArtifactLookupEndpoint' response=200 user_id='None' is_app='None' token_type='SystemToken' is_frontend_request='False' organization_id='1' auth_id='
01:36:57 [INFO] sentry.access.api: api.access (method='GET' view='sentry.api.endpoints.artifact_lookup.ProjectArtifactLookupEndpoint' response=200 user_id='None' is_app='None' token_type='SystemToken' is_frontend_request='False' organization_id='1' auth_id='
What happens if you re-run the install script (not a fresh install, just run ./install.sh locally). Seems like a migration may have gone awry.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀