linkedin / iris

Iris is a highly configurable and flexible service for paging and messaging.
http://iris.claims
BSD 2-Clause "Simplified" License
809 stars 139 forks source link

iris Plan issue #644

Closed allwyn-pradip closed 2 years ago

allwyn-pradip commented 3 years ago

with the new images, new or existing plans do not get saved.

the error pops up as

Error: Invalid plan - Priority not found for step 1

even when the priority are setup

image

allwyn-pradip commented 2 years ago

@diegocepedaw any update what is causing this issue.

diegocepedaw commented 2 years ago

@allwyn-pradip unfortunately I have not had much bandwidth recently to look at community issues lately. Do you remember which release version this issue was introduced in? I haven't encountered this issue myself, can you give me more details on your current Iris setup as well?

allwyn-pradip commented 2 years ago

@diegocepedaw I am at the latest version 1.36 testing it for python3

image

diegocepedaw commented 2 years ago

@allwyn-pradip what do you get if you run SELECT name, id FROM target_type in your mysql? That error you linked means Iris didn't find the type user in its cache, and the cache should be pulling the types from the database.

mohammad-sajid commented 2 years ago

@diegocepedaw the output for the query is fine. MySQL [iris]> SELECT name, id FROM target_type; +--------------+----+ | name | id | +--------------+----+ | mailing-list | 3 | | team | 2 | | user | 1 | +--------------+----+

Also facing the issue Error: Invalid plan - Target NOC-Team not found for step 1. But we have this team created at oncall DB. what will be the reason, why its not taking the team names from oncall DB. ?

image

diegocepedaw commented 2 years ago

Is the sync targets script running and correctly able to git oncall-api?

mohammad-sajid commented 2 years ago

@diegocepedaw what is the sync target script? where can I find that oncall-api ? could you please help here.

mohammad-sajid commented 2 years ago

@diegocepedaw i saw there is one sync_target.py code is available in srs/iris/bin. executed manually and getting below error. could you please help here.

2022-02-08 11:26:10,489 ERROR root Error syncing from oncall! Traceback (most recent call last): File "sync_targets.py", line 786, in main sync_from_oncall(config, engine) File "sync_targets.py", line 174, in sync_from_oncall oncall_users = fetch_users_from_oncall(oncall) File "sync_targets.py", line 157, in fetch_users_from_oncall return {user['name']: fix_user_contacts(user['contacts']) File "sync_targets.py", line 157, in return {user['name']: fix_user_contacts(user['contacts']) File "sync_targets.py", line 145, in fix_user_contacts contacts['sms'] = normalize_phone_number(sms) File "sync_targets.py", line 77, in normalize_phone_number return format_number(parse(num, 'US'), File "/usr/local/lib/python3.8/dist-packages/phonenumbers/phonenumberutil.py", line 2579, in parse raise NumberParseException(NumberParseException.NOT_A_NUMBER, phonenumbers.phonenumberutil.NumberParseException: (1) The string supplied did not seem to be a phone number.

diegocepedaw commented 2 years ago

@mohammad-sajid the sync_targets.py script is what syncs teams and users from oncall-api, you will need this running if you want to automatically have oncal-api teams become available as targets in Iris. If you are running it locally with the make file you should be able to run make targets. Looking out your output it seems that the contact field of the users that are coming from oncall-api do not have valid phone numbers for 'sms' and/or 'call' fields in their contact. I would recommend checking that all your oncall users have validly formatted phone numbers.

mohammad-sajid commented 2 years ago

Thanks, @diegocepedaw . after verifying user_contact table now am able to sync between the iris and oncall app.

Thanks for your support @diegocepedaw

bla-ckbox commented 2 years ago

I still encounter the issues discussed above when testing with the master branch commit Version https://github.com/linkedin/iris/commit/500822ac5d757884246c95145d6a89531c503f81

_synctargets.py seems to be running fine:

2022-04-05 16:12:44,234 INFO root Sending metrics: failed_tasks: 0, ldap_lists_added: 0, ldap_lists_failed_to_add: 0, ldap_lists_found: 0, ldap_lists_removed: 0, ldap_memberships_added: 0, ldap_memberships_failed_to_add: 0, ldap_memberships_found: 0, ldap_memberships_removed: 0, ldap_reconnects: 0, others_purged: 0, sql_errors: 0, teams_added: 0, teams_failed_to_add: 0, teams_found: 0, user_contacts_updated: 0, users_added: 0, users_failed_to_add: 0, users_failed_to_update: 0, users_found: 0, users_purged: 0
2022-04-05 16:12:44,234 INFO root Starting oncall sync...
2022-04-05 16:12:44,441 INFO root Users to insert (0)
2022-04-05 16:12:44,441 INFO root Users to update (5)
2022-04-05 16:12:44,447 INFO root Teams to insert (0)
2022-04-05 16:12:44,450 INFO root Users to mark inactive (0)
2022-04-05 16:12:44,450 INFO root Teams to mark inactive (0)
2022-04-05 16:12:44,451 INFO root oncall sync took 0.22 seconds

_targettype, target, and priority are not empty

mysql> select * from target_type;
+----+--------------+
| id | name         |
+----+--------------+
|  3 | mailing-list |
|  2 | team         |
|  1 | user         |
+----+--------------+
3 rows in set (0.00 sec)

mysql> select * from target;
+----+--------------------------------------+---------+--------+
| id | name                                 | type_id | active |
+----+--------------------------------------+---------+--------+
|  1 | demo                                 |       1 |      0 |
|  4 | b291694f-7789-4436-a5d2-ca37f67b3df3 |       2 |      0 |
|  5 | 8558d07b-b5ae-44c3-b3c0-6f4179e79402 |       2 |      0 |
|  6 | abc                                  |       3 |      1 |
|  7 | demo                                 |       3 |      1 |
|  8 | jp******                             |       1 |      1 |
|  9 | bn*****                              |       1 |      1 |
| 10 | bl******                             |       1 |      1 |
| 11 | cb******                             |       1 |      1 |
| 12 | pr*****                              |       1 |      1 |
| 13 | Di******                             |       2 |      1 |
| 14 | On****                               |       2 |      1 |
+----+--------------------------------------+---------+--------+
12 rows in set (0.00 sec)

mysql> select * from priority;
+----+--------+---------+
| id | name   | mode_id |
+----+--------+---------+
|  8 | urgent |      26 |
| 17 | high   |       8 |
| 26 | medium |      35 |
| 35 | low    |      35 |
+----+--------+---------+
4 rows in set (0.00 sec)
bilbof commented 2 years ago

I have also hit the same issue.

Steps to reproduce:

  1. Spin up a test instance docker compose up
  2. Login demo:demo at http://localhost:16649
  3. Navigate to http://localhost:16649/plans/new and attempt to create a plan

@allwyn-pradip mentioned that this issue is fixed by https://github.com/linkedin/iris/pull/690. I ran those changes locally and found that the issue was fixed, but haven't yet figured out what particular change resolved the bug.

Edit: turns out it was gevent's monkey patching!