Skip to main content
March 23, 2023
Question

CLI hangs when requesting items

  • March 23, 2023
  • 38 replies
  • 3014 views

the cli had been working without issues for a while but about a day ago it began to indefinitely hang when fetching an item.

When I run: op item get XXX --otp --debug I get:


9:35AM | DEBUG | Session delegation enabled
9:35AM | DEBUG | NM request: NmRequestAccounts
9:35AM | DEBUG | NM response: Success
9:35AM | DEBUG | NM request: NmRequestAccounts
9:35AM | DEBUG | NM response: Success
9:35AM | DEBUG | account not signed in, filter=XXXX latest_signin_user=XXXXXXXXXX
9:35AM | DEBUG | not signed in reason: session file not found
9:35AM | DEBUG | NM request: NmRequestAccounts
9:35AM | DEBUG | NM response: Success
9:35AM | DEBUG | NM request: NmRequestAuthorization
9:35AM | DEBUG | NM response: Success
9:35AM | DEBUG | NM request: NmRequestAccounts
9:35AM | DEBUG | NM response: Success
9:35AM | DEBUG | NM request: NmRequestDelegatedSession

and it just hangs there. Any idea of what could be wrong here?


1Password Version: 8.10.3 (81003012)
Extension Version: 2.15.0
OS Version: macOS 13.2.1 (22D68)
Browser:_ zsh

38 replies

November 30, 2023

Yep, this is affecting me as well. Even running op signin will properly bring up the sign in window but the process will never complete leaving the terminal hung. I have to ctr + c to exit the command.

MacOS 14.1.1
1Password 8.10.20
OP CLI 2.23.0

This is a pretty frustrating bug because I either have to open the 1password app and unlock it before running my cli commands, or I need to run the cli command, unlock 1password through the modal window, then ctrl + c to exit, then run the same command again.

dewe
December 1, 2023

Yeah, I've gotten used to run pkill -f "op plugin" a few times during the day. Not fun. Considering moving out of this solution...

December 8, 2023

Same behavior here when using op plugin run.

I end up running my script, and then ctrl+c to kill it after it gets stuck at the op point, and then run my script again.

macOS 14.1.2, 1Password 8.10.20, OP CLI 2.23.0.

tamird
December 22, 2023

I am seeing this as well. Since the op binary is signed, I was not able to attach a debugger. I was able to collect stack traces using the sample command: https://gist.github.com/tamird/37007fefb7a4a9ceac25b4a980c6f8d9. It looks like the binary doesn't have debug symbols so I can't symbolicate, but it is 1password-cli 2.24.0 on arm64 installed via homebrew. The binary's SHA-1 hash is be5be5649dedf18460a7608d2107ea346f7c323e.

Looks like a bunch of threads are stuck in __psynch_cvwait under a cgo call. I guess 1password-cli is written in Go?

1Password Employee
January 9, 2024

Hello everyone,

If you are encountering an issue with the 1Password CLI not authenticating correctly, or the command hangs after a NmRequestDelegatedSession debug line, there are a few things that may help to resolve this.

  • If the 1Password app is installed:
    • Check if the Settings > Developer > Integrate with 1Password CLI option is enabled.
    • Also check Settings > General > Show 1Password in the menu bar (Mac) or Keep 1Password in the notification area (Windows).
    • Make sure both option are also enabled, then try the CLI command again.
  • Fully quit the 1Password app from the menu bar or system tray, then reopen it, unlock 1Password, and try the CLI command again.
  • Make sure you have 1Password CLI and 1Password app fully updated to the latest version.
  • Reboot your device.

If the problem still occurs after trying the above steps, send an email to support@1password.com so we can help you investigate further. To help expedite your case, include a link to this thread, your community username if you've posted here already, a copy of the output from the CLI command with --debug specified (do not include any secret or confidential information. Please review and redact the log lines before sending), any troubleshooting steps you've tried, the installed version of the CLI tool and 1Password app, and a diagnostics report if the 1Password app is installed on your device.

Thank you,

Joshua_ag
1Password Employee
January 22, 2024

Hi @sagmor, @wonnage, @iwehrman, @teacy123, @JKnockaert, @dewe, @tannerellen, @jeb1138, @tamrid,

I wanted to let you all know that we have been able to reproduce the issue with the op plugin command failing if run while 1Password is locked our developers are aware and looking into the issue.

For user's who have reported the issue running other op commands. Can you let me know if you still experience the issue and answer the following questions:
- What command(s) are failing?
- Do you have 1Password set to appear in your menu bar / notification area / task bar?
- Is 1Password running but locked, running and unlocked, or not running at all when you run the command(s)?
- What operating system are you running?
- What shell are you running?
- What version of 1Password the app and op are you running?
- Do you have biometrics enabled to unlock 1Password?

Josh

ref: dev/b5/op#3948

January 22, 2024

@Joshua_ag Thanks for the response. Yes I am still experiencing the issue...

  1. To my knowledge all commands fail but specifically I am using op insert and op read.
  2. Yes, 1Password is set to appear in my menu bar (which is the default when installing).
  3. It fails if 1password is locked. It never fails if it is unlocked. If 1password isn't running the CLI doesn't work at all because you get an error that it can't connect to the desktop app so that isn't a legitimate scenario. This should be pretty easy to reproduce. On a mac make sure 1password is locked and in the terminal attempt any op command. It will prompt for a password, once password is confirmed It will never complete the task.
  4. MacOS Sonoma 14.1.1
  5. ZSH, It's the default shell on MacOS. The terminal apps I'm using are Kitty primarily but the bug happens in all of them (allacritty, built in terminal, iTerm2).
  6. 1Password 8.10.23 and op cli is 2.23.0 (just updated to 2.24.0 and bug still exists)
  7. No, I'm using a password to unlock.
January 23, 2024

Thanks @Joshua_ag. One thing I've noticed is that this failure started happening much less frequently after enabling 1Password in the menu bar. To your other questions:

  • op item get
  • I do now, and it still occasionally fails. Before I enabled this, it failed on the initial request most of the time.
  • Typically running and locked. But failures sometimes happened when running and unlocked.
  • Mac OS 14.2.1
  • fish 3.1.2
  • 1Password 8.10.23 and op 2.23.0
  • Yes, Apple Watch is set to unlock.
Joshua_ag
1Password Employee
January 24, 2024

Thank you @tannerellen and @iwehrman,

I have passed along these details to the development team. We really appreciate the help!

tamird
February 5, 2024

@Joshua_ag any updates on the op plugin issue?