Project

General

Profile

action #97955

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

Added by jbaier_cz 3 months ago. Updated about 2 months 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

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

History

#1 Updated by osukup 3 months ago

its problem response from smelt api..

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

#2 Updated by jbaier_cz 2 months ago

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

#3 Updated by cdywan 2 months 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

#4 Updated by okurz 2 months 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

#5 Updated by jbaier_cz about 2 months 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

#6 Updated by jbaier_cz about 2 months 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).

#7 Updated by cdywan about 2 months ago

  • Assignee set to jbaier_cz

Also available in: Atom PDF