op-vscode icon indicating copy to clipboard operation
op-vscode copied to clipboard

"Preview with secrets" command errors with: Error executing CLI command

Open grschafer opened this issue 1 year ago • 1 comments

Your environment

op-vscode version: 1.0.1

VS Code version: 1.71.2

CLI version: 2.7.1

OS: Ubuntu 22.04.1 LTS

Steps to reproduce

  1. Open a file in vscode (it can be blank)
  2. Open the command palette (ctrl+shift+p)
  3. Execute the "1Password: Preview with secrets" command
  4. Click "Preview" in the popup modal

What happened?

I get 2 toast notifications in the bottom right:

  1. An error notification saying: "Error executing CLI command"
  2. An info notification saying "Injecting secrets..." with a progress bar. This notification persists for a while (maybe 5 minutes) until timeout.

What did you expect to happen?

I expected the command to open a new view of the file with op://... secret references replaced with the actual secrets.

Notes & Logs

I tested all the other 1password commands that were available and they all worked as I expected, except "1Password: Save in 1Password" where I have the same issue as described in #69.

Vscode "1Password" log:

["INFO" - 2:53:49 PM] Starting 1Password for VS Code.
["INFO" - 2:53:49 PM] Extension Version: 1.0.1.
["ERROR" - 2:53:52 PM] Error executing CLI command
["DEBUG" - 3:00:14 PM] Opening 1Password with path: 
["ERROR" - 3:00:35 PM] Error executing CLI command
["ERROR" - 3:03:26 PM] Error executing CLI command
["ERROR" - 3:04:14 PM] Error executing CLI command
["ERROR" - 3:04:55 PM] Error executing CLI command
["ERROR" - 3:06:25 PM] Error executing CLI command

Vscode "Extension Host" log doesn't show anything when this failure happens.

The log at ~/.config/1Password/logs/1Password_rCURRENT.log also shows nothing.

I tried debugging the op-js library directly and would get errors like:

CLIError: connecting to desktop app: read: connection reset, make sure the CLI is correctly installed and CLI Biometric Unlock is enabled in the 1Password app

but the log at ~/.config/1Password/logs/1Password_rCURRENT.log contains errors like the below:

WARN  2022-09-21T14:57:28.666 tokio-runtime-worker(ThreadId(15)) [1P:foundation/op-sys-info/src/process_information/linux.rs:247] binary permission verification failed for /home/$USER/.config/nvm/versions/node/v16.12.0/bin/node

so I suspect my failure to get op-js to work might not be the cause of the vscode extension failing. I do have "Unlock using system authentication service" and "Biometric unlock for 1Password CLI" options enabled.

I have the sockets listening that I would expect, based on reading https://1password.community/discussion/128447/op-cli-with-biometric-unlock-using-polkit-not-working

$ ss --listening | grep -i pass | column -t ; ls -la ${XDG_RUNTIME_DIR}/1Password-BrowserSupport.sock 
nl     UNCONN  0  0     rtnl:1password/6361                           *         
nl     UNCONN  0  0     rtnl:1password/6520                           *         
nl     UNCONN  0  0     rtnl:1password/6520                           *         
nl     UNCONN  0  0     rtnl:1password/6361                           *         
nl     UNCONN  0  0     uevent:1password/6361                         *         
nl     UNCONN  0  0     uevent:1password/6361                         *         
u_str  LISTEN  0  1024  /home/greg/.1password/agent.sock              59117  *  0
u_str  LISTEN  0  1024  /run/user/1000/1Password-BrowserSupport.sock  67780  *  0
srw------- 1 greg greg 0 Sep 21 11:13 /run/user/1000/1Password-BrowserSupport.sock

I've tried restarting 1Password, toggling system-auth and biometric settings off and back on, and rebooting, but none seem to change the behavior.

grschafer avatar Sep 21 '22 21:09 grschafer

Hey @grschafer, thanks for reporting this. It seems related to a change that happened in newer versions of the CLI. You could try downgrading your CLI version, but at any rate I hope to have this fixed and working with the latest version of the CLI as soon as possible. Will follow up when a new version is ready.

jodyheavener avatar Sep 22 '22 14:09 jodyheavener