← Back to issue list

WSL2: Cannot use `$SNAPCRAFT_STORE_CREDENTIALS` for login

View original Github issue

Metadata

Project
snapcraft
Number
#5000
Type
issue
State
closed
Author
JGCarroll
Labels
Created
Updated
Closed

Current evaluation

Closed by author after system updates resolved the SNAPCRAFT_STORE_CREDENTIALS login failure in WSL2. No code changes were applied; the issue was fixed externally by environment updates.

Suggested action:

No scores available.

Issue body

### Bug Description WSL2 doesn't run with a proper desktop session and must authenticate with the `SNAPCRAFT_STORE_CREDENTIALS` environment variable. This has traditionally worked for years. Having tried recently, this no longer works, Snapcraft will unconditionally complain about lack of system keyring and refuse to consider the environment variable. ### To Reproduce * Install WSL2, Snapcraft snap * Export login-token (`snapcraft export-login $fileName`), export it into the environment variable, and try perform a server-authenticated action. ``` james@James-Desktop:~/pinta-snap$ export SNAPCRAFT_STORE_CREDENTIALS=$(cat ../token) james@James-Desktop:~/pinta-snap$ snapcraft upload pinta_2.1.2_amd64.snap --release=stable snapcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.') ``` ### Environment ``` james@James-Desktop:~/pinta-snap$ snapcraft version snapcraft 8.3.2 james@James-Desktop:~/pinta-snap$ snap version snap 2.63+22.04ubuntu0.1 snapd unavailable series 16 Windows Subsystem for Linux - kernel 5.15.153.1-microsoft-standard-WSL2 (amd64) ``` Windows environment: Fully updated Windows 11 22H2 (latest GA release) ### snapcraft.yaml ```shell N/A ``` ### Relevant log output ```shell 2024-08-23 20:06:17.990 Starting snapcraft, version 8.3.2 2024-08-23 20:06:17.990 Log verbosity level set to BRIEF 2024-08-23 20:06:17.990 Configuring application... 2024-08-23 20:06:17.990 Preparing application... 2024-08-23 20:06:17.990 Build plan: platform=None, build_for=None 2024-08-23 20:06:17.991 Running snapcraft upload on host 2024-08-23 20:06:18.013 snapcraft internal error: NoKeyringError('No keyring found to store or retrieve credentials from.') 2024-08-23 20:06:18.015 Traceback (most recent call last): 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/craft_application/application.py", line 530, in run 2024-08-23 20:06:18.015 return_code = dispatcher.run() or 0 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run 2024-08-23 20:06:18.015 return self._loaded_command.run(self._parsed_command_args) 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/snapcraft/commands/upload.py", line 114, in run 2024-08-23 20:06:18.015 client = store.StoreClientCLI() 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/snapcraft/store/client.py", line 179, in __init__ 2024-08-23 20:06:18.015 self.store_client = get_client(ephemeral=ephemeral) 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/snapcraft/store/client.py", line 161, in get_client 2024-08-23 20:06:18.015 client = craft_store.UbuntuOneStoreClient( 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/craft_store/ubuntu_one_store_client.py", line 47, in __init__ 2024-08-23 20:06:18.015 super().__init__( 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/craft_store/base_client.py", line 77, in __init__ 2024-08-23 20:06:18.015 self._auth = Auth( 2024-08-23 20:06:18.015 File "/snap/snapcraft/12378/lib/python3.10/site-packages/craft_store/auth.py", line 201, in __init__ 2024-08-23 20:06:18.015 raise errors.NoKeyringError 2024-08-23 20:06:18.015 craft_store.errors.NoKeyringError: No keyring found to store or retrieve credentials from. 2024-08-23 20:06:18.015 Full execution log: '/home/james/.local/state/snapcraft/log/snapcraft-20240823-200617.989721.log' ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Closed by author after system updates resolved the SNAPCRAFT_STORE_CREDENTIALS login failure in WSL2. No code changes were applied; the issue was fixed externally by environment updates.
qwen/qwen3.6-35b-a3b Closed by author after Windows, WSL, Ubuntu, Snap, and Snapcraft updates resolved the WSL2 keyring error. No code changes were required; the environment variable authentication began working again following system updates.
qwen/qwen3.6-35b-a3b Closed as fixed after author confirmed the WSL2 Snapcraft login failure resolved following recent Windows, WSL, and Snapcraft updates. No code changes were required.
qwen3.6-35b-a3b-mtp-q6 Snapcraft on WSL2 failed to use SNAPCRAFT_STORE_CREDENTIALS for login, throwing a NoKeyringError. Fixed by environment updates across Windows, WSL, Ubuntu, and Snapcraft. The author closed the report as functionality was restored.
qwen3.6-35b-a3b-mtp-q6 SNAPCRAFT_STORE_CREDENTIALS login failures in WSL2 were resolved following recent updates to Windows, WSL, Ubuntu, Snap, or Snapcraft. The author closed the issue after confirming the environment variable now works as expected.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#6098 fix: Tweak error message about SNAPCRAFT_STORE_CREDENTIALS snapcraft merged Merged to clarify the ambiguous SNAPCRAFT_STORE_CREDENTIALS error message. The update explicitly states login fails while the variable is set, resolving user confusion. Approved by four reviewers and passed CI checks prior to merge.
72%