Project

General

Profile

action #102200

openqa-review pipeline failed: 'NoneType' object is not subscriptable, or failed with `assert self.issue_type == "bugzilla"` size:M

Added by tinita 3 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
Start date:
2021-11-10
Due date:
2021-11-25
% Done:

0%

Estimated time:

Description

Observation

https://gitlab.suse.de/openqa/openqa-review/-/jobs/684699

.
ERROR:openqa_review.openqa_review:Error retrieving details for bugref bsc#1174164 (https://bugzilla.suse.com/show_bug.cgi?id=1174164): 'NoneType' object is not subscriptable
.
.
.
.
.
.
.
ERROR:openqa_review.openqa_review:Error retrieving details for bugref boo#1183044 (https://bugzilla.opensuse.org/show_bug.cgi?id=1183044): 'NoneType' object is not subscriptable
.
ERROR:openqa_review.openqa_review:Error retrieving details for bugref boo#1185952 (https://bugzilla.opensuse.org/show_bug.cgi?id=1185952): 'NoneType' object is not subscriptable
ERROR:openqa_review.openqa_review:Error retrieving details for bugref bsc#1190740 (https://bugzilla.suse.com/show_bug.cgi?id=1190740): 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/bin/openqa-review", line 33, in <module>
    sys.exit(load_entry_point('openqa-review==0.0.0', 'console_scripts', 'openqa-review')())
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 1575, in main
    reminder_comment_on_issues(report)
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 1558, in reminder_comment_on_issues
    reminder_comment_on_issue(ie, min_days_unchanged)
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 1536, in reminder_comment_on_issue
    (last_comment_date, last_comment_text) = issue.last_comment
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 780, in last_comment
    assert self.issue_type == "bugzilla"
AssertionError

Acceptance criteria

  • AC1: Pipeline succeeds without python exceptions
  • AC2: Report results only contain expected messages

Maybe related to #101722 ? https://github.com/os-autoinst/openqa_review/pull/190


Related issues

Related to QA - action #101722: openqa-review: Do not post reminder comment in progress.opensuse.org if comment would be exactly the same as the last size:MResolved2021-10-14

Related to openQA Project - action #102440: openqa-review pipeline failed with assert self.issue_type == "bugzilla"Resolved2021-07-282021-11-30

Related to QA - action #102350: Move openqa-review CI to Github ActionsResolved2021-11-102021-11-25

History

#1 Updated by okurz 3 months ago

  • Related to action #101722: openqa-review: Do not post reminder comment in progress.opensuse.org if comment would be exactly the same as the last size:M added

#2 Updated by tinita 3 months ago

  • Status changed from New to In Progress
  • Assignee set to tinita

I found out that the 'NoneType' object is not subscriptable messages also turned up yesterday already https://gitlab.suse.de/openqa/openqa-review/-/jobs/682815 when the changes for #101722 weren't active yet, but they are not fatal.
I thought that we didn't output non-fatal stuff as errors anymore.
Anyway, the real error is the one with the Traceback, but the ERROR messages also seem suspicious.

#3 Updated by cdywan 3 months ago

  • Subject changed from openqa-review pipeline failed: 'NoneType' object is not subscriptable to openqa-review pipeline failed: 'NoneType' object is not subscriptable size:M
  • Description updated (diff)

#4 Updated by openqa_review 3 months ago

  • Due date set to 2021-11-25

Setting due date based on mean cycle time of SUSE QE Tools

#5 Updated by tinita 3 months ago

So far I can't reproduce it locally.

PR https://github.com/os-autoinst/openqa_review/pull/193 for better logging (traceback of the TypeError) merged

I found out this started on November 5th. I looked into October 29th until today.

#6 Updated by tinita 3 months ago

With traceback:

RROR:openqa_review.openqa_review:Error retrieving details for bugref boo#1041112 (https://bugzilla.opensuse.org/show_bug.cgi?id=1041112): 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 694, in __init__
    self._init_bugzilla(bugzilla_browser)
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 734, in _init_bugzilla
    self.json = bugzilla_browser.json_rpc_get("/jsonrpc.cgi", "Bug.get", {"ids": [self.bugid]})["result"]["bugs"][0]
