cabotapp/cabot-alert-slack

How do I enable the plugin?

Opened this issue ยท 9 comments

be9 commented

Hi, I added the plugin to virtualenv, ran syncdb, but it still doesn't appear in Alerts: multi-select widget on new service page. Digging into resources revealed that plugin list is taken from database, but my cabotapp_alertplugin table is missing slack-related row.

On the other hand, cabot_alert_slack_slackalert and cabot_alert_slack_slackalertuserdata tables got created.

How do I make cabot add this missing row?

Hello,

Did you add cabot_alert_slack to CABOT_PLUGINS_ENABLED ? That should be enough to make it work.

@be9 Did you get that to work ? I have the same issue
Even adding that row to the table manually didnt solve the issue

Ok looks like i found the issue. Don't add the slack row manually. Let some alarm go off , it should get created automatically. Thats what happened in my case

I can't get slack to show up as an alert option ... I really have tried everything I and another developer could think of ... Please let me know what needs to be done... I can see that it is installed and the syncdb has run. It is also added to the plugins enabled

I had the same problem and romankor's solution seems to work. After first attempt to send email from one of my services using cabot_alert_email new plugins magically appeared on list and were added to database. It is worth noting that I had my own plugin sending alerts before using email and it didn't trigger database update.

This was weird. It seems like calling alert.update_alert_plugins() in cabot should fix it, but that doesn't happen. Probably a cabot bug.

What I did to fix this was:

  • lookup the id associated with my slack plugin in django_content_type:

    select id from django_content_type where model = 'slackalert';
    -- this returned 38 for me
  • Insert this id into cabot_alertplugin with the proper title and set enabled to true:

    insert into cabotapp_alertplugin (polymorphic_ctype_id, title, enabled) values (38, 'Slack', true);
  • Get the id of the new cabot_alertplugin i just created:

    select id from cabotapp_alertplugin where title = 'Slack';
    -- this returned 5 for me
  • Insert that id into cabot_alert_slack_slackalert as the alertplugin_ptr_id:

    insert into cabot_alert_slack_slackalert (alertplugin_ptr_id) values (5);

@josegonzalez comment helped me fix the issue on my install

rmrf commented

yup, this is cabot issue, I have similar for my SMS plugin.

This problem is still valid for Cabot 0.6.0 (6h of Feb 2017 - https://github.com/arachnys/cabot/tree/0.6.0). (I can't test on newer version as updated fails on my instance). But the workaround mentioned @romankor still work.