Skip to content

Gitlab Workflow can't access the OS Keychain

OS Keychain error message

I landed here from an error message like this. What should I do?

Ubuntu 20.04/22.04

On Ubuntu 20.04 and 22.04 you probably installed VS Code using Snap. But snap VS Code can't read passwords from the OS Keychain that we started using to securely store tokens in GitLab Workflow 3.44.0. This is the open upstream issue: Extensions SecretStorage issue: Input is not valid base64-encoded data. · Issue #147515 · microsoft/vscode

What can you do to fix the issue?

  1. You can downgrade the GitLab Workflow extension to 3.43.1
  2. If you use VS Code 1.68.0 or later, you might be able to not re-install VS Code, you can only follow steps 3 to 5 in the next item. 1
  3. You can install VS Code from the .deb package, rather than snap.
    1. Uninstall the snap VS Code

    2. Install VS Code from .deb package (from https://code.visualstudio.com/Download)

    3. Go to Ubuntu's Password & Keys tool, find the vscodegitlab.workflow/gitlab-tokens entry and remove it.

      key entry

    4. Run Gitlab: Remove Your Account from VS Code to remove the account with missing credentials.

    5. Run Gitlab: Add Account to VS Code or GitLab: Authenticate to GitLab.com to add the account again.

    6. You should be able to use the extension.

Huge thanks to @lhsilveira.ilia who found the correct .deb installation process, and also to @cub1, @krzysztof.mlodozeniec, and @malko25 who helped heaps with the debugging process.

MacOS Monterey

  1. Open Keychain Access and search for vscodegitlab.gitlab-workflow

  2. Delete vscodegitlab.gitlab-workflow from your keychain

    image

  3. Remove the corrupted account from VS Code using the GitLab: Remove Account from VS Code

Checklist

Summary

Receive an error :

[error]: Cannot get password
         Error: Cannot get password
             at I.$getPassword (vscode-file://vscode-app/snap/code/97/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1712:49592)

when trying to set my Personnal access token

Steps to reproduce

Under Ubuntu 20.04 installing the extension within vscode and tying to use the command to set the Gitlab Personnal access token the error occur

What is the current bug behavior?

Impossibility to set the token

What is the expected correct behavior?

be able to set the token

Relevant logs and/or screenshots

[error]: Cannot get password
         Error: Cannot get password
             at I.$getPassword (vscode-file://vscode-app/snap/code/97/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1712:49592)

Tying to refresh the sidebar produces following logs:

[info]: Extracted urls: []
[error]: undefined == true
         AssertionError [ERR_ASSERTION]: undefined == true
         	at r0.get selectedProjectSettings [as selectedProjectSettings] (/home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:323:20129)
         	at /home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:323:23508
         	at Gp.discardIfNotLatest (/home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:323:20361)
         	at d0.#r (/home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:323:23447)
         	at d0.reload (/home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:323:23784)
         	at gl.refreshSidebar (/home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:358:3529)
         	at /home/malko/.vscode/extensions/gitlab.gitlab-workflow-3.44.1/out/extension.js:358:2237
         	at o._executeContributedCommand (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:31333)
         	at o.$executeContributedCommand (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:32037)
         	at s._doInvokeHandler (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86:13828)
         	at s._invokeHandler (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86:13512)
         	at s._receiveRequest (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86:12173)
         	at s._receiveOneMessage (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86:10843)
         	at /snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:86:8949
         	at m.invoke (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:145)
         	at E.deliver (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:2265)
         	at v.fire (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:1843)
         	at l.fire (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:66:19001)
         	at /snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:34426
         	at m.invoke (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:145)
         	at E.deliver (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:2265)
         	at v.fire (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:1843)
         	at l.fire (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:66:19001)
         	at r._receiveMessage (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:66:23582)
         	at /snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:66:21116
         	at m.invoke (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:145)
         	at E.deliver (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:2265)
         	at v.fire (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:58:1843)
         	at v.acceptChunk (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:66:15832)
         	at /snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:66:14962
         	at Socket.R (/snap/code/97/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:13798)
         	at Socket.emit (node:events:390:28)
         	at addChunk (node:internal/streams/readable:315:12)
         	at readableAddChunk (node:internal/streams/readable:289:9)
         	at Socket.Readable.push (node:internal/streams/readable:228:10)
         	at Pipe.onStreamRead (node:internal/stream_base_commons:199:23)
  1. It seems that the VS Code team fixed the snap issue https://github.com/microsoft/vscode/pull/151165 and the fix was released in the version 1.68.0.