← Back to issue list

Can't login in headless multipass VM with 24.04

View original Github issue

Metadata

Project
charmcraft
Number
#2336
Type
issue
State
open
Author
kimwnasptd
Labels
Created
Updated
Closed

Current evaluation

charmcraft login crashes in headless Multipass VMs (Ubuntu 24.04) because the keyring library falls back to the null keyring, so credentials can't be stored. Reporter self-diagnosed the gap in craft-store auth.py and shared a PYTHON_KEYRING_BACKEND workaround; no maintainer has responded.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and no maintainer response in 441 days, so it is untriaged. However, the reporter's own analysis is concrete and verified against current code: craft-store's Auth only special-cases keyring.backends.fail.Keyring (auth.py line ~204) and raises NoKeyringError, while a headless VM selects keyring.backends.null.Keyring, which is silently accepted and then fails on retrieval with CredentialsUnavailable. A prior similar report (canonical/charmcraft#672) was closed as intended behavior, so a maintainer decision is needed on whether to extend the file-keyring fallback to the null backend or improve the error message.

Impact: 50 Quick Win: 27.5 Staleness: 70 Complexity: 45 Confidence: 65 Support Request: 25

Issue body

### Bug Description I can't seem to login with `charmcraft login` when I'm inside a headless 24.04 VM created with Multipass. ### To Reproduce ```bash # create the VM multipass launch 24.04 --name test --memory 4G --disk 5G --cpus 1 multipass shell test # inside the VM charcraft login # I go to the browser and login, and then it crashes # charmcraft internal error: CredentialsUnavailable("No credentials found for 'charmcraft' on 'api.charmhub.io'.") ``` ### Environment Headless VM with Ubuntu 24.04 and using the default channel of charmcraft ### charmcraft.yaml ```yaml <none> ``` ### Relevant log output ```shell # from the produced log file 2025-04-30 10:53:40.188 HTTP 'POST' for 'https://api.charmhub.io/v1/tokens/exchange' with params None and headers {'Macaroons': '<macaroon>', 'User-Agent': 'Charmcraft/3.4.3 (Linux 6.8.0-58-generic; x86_64; CPython 3.10.12; Ubuntu 24.04)'} 2025-04-30 10:53:40.288 Storing credentials for 'charmcraft' on 'api.charmhub.io' in keyring 'null Keyring'. 2025-04-30 10:53:40.288 Retrieving credentials for 'charmcraft' on 'api.charmhub.io' from keyring 'null Keyring'. 2025-04-30 10:53:40.288 Credentials not found in the keyring 'null Keyring' 2025-04-30 10:53:40.289 charmcraft internal error: CredentialsUnavailable("No credentials found for 'charmcraft' on 'api.charmhub.io'.") ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 50
Quick Win: 27.5
Staleness: 70
Complexity: 45
Confidence: 65
Support Request: 25
needs triage charmcraft login crashes in headless Multipass VMs (Ubuntu 24.04) because the keyring library falls back to the null keyring, so credentials can't be stored. Reporter self-diagnosed the gap in craft-store auth.py and shared a PYTHON_KEYRING_BACKEND workaround; no maintainer has responded.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 30
Confidence: 80
Support Request: 10
close stale Login fails in headless Ubuntu 24.04 VM due to keyring backend falling back to null. Author identified root cause in craft-store and provided a workaround.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 50
Confidence: 85
Support Request: 20
needs triage charmcraft login fails in headless Ubuntu 24.04 VMs because keyring defaults to null Keyring, blocking credential storage. Author identified the root cause in craft-store and provided a workaround. Awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 30
Confidence: 85
Support Request: 10
close stale Bug where charmcraft login fails in headless Ubuntu 24.04 VMs due to keyring returning a null backend. Author provided a workaround and identified the root cause in an external dependency. Issue is over a year old with no maintainer engagement.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 45
Confidence: 80
Support Request: 20
needs triage charmcraft login fails in headless Ubuntu 24.04 VMs because keyring defaults to null Keyring, raising CredentialsUnavailable. Author pinpointed the craft-store fallback logic gap and provided a workaround. Open, pending triage and fix.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#672 (confidence 70%)

    Same headless/no-keyring login failure, closed as intended behavior with advice to use environment-variable credentials; relevant precedent but does not fix the null-keyring crash path.

Related issues

Issue Project State Summary Similarity
#672 charmcraft 1.4.0: impossible to login to charmhub charmcraft closed Closed as expected behavior. Charmcraft falls back to a non-persistent memory ring on headless systems lacking a keyring, preventing credential persistence. Maintainers advised exporting credentials via environment variables instead of implementing a code fix.
74%