getsentry / sentry-hipchat-ac

New hipchat API.
Apache License 2.0
11 stars 5 forks source link

Migrations are not applied on sentry upgrade #26

Closed alejandrodnm closed 8 years ago

alejandrodnm commented 8 years ago

I installed the plugin via pip, ran the upgrade, but the migrations are not being applied. Executing sentry plugin list I get sentry-hipchat-ac 1.0.0.

In consequence every time I click on the integration button in the sentry interface I get an exception about some models that don't exists.

Am I doing something wrong?

alejandrodnm commented 8 years ago

I had to execute SENTRY_CONF=/etc/sentry sentry django migrate sentry_hipchat_ac in order to install the migrations.

vitaliyf commented 8 years ago

There are also int(11) vs bigint(20) issues that cause foreign keys to break on MySQL. Sounds like this plugin might be ignoring SENTRY_USE_BIG_INTS=True.

dcramer commented 8 years ago

I was going to fix this but its a bit of a pita. We need to change the ManyToMany relationships to just be intermediary models, and to use FlexibleForeignKey.

mcescalante commented 8 years ago

I am running into this issue still now when trying to use the integration on my On Premise instance.

Here is the full error that Sentry Internal is showing. This happens when I try to configure the plugin, which shows up in Project Settings.

ProgrammingError: relation "sentry_hipchat_ac_tenant" does not exist
LINE 1: ...", "sentry_hipchat_ac_tenant"."auth_user_id" FROM "sentry_hi...
                                                             ^

SQL: SELECT "sentry_hipchat_ac_tenant"."id", "sentry_hipchat_ac_tenant"."room_id", "sentry_hipchat_ac_tenant"."room_name", "sentry_hipchat_ac_tenant"."room_owner_id", "sentry_hipchat_ac_tenant"."room_owner_name", "sentry_hipchat_ac_tenant"."secret", "sentry_hipchat_ac_tenant"."homepage", "sentry_hipchat_ac_tenant"."token_url", "sentry_hipchat_ac_tenant"."capabilities_url", "sentry_hipchat_ac_tenant"."api_base_url", "sentry_hipchat_ac_tenant"."installed_from", "sentry_hipchat_ac_tenant"."auth_user_id" FROM "sentry_hipchat_ac_tenant" INNER JOIN "sentry_hipchat_ac_tenant_projects" ON ( "sentry_hipchat_ac_tenant"."id" = "sentry_hipchat_ac_tenant_projects"."tenant_id" ) WHERE "sentry_hipchat_ac_tenant_projects"."project_id" = %s 
dcramer commented 8 years ago

At one point we'll fix this, but I'm going to point that we don't support MySQL these days, so we're absolutely not prioritizing this (and its non-trivial to fix).

mcescalante commented 8 years ago

Ah, gotcha - didn't think about how this was written before the Postgres migration. Thanks @dcramer for the quick response & update :)

iJebus commented 8 years ago

@dcramer probably just need to update the readme as it is currently misleading :(

timonreinhard commented 8 years ago

After upgrading to Sentry 8.7.0 I've run sentry django migrate sentry_hipchat_ac as @alejandrodnm suggested and ended up with some version conflict:

Failed to load plugin 'hipchat_ac':
Traceback (most recent call last):
  File "/srv/sentry/local/lib/python2.7/site-packages/sentry/runner/initializer.py", line 42, in register_plugins
    plugin = ep.load()
  File "/srv/sentry/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2248, in load
    self.require(*args, **kwargs)
  File "/srv/sentry/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2265, in require
    items = working_set.resolve(reqs, env, installer)
  File "/srv/sentry/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 859, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (requests 2.11.1 (/srv/sentry/lib/python2.7/site-packages), Requirement.parse('requests[security]<2.11.0,>=2.9.1'), set(['sentry']))

As a result the HipChat integration isn't available in the project settings anymore.

dcramer commented 8 years ago

It sounds like something you ran installed an incompatible version of requests. I would confirm that Sentry's requirements are still correct, as sentry-hipchat-ac does not change the requirements for 'requests' (it simply says its required), and thus you should have a version that satisfies sentry.