Project

General

Profile

Actions

action #97955

closed

[openqabot] Possible TypeError during execution "'NoneType' object is not subscriptable"

Added by jbaier_cz over 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
Start date:
2021-09-02
Due date:
% Done:

0%

Estimated time:

Description

Observation

An error during qa-maintenance/openQABot execution, possible a bad data from SMELT API.

Failed job: https://gitlab.suse.de/qa-maintenance/openQABot/-/jobs/556824

$ /usr/bin/oqaqambot --verbose $BOT_PARAMS 2>&1 | tee openqabot.log
Traceback (most recent call last):
  File "/usr/bin/oqaqambot", line 11, in <module>
    load_entry_point('openQABot==0.3.0', 'console_scripts', 'oqaqambot')()
  File "/usr/lib/python3.6/site-packages/openqabot/main.py", line 18, in main
    sys.exit(run_bot(logger, args, sys))
  File "/usr/lib/python3.6/site-packages/openqabot/main.py", line 41, in run_bot
    return OpenQABot(metadata, args)()
  File "/usr/lib/python3.6/site-packages/openqabot/openqabot.py", line 88, in __init__
    self.mrs = MR(args.smelt, args.base_url, args.commenter)()
  File "/usr/lib/python3.6/site-packages/openqabot/update/mr.py", line 23, in __call__
    return self._get_mr_data()
  File "/usr/lib/python3.6/site-packages/openqabot/update/mr.py", line 137, in _get_mr_data
    ids = self._get_mr_ids()
  File "/usr/lib/python3.6/site-packages/openqabot/update/mr.py", line 93, in _get_mr_ids
    for x in ndata["data"]["requests"]["edges"]
TypeError: 'NoneType' object is not subscriptable

Suggestions

  • Explore GraphQL query in update/mr.py
  • Improve error reporting to include reference to invalid incident
  • Handle missing data gracefully

Related issues 3 (0 open3 closed)

Related to openQA Infrastructure - action #115733: bot-ng pipeline fails because of empty dictionary in data returned by smelt size:MResolvedjbaier_cz2022-05-23

Actions
Related to QA - action #121846: openQABot - ´┐╝schedule:openqabot pipeline fails on GitLab size:SResolvedjbaier_cz2022-12-27

Actions
Has duplicate QA - action #99489: qa-maintenance/openQABot CI job fails on `TypeError: 'NoneType' object is not subscriptable`Rejectedokurz2021-09-29

Actions
Actions #1

Updated by osukup over 2 years ago

its problem response from smelt api..

--> needs better exception/error handling in mr.py

Actions #2

Updated by jbaier_cz about 2 years ago

  • Has duplicate action #99489: qa-maintenance/openQABot CI job fails on `TypeError: 'NoneType' object is not subscriptable` added
Actions #3

Updated by livdywan about 2 years ago

Happened again just now: https://gitlab.suse.de/qa-maintenance/openQABot/-/jobs/618086

  File "/usr/lib/python3.6/site-packages/openqabot/update/mr.py", line 126, in <listcomp>
156    and "MAINTENANCE_REQUEST" in r["requestactionSet"][0]["srcProject"]["name"]
157TypeError: 'NoneType' object is not subscriptable
Actions #4

Updated by okurz about 2 years ago

  • Subject changed from [openqabot] Possible TypeError during execution to [openqabot] Possible TypeError during execution "'NoneType' object is not subscriptable"
  • Priority changed from Low to High
  • Target version changed from future to Ready
Actions #5

Updated by jbaier_cz about 2 years ago

  • Status changed from New to In Progress

Made a quick PR to increase verbosity for the "bad" responses: https://gitlab.suse.de/qa-maintenance/openQABot/-/merge_requests/80

Actions #6

Updated by jbaier_cz about 2 years ago

  • Status changed from In Progress to Resolved

At current set of incidents:

commit befe4d76 (before fix):

$ ./oqabot.py --dry --only-mr -c ../metadata/bot/mr.yml
...
  File "/home/jbaier/Projects/openQABot/openqabot/update/mr.py", line 129, in <listcomp>
    and "MAINTENANCE_REQUEST" in r["requestactionSet"][0]["srcProject"]["name"]
TypeError: 'NoneType' object is not subscriptable

commit 4ad00ad4 (all fixes included)

$ ./oqabot.py --dry --only-mr -c ../metadata/bot/mr.yml

So the bugfix is validated and working (at least for this instance).

Actions #7

Updated by livdywan about 2 years ago

  • Assignee set to jbaier_cz
Actions #8

Updated by jbaier_cz over 1 year ago

  • Related to action #115733: bot-ng pipeline fails because of empty dictionary in data returned by smelt size:M added
Actions #9

Updated by jbaier_cz 12 months ago

  • Related to action #121846: openQABot - ´┐╝schedule:openqabot pipeline fails on GitLab size:S added
Actions

Also available in: Atom PDF