Cannot create a bug on Staging Launchpad if qabro was previously used to file a bug to Production Launchpad

Bug #1955088 reported by Pierre Equoy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bugit
New
Low
Unassigned

Bug Description

Summary
=======

In some cases, trying to create an issue on Staging Launchpad (`APPORT_LAUNCHPAD_INSTANCE=staging qabro`) fails with an error such as "XXX launchpad project not found".

This is not the right error (it's the one currently implemented when trying to retrieve the project on Launchpad[1]). The actual exception raised is the following (and that should probably be added to either the qabro.log file, either to the UI screen):

----------
HTTP Error 401: Unauthorized
Response headers:
---
content-length: 55
content-type: text/plain;charset=utf-8
date: Thu, 16 Dec 2021 09:05:17 GMT
server: gunicorn/19.8.1
status: 401
x-lazr-oopsid: OOPS-d28904b1b4a104810f4b151193167512
x-powered-by: Zope (www.zope.org), Python (www.python.org)
x-request-id: bb7be462-cc4e-47ae-9627-193730f0af2c
x-vcs-revision: 81e0895a331628041b6b472870508fda789d6973
---
Response body:
---
b'Unknown consumer (System-wide: Ubuntu Core (coltrane)).'
---
----------

Root cause
==========

Launchpad engineers said:

“Your tool passes credentials_file to Launchpad.login_with (https://git.launchpad.net/qabro/tree/qabro/bug_assistant.py#n59), and the path it uses for that doesn't take the Launchpad instance into account.

So if you've used this tool previously with production, then you're probably sending production credentials to staging, which it doesn't recognize.

You should probably make the credentials file path instance-sensitive in some way.”

Workaround
==========

$ snap run --shell qabro
(inside the snap) $ rm ~/.launchpadlib/qabro
(inside the snap) $ exit

Then you should be able to file a bug in any instance.

[1] https://git.launchpad.net/qabro/tree/qabro/bug_assistant.py?h=v0.16&id=1ee375bcc61ee84de65e875b4503d5a9503dceab#n94

Tags: easy
Pierre Equoy (pieq)
tags: added: easy
Changed in qabro:
importance: Undecided → Low
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.