← 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

Open Charmcraft login failure on headless Ubuntu 24.04 Multipass VMs: Python selects keyring.backends.null.Keyring, so credentials cannot be retrieved; only a backend override is known.

Suggested action: needs triage

Reason: The exact Multipass commands, credential trace, null-backend probe, and working PYTHON_KEYRING_BACKEND workaround provide a strong reproduction, but all three comments are reporter-authored and there are no labels or maintainer response. Charmcraft currently falls back only when craft-store raises NoKeyringError; craft-store treats the fail backend as unavailable but does not handle the null backend, and no resolving change was found.

Evaluated by: mr-cal-bot

Impact: 54 Quick Win: 28 Complexity: 42 Confidence: 94 Actionability: 88

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
stealth/space-bunny-alpha
Impact: 54
Quick Win: 28
Complexity: 42
Confidence: 94
Actionability: 88
needs triage Open Charmcraft login failure on headless Ubuntu 24.04 Multipass VMs: Python selects keyring.backends.null.Keyring, so credentials cannot be retrieved; only a backend override is known.
~deepseek/deepseek-pro-latest
Impact: 50
Quick Win: 24
Complexity: 40
Confidence: 75
Actionability: 80
needs triage charmcraft login fails in headless 24.04 multipass VM: keyring selects null Keyring, and craft-store only falls back to file keyring for fail.Keyring, not null.Keyring. Reporter provided root cause and workaround; no maintainer response yet.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 14
Complexity: 40
Confidence: 80
Actionability: 80
keep open charmcraft login fails on headless Ubuntu 24.04 VMs due to craft-store not handling the null keyring backend for credential storage.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 28
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.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-store#236 (confidence 95%)

    Added opt-in FileKeyring fallback, but the null backend remains outside that detection and Charmcraft does not enable file_fallback.

  • Related To: canonical/charmcraft#1741 (confidence 90%)

    Added ephemeral fallback for NoKeyringError; it is bypassed because the null backend does not raise that error.

Related issues

Issue Project State Summary Similarity
#672 charmcraft 1.4.0: impossible to login to charmhub charmcraft closed Closed as intended behavior: the headless remote host had no local keyring, so Charmcraft could not persist credentials; exporting credentials was the supported workaround.
71%