TypeError: 'NoneType' object is not subscriptable
.
ERROR:openqa_review.openqa_review:Error retrieving details for bugref bsc#1185342 (https://bugzilla.suse.com/show_bug.cgi?id=1185342): 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 694, in __init__
    self._init_bugzilla(bugzilla_browser)
  File "/usr/lib/python3.8/site-packages/openqa_review/openqa_review.py", line 734, in _init_bugzilla
    self.json = bugzilla_browser.json_rpc_get("/jsonrpc.cgi", "Bug.get", {"ids": [self.bugid]})["result"]["bugs"][0]
TypeError: 'NoneType' object is not subscriptable

I already suspected this line. But when I retrieve the json locally, it looks ok.

https://gitlab.suse.de/openqa/openqa-review/-/jobs/687252

#7 Updated by tinita 3 months ago

A little more debugging brought me to this JSON response:

{'\''error'\'': {'\''message'\'': '\''The username or password you entered is not valid.'\'', '\''code'\'': 300}, '\''id'\'': '\''https://bugzilla.suse.com/'\'', '\''result'\'': None}

It wasn't detected as a HTTP error because bugzilla sends a 200 OK in these cases :-/

So it seems the password was expired, and I changed it now, and set the new secret in the gitlab vars.

I will change the code, so that it checks for an error field in the JSON response.

#8 Updated by tinita 3 months ago

Changing the password didn't help.

I wonder why I can login with that, but don't make a jsonrpc request.

It works with my personal user account.

% curl https://user:pass@apibugzilla.suse.com/jsonrpc.cgi?method=Bug.get&params=%5B%7B%22ids%22%3A+%5B1191745%5D%7D%5D"
{"error":{"message":"The username or password you entered is not valid.","code":300},"id":"https://bugzilla.suse.com/","result":null}

#9 Updated by tinita 3 months ago

I set the password now to something completely different (instead of just changing the suffix which I thought was problematic due to gitlab expansion).
Now I can do a successful curl request (see last comment), but it still doesn't work from my gitlab (fork) pipeline.

Anyway, I changed the secret also in the original repo, and we will see tomorrow what happens. Meanwhile working on the code.

#11 Updated by tinita 3 months ago

PR: https://github.com/os-autoinst/openqa_review/pull/195

tox -e cov, black and flake8 is successful for me locally.

Travis CI doesn't run on the PR because we used all credits this months already. Time to switch.

#12 Updated by tinita 3 months ago

  • Copied to action #102350: Move openqa-review CI to Github Actions added

#13 Updated by tinita 3 months ago

  • Copied to deleted (action #102350: Move openqa-review CI to Github Actions)

#14 Updated by tinita 3 months ago

  • Blocked by action #102350: Move openqa-review CI to Github Actions added

#15 Updated by tinita 3 months ago

  • Status changed from In Progress to Blocked

#16 Updated by okurz 2 months ago

  • Status changed from Blocked to In Progress

As https://github.com/os-autoinst/openqa_review/pull/195 could complete tests on travis CI I don't consider this blocked.

#17 Updated by okurz 2 months ago

  • Subject changed from openqa-review pipeline failed: 'NoneType' object is not subscriptable size:M to openqa-review pipeline failed: 'NoneType' object is not subscriptable, or failed with `assert self.issue_type == "bugzilla"` size:M

Added detail from likely duplicate #102440

#18 Updated by okurz 2 months ago

  • Related to action #102440: openqa-review pipeline failed with assert self.issue_type == "bugzilla" added

#19 Updated by mkittler 2 months ago

Looks like only the 'NoneType' object is not subscriptable part was fixed by https://github.com/os-autoinst/openqa_review/pull/195. So I've been creating a PR to fix the assertion (see #102440#note-5).

#20 Updated by okurz 2 months ago

  • Blocked by deleted (action #102350: Move openqa-review CI to Github Actions)

#21 Updated by okurz 2 months ago

  • Related to action #102350: Move openqa-review CI to Github Actions added

#22 Updated by tinita 2 months ago

I attempted to fix the AssertionError as part of #101722 with https://github.com/os-autoinst/openqa_review/pull/192
But apparently I did not catch all cases.

Sorry I didn't mention this here.

#23 Updated by tinita 2 months ago

  • Status changed from In Progress to Resolved

This was actually resolved (partially by mkittler)

Also available in: Atom PDF