{"action":"created","issue":{"url":"https://api.github.com/repos/StackStorm/st2/issues/1671","labels_url":"https://api.github.com/repos/StackStorm/st2/issues/1671/labels{/name}","comments_url":"https://api.github.com/repos/StackStorm/st2/issues/1671/comments","events_url":"https://api.github.com/repos/StackStorm/st2/issues/1671/events","html_url":"https://github.com/StackStorm/st2/issues/1671","id":91944459,"number":1671,"title":"Rules are not registered","user":{"login":"armab","id":1533818,"avatar_url":"https://avatars.githubusercontent.com/u/1533818?v=3","gravatar_id":"","url":"https://api.github.com/users/armab","html_url":"https://github.com/armab","followers_url":"https://api.github.com/users/armab/followers","following_url":"https://api.github.com/users/armab/following{/other_user}","gists_url":"https://api.github.com/users/armab/gists{/gist_id}","starred_url":"https://api.github.com/users/armab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/armab/subscriptions","organizations_url":"https://api.github.com/users/armab/orgs","repos_url":"https://api.github.com/users/armab/repos","events_url":"https://api.github.com/users/armab/events{/privacy}","received_events_url":"https://api.github.com/users/armab/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/StackStorm/st2/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/StackStorm/st2/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-30T00:46:16Z","updated_at":"2015-06-30T12:51:47Z","closed_at":null,"body":"#### Install `latest`\r\n```\r\nsudo ./st2_deploy.sh latest\r\n# install hubot pack\r\nst2 run packs.install packs=hubot register=all\r\n\r\nst2 rule list\r\nst2ctl reload --register-all\r\n```\r\n\r\n#### Result: \r\n```\r\nRegistering content...[flags = --register-all]\r\n2015-06-29 23:39:11,253 INFO [-] Connecting to database \"st2\" @ \"0.0.0.0:27017\" as user \"None\".\r\n2015-06-29 23:39:11,372 INFO [-] =========================================================\r\n2015-06-29 23:39:11,373 INFO [-] ############## Registering sensors ######################\r\n2015-06-29 23:39:11,374 INFO [-] =========================================================\r\n2015-06-29 23:39:11,874 INFO [-] Registered 1 sensors.\r\n2015-06-29 23:39:11,877 INFO [-] =========================================================\r\n2015-06-29 23:39:11,878 INFO [-] ############## Registering actions ######################\r\n2015-06-29 23:39:11,884 INFO [-] =========================================================\r\n2015-06-29 23:39:15,451 INFO [-] Registered 58 actions.\r\n2015-06-29 23:39:15,452 INFO [-] =========================================================\r\n2015-06-29 23:39:15,452 INFO [-] ############## Registering rules ########################\r\n2015-06-29 23:39:15,453 INFO [-] =========================================================\r\n2015-06-29 23:39:15,474 ERROR [-] Failed registering rule from /opt/stackstorm/packs/hubot/rules/notify_hubot.yaml.\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/st2reactor/bootstrap/rulesregistrar.py\", line 105, in _register_rules_from_pack\r\n    rule_db = RuleAPI.to_model(rule_api)\r\n  File \"/usr/lib/python2.7/dist-packages/st2common/models/api/rule.py\", line 158, in to_model\r\n    trigger_db = TriggerService.create_trigger_db_from_rule(rule)\r\n  File \"/usr/lib/python2.7/dist-packages/st2common/services/triggers.py\", line 175, in create_trigger_db_from_rule\r\n    'triggertype. Cannot create trigger: %s.' % (trigger_dict))\r\nTriggerDoesNotExistException: A simple trigger should have been created when registering triggertype. Cannot create trigger: {'type': 'core.st2.generic.notifytr                  igger', 'parameters': {}, 'pack': 'core'}.\r\n2015-06-29 23:39:15,477 INFO [-] Registered 0 rules.\r\n2015-06-29 23:39:15,477 INFO [-] =========================================================\r\n2015-06-29 23:39:15,477 INFO [-] ############## Registering aliases ######################\r\n2015-06-29 23:39:15,477 INFO [-] =========================================================\r\n2015-06-29 23:39:15,594 INFO [-] Registered 13 aliases.\r\n2015-06-29 23:39:15,595 INFO [-] =========================================================\r\n2015-06-29 23:39:15,596 INFO [-] ############## Registering policy types #################\r\n2015-06-29 23:39:15,596 INFO [-] =========================================================\r\n2015-06-29 23:39:15,623 INFO [-] Registered 2 policy types.\r\n2015-06-29 23:39:15,625 INFO [-] =========================================================\r\n2015-06-29 23:39:15,625 INFO [-] ############## Registering policies #####################\r\n2015-06-29 23:39:15,626 INFO [-] =========================================================\r\n2015-06-29 23:39:15,626 INFO [-] Registered 0 policies.\r\n##### st2 components status #####\r\nst2actionrunner PID: 18843\r\nst2actionrunner PID: 18844\r\nst2actionrunner PID: 18845\r\nst2actionrunner PID: 18846\r\nst2actionrunner PID: 18847\r\nst2actionrunner PID: 18848\r\nst2actionrunner PID: 18849\r\nst2actionrunner PID: 18850\r\nst2actionrunner PID: 18851\r\nst2actionrunner PID: 18852\r\nst2api PID: 18854\r\nst2auth PID: 18853\r\nst2sensorcontainer PID: 23859\r\nst2rulesengine PID: 18858\r\nmistral PID: 18865\r\nmistral PID: 18907\r\nmistral PID: 18914\r\nst2web PID: 18871\r\nst2resultstracker PID: 18856\r\nst2notifier PID: 18857\r\n```\r\n\r\n#### for `st2_deploy.sh stable`:\r\n```\r\nst2 run packs.install packs=hubot\r\nst2ctl reload --register-all\r\nRegistering content...[flags = --register-all]\r\n2015-06-30 00:22:59,864 INFO [-] Connecting to database \"st2\" @ \"0.0.0.0:27017\" as user \"None\".\r\n2015-06-30 00:22:59,968 INFO [-] =========================================================\r\n2015-06-30 00:22:59,970 INFO [-] ############## Registering sensors ######################\r\n2015-06-30 00:22:59,971 INFO [-] =========================================================\r\n2015-06-30 00:23:00,356 INFO [-] Registered 1 sensors.\r\n2015-06-30 00:23:00,357 INFO [-] =========================================================\r\n2015-06-30 00:23:00,357 INFO [-] ############## Registering actions ######################\r\n2015-06-30 00:23:00,358 INFO [-] =========================================================\r\n2015-06-30 00:23:03,322 INFO [-] Registered 58 actions.\r\n2015-06-30 00:23:03,324 INFO [-] =========================================================\r\n2015-06-30 00:23:03,325 INFO [-] ############## Registering rules ########################\r\n2015-06-30 00:23:03,325 INFO [-] =========================================================\r\n2015-06-30 00:23:03,364 ERROR [-] Conflict while trying to save in DB.\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/st2common/persistence/base.py\", line 83, in add_or_update\r\n    model_object = cls._get_impl().add_or_update(model_object)\r\n  File \"/usr/lib/python2.7/dist-packages/st2common/models/db/__init__.py\", line 131, in add_or_update\r\n    instance.save()\r\n  File \"/usr/local/lib/python2.7/dist-packages/mongoengine/document.py\", line 286, in save\r\n    raise NotUniqueError(message % unicode(err))\r\nNotUniqueError: Tried to save duplicate unique keys (E11000 duplicate key error index: st2.rule_d_b.$name_1  dup key: { : \"chatops.notify_hubot\" })\r\n2015-06-30 00:23:03,368 ERROR [-] Failed to create rule chatops.notify_hubot.\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/st2reactor/bootstrap/rulesregistrar.py\", line 136, in _register_rules_from_pack\r\n    rule_db = Rule.add_or_update(rule_db)\r\n  File \"/usr/lib/python2.7/dist-packages/st2common/persistence/base.py\", line 90, in add_or_update\r\n    raise StackStormDBObjectConflictError(str(e), conflict_id)\r\nStackStormDBObjectConflictError: Tried to save duplicate unique keys (E11000 duplicate key error index: st2.rule_d_b.$name_1  dup key: { : \"chatops.notify_hubot\" })\r\n2015-06-30 00:23:03,370 INFO [-] Registered 2 rules.\r\n2015-06-30 00:23:03,370 INFO [-] =========================================================\r\n2015-06-30 00:23:03,370 INFO [-] ############## Registering aliases ######################\r\n2015-06-30 00:23:03,371 INFO [-] =========================================================\r\n2015-06-30 00:23:03,476 INFO [-] Registered 13 aliases.\r\n2015-06-30 00:23:03,476 INFO [-] =========================================================\r\n2015-06-30 00:23:03,477 INFO [-] ############## Registering policy types #################\r\n2015-06-30 00:23:03,478 INFO [-] =========================================================\r\n2015-06-30 00:23:03,503 INFO [-] Registered 2 policy types.\r\n2015-06-30 00:23:03,503 INFO [-] =========================================================\r\n2015-06-30 00:23:03,503 INFO [-] ############## Registering policies #####################\r\n2015-06-30 00:23:03,504 INFO [-] =========================================================\r\n2015-06-30 00:23:03,504 INFO [-] Registered 0 policies.\r\n##### st2 components status #####\r\nst2actionrunner PID: 19408\r\nst2actionrunner PID: 19409\r\nst2actionrunner PID: 19410\r\nst2actionrunner PID: 19411\r\nst2actionrunner PID: 19412\r\nst2actionrunner PID: 19413\r\nst2actionrunner PID: 19414\r\nst2actionrunner PID: 19415\r\nst2actionrunner PID: 19416\r\nst2actionrunner PID: 19417\r\nst2api PID: 19419\r\nst2auth PID: 19418\r\nst2sensorcontainer PID: 20655\r\nst2rulesengine PID: 19423\r\nmistral PID: 19430\r\nst2web PID: 19435\r\nst2resultstracker PID: 19421\r\nst2notifier PID: 19422\r\n```\r\n-----\r\n\r\nUsed this Vagrant to reproduce (hubot rule was absent):\r\nhttps://github.com/armab/showcase-ansible-chatops"},"comment":{"url":"https://api.github.com/repos/StackStorm/st2/issues/comments/117165258","html_url":"https://github.com/StackStorm/st2/issues/1671#issuecomment-117165258","issue_url":"https://api.github.com/repos/StackStorm/st2/issues/1671","id":117165258,"user":{"login":"Kami","id":125088,"avatar_url":"https://avatars.githubusercontent.com/u/125088?v=3","gravatar_id":"","url":"https://api.github.com/users/Kami","html_url":"https://github.com/Kami","followers_url":"https://api.github.com/users/Kami/followers","following_url":"https://api.github.com/users/Kami/following{/other_user}","gists_url":"https://api.github.com/users/Kami/gists{/gist_id}","starred_url":"https://api.github.com/users/Kami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kami/subscriptions","organizations_url":"https://api.github.com/users/Kami/orgs","repos_url":"https://api.github.com/users/Kami/repos","events_url":"https://api.github.com/users/Kami/events{/privacy}","received_events_url":"https://api.github.com/users/Kami/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T12:51:47Z","updated_at":"2015-06-30T12:51:47Z","body":"@armab It's hard to say without seeing the logs - you should check (and gist) the rules engine log to see what is going on."}}