linkedin / linkedin/iris

Invalid incident

Open
#654 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
845
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Hi All

I get the following error when testing a new group, from API post.

"title": "Invalid incident",
"description": "invalid role oncall-primary for target Z_JDGROUP"

The group has a primary user on standby.

JD
"

/opt/iris/src/iris/api.py
========================= This is the code where it fails =====
for dynamic_target in target_list:
target = session.execute('''SELECT target_role.id AS role_id, target.id AS target_id
FROM target JOIN target_role
ON target_role.type_id = target.type_id
WHERE target.name = :target
AND target_role.name = :role''', dynamic_target).fetchone()
if target is None:
raise HTTPBadRequest('Invalid incident', 'invalid role %s for target %s' %
(dynamic_target['role'], dynamic_target['target']))
else:
dynamic_targets.append(target)

I suspect there is a mismatch between OnCall and IRIS db, but cant prove it, (or don't know how to prove it)

Is there a DB schema ? Or can someone help me with a SQL query to check both OnCall and IRIS ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with /opt/iris/src/iris/api.py and reproduce the API POST for a new group that reports the invalid oncall-primary role. Inspect the target and target_role lookup, then compare the relevant OnCall and IRIS database schemas or records; done means the mismatch or failure cause and a way to verify it are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.