← Back to issue list

Confusing output from `charmcraft login`

View original Github issue

Metadata

Project
charmcraft
Number
#810
Type
issue
State
closed
Author
mthaddon
Labels
—
Created
Updated
Closed

Current evaluation

Superseded by #833 and resolved by merged PR #916, which clarified that stored credentials may be invalid and advised users to log out before logging in again.

Resolution: closed superseded

Reason: The maintainer opened #833 to track improved handling for the double-login case and closed #810 as superseded. PR #916 later merged that work and added a clear explanation and logout resolution.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When packing and uploading a charm just now I got some very confusing output: ``` mthaddon@tenaya:~/repos/jenkins-charm/jenkins-charm$ charmcraft pack Packing the charm Created 'jenkins_ubuntu-16.04-amd64_ubuntu-18.04-amd64_ubuntu-20.04-amd64.charm'. Charms packed: jenkins_ubuntu-16.04-amd64_ubuntu-18.04-amd64_ubuntu-20.04-amd64.charm mthaddon@tenaya:~/repos/jenkins-charm/jenkins-charm$ charmcraft login craft-store error: Credentials found for 'charmcraft' on 'api.charmhub.io'. Full execution log: '/home/mthaddon/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220722-082942.042997.log' mthaddon@tenaya:~/repos/jenkins-charm/jenkins-charm$ echo $? 1 mthaddon@tenaya:~/repos/jenkins-charm/jenkins-charm$ charmcraft upload jenkins_ubuntu-16.04-amd64_ubuntu-18.04-amd64_ubuntu-20.04-amd64.charm Existing credentials no longer valid. Trying to log in... \ (5.3s) O pening an authorization web page in your browser. If it does not open, please open this URL: https://api.jujucharms.com/identity/login?did=REDACTED Revision 39 of 'jenkins' created mthaddon@tenaya:~/repos/jenkins-charm/jenkins-charm$ ``` Why did `charmcraft login` fail saying `credentials found` but then I still had to login? The execution log is as follows: ``` 2022-07-22 08:29:42.043 Starting charmcraft version 1.7.1 2022-07-22 08:29:42.043 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'trace': False, 'project_dir': None} filtered=['login'] 2022-07-22 08:29:42.043 General parsed sysargs: command='login' args=[] 2022-07-22 08:29:42.047 Command parsed sysargs: Namespace(bundle=None, channel=None, charm=None, export=None, permission=None, ttl=None) 2022-07-22 08:29:42.047 System details: OSPlatform(system='ubuntu', release='20.04', machine='x86_64'); Environment: DESKTOP_SESSION='ubuntu', XDG_CURRENT_DESKTOP='ubuntu:GNOME' 2022-07-22 08:29:42.237 craft-store error: Credentials found for 'charmcraft' on 'api.charmhub.io'. 2022-07-22 08:29:42.237 Full execution log: '/home/mthaddon/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220722-082942.042997.log' ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Superseded by #833 and resolved by merged PR #916, which clarified that stored credentials may be invalid and advised users to log out before logging in again.
stealth/space-bunny-alpha — closed superseded Superseded by charmcraft#833; the double-login error was clarified in merged PR #916 via commit 3b54c459.
stealth/space-bunny-alpha — closed superseded Closed as superseded by #833; merged PR #916 (commit 5e656275) later clarified the double-login error and advised users to log out first.
qwen3.6-35b-a3b-mtp-q6 — — Reported confusing charmcraft login error when credentials already exist. Team agreed to improve messaging to prompt users to logout first. Issue closed and superseded by tracking issue #833 to implement the fix.
qwen/qwen3.6-35b-a3b — — Closed and superseded by tracking issue #833. The confusing charmcraft login error regarding existing but potentially invalid credentials will be addressed by improving the error message and suggesting a logout resolution in the new ticket.
qwen3.6-35b-a3b-mtp-q6 — — Closed and superseded by issue #833. The confusing charmcraft login error message was not fixed here. Maintainers will track the error handling improvement separately.

Update history

No update history recorded yet.

Related work

  • Superseded By: canonical/charmcraft#833 (confidence 100%)

    The maintainer explicitly opened this tracking issue before closing #810.

  • Likely Fixed By: canonical/charmcraft#916 (confidence 100%)

    Merged PR implementing the clearer double-login error and logout guidance tracked by #833.

Related issues

Issue Project State Summary Similarity
#759 charmcraft login produces an error charmcraft closed Closed as superseded by #833, which improved the double-login error and recommended `charmcraft logout`; the follow-up was resolved by merged PR #916.
81%
#725 craft-store error when using `charmcraft login` command charmcraft closed Confusing craft-store "Credentials found" error on `charmcraft login` (double login). Closed by facundobatista as tracked in the more specific #833, whose improved error landed via PR #916.
74%
#916 (charmhub) Provide a better error to the user on a login attempt when already having credentials (CRAFT-1269) charmcraft merged Merged PR #916 in commit 3b54c459, improving the double-login error to explain that stored credentials may be invalid and recommend logging out; fixes #833.
73%
#844 Cannot use charmcraft login charmcraft closed Login failed over SSH ('Prompt dismissed'). Maintainer closed it pointing to Charmhub discourse instructions for authenticating in remote environments; no code change.
71%