Database installations seems to be failing
amir-hadi opened this issue · comments
Hi,
I just upgraded to sentry 6.0.6 and installed your plugin. After upgrading the database (sentry upgrade) and restarting sentry, your plugin is visible in the projects and enabled, but in the logs I see the following error:
Error processing 'actions' on 'CommentsPlugin': (1146, "Table 'sentry.sentry_comments_groupcomments' doesn't exist")
Traceback (most recent call last):
File "/var/sentry/sentryenv/lib/python2.6/site-packages/sentry/utils/safe.py", line 19, in safe_execute
result = func(*args, **kwargs)
File "/var/sentry/sentryenv/lib/python2.6/site-packages/sentry_comments/plugin.py", line 77, in actions
action_list.append((self.get_title(group), self.get_url(group)))
File "/var/sentry/sentryenv/lib/python2.6/site-packages/sentry_comments/plugin.py", line 39, in get_title
count = GroupComments.objects.filter(group=group).count()
File "/var/sentry/sentryenv/lib/python2.6/site-packages/django/db/models/query.py", line 388, in count
return self.query.get_count(using=self.db)
File "/var/sentry/sentryenv/lib/python2.6/site-packages/django/db/models/sql/query.py", line 428, in get_count
number = obj.get_aggregation(using=using)[None]
File "/var/sentry/sentryenv/lib/python2.6/site-packages/django/db/models/sql/query.py", line 394, in get_aggregation
result = query.get_compiler(using).execute_sql(SINGLE)
File "/var/sentry/sentryenv/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
cursor.execute(sql, params)
File "/var/sentry/sentryenv/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 130, in execute
six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
File "/var/sentry/sentryenv/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 120, in execute
return self.cursor.execute(query, args)
File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in execute
self.errorhandler(self, exc, value)
File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35, in defaulterrorhandler
raise errorclass, errorvalue
DatabaseError: (1146, "Table 'sentry.sentry_comments_groupcomments' doesn't exist")
It looks like that even I upgraded (migrated) the sentry databases, your plugins tables aren't created. Any ideas what I am missing?
Cheers,
Amir
Thanks for reporting! This was an documentation issue. You'll have to add the plugin to INSTALLED_APPS in your sentry configuration:
INSTALLED_APPS += ('sentry_comments',)
and run sentry --config=your.conf.py upgrade
to sync the tables.
Thank you, this solved my problem. This was my first sentry plugin installed. For other starters: don't forget to import sentry configuration settings in your sentry.conf.py.
from sentry.conf.server import *
FTR, I'm still not sure if this is an issue with Sentry and how it loads apps that register themselve using the sentry.apps entrypoint: getsentry/sentry#1042