CLI hangs when requesting items
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
Comments
-
Hey @sagmor, thanks for reaching out and sorry for the delay here.
I am not seeing the same behavior at my end, but I'd like to help troubleshoot further.
It has been a while since you posted this, so would you mind downloading the latest version of op CLI and testing with it? If the issue persists with the latest version as well, could you share the output of the same command with the
--cache=false
flag?0 -
+1 to this. Latest version of OP CLI (2.21.0) on Ventura 13.5 with 1password 8.10.13. The problem seems to occur when 1Password isn't open. Running the CLI command brings up a popup to allow access; allowing access brings up the 1PW master password unlock screen. However, unlocking here doesn't seem to do anything - the screen goes away and I'm left with the same debug logs as @sagmor:
12:48PM | DEBUG | NM request: NmRequestAccounts 12:48PM | DEBUG | NM response: Success 12:48PM | DEBUG | NM request: NmRequestAuthorization 12:48PM | DEBUG | NM response: Success 12:48PM | DEBUG | NM request: NmRequestAccounts 12:48PM | DEBUG | NM response: Success 12:48PM | DEBUG | NM request: NmRequestDelegatedSession <hangs forever here>
The workaround is to open the 1password app first, but that seems like an unnecessary step given that you can already pop up the auth window.
1 -
Same, this happens every time for me unless I unlock the app first. macOS Sonoma 14.0, OP CLI 2.21.0. This is not recent behavior w.r.t. the macOS or OP CLI version history.
6:15AM | DEBUG | Session delegation enabled 6:15AM | DEBUG | NM request: NmRequestAccounts 6:15AM | DEBUG | NM response: Success 6:15AM | DEBUG | NM request: NmRequestAccounts 6:15AM | DEBUG | NM response: Success 6:15AM | DEBUG | account not signed in, filter= latest_signin_user=[...] 6:15AM | DEBUG | NM request: NmRequestAccounts 6:15AM | DEBUG | NM response: Success 6:15AM | DEBUG | NM request: NmRequestAuthorization 6:15AM | DEBUG | NM response: Success 6:15AM | DEBUG | NM request: NmRequestAccounts 6:15AM | DEBUG | NM response: Success 6:15AM | DEBUG | NM request: NmRequestDelegatedSession
0 -
+1, exactly same behaviour. Unlocking through the UI prior to using the CLI command works. Running the CLI command a second time also works. Running it only once hangs.
0 -
Same issue here
- OP CLI 2.22.0
- MacOS 14.1
- 1Password for Mac 8.10.18 (81018040)
0 -
Same here, hangs on
NmRequestDelegatedSession
. Usually works after actrl-c
and retry.op version 2.22.0
0 -
I have two debug logs with cache disabled using this command:
op plugin run --cache=false --debug -- aws s3 ls --profile my-profile
1) where it is hanging
1:38PM | WARN | unable to find default credentials: lstat/var/folders/... .terminal_session.aws: no such file or directory 1:38PM | WARN | unable to find default credentials: directory configuration not found 1:38PM | INFO | Using profile from /Users/.../.config/op/plugins/aws.json 1:38PM | DEBUG | Session delegation enabled 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | account not signed in, filter=... latest_signin_user=... 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAuthorization 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestDelegatedSession
2) where it works
1:38PM | WARN | unable to find default credentials: lstat /var/folders/... .terminal_session.aws: no such file or directory 1:38PM | WARN | unable to find default credentials: directory configuration not found 1:38PM | INFO | Using profile from /Users/.../.config/op/plugins/aws.json 1:38PM | DEBUG | Session delegation enabled 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | account not signed in, filter=... latest_signin_user=... 1:38PM | DEBUG | not signed in reason: session file not found 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAuthorization 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestDelegatedSession 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success
The parts that are edited out are the same in both logs.
1 -
I have two debug logs with cache disabled, running this command:
op plugin run --cache=false --debug -- aws s3 ls --profile my-profile
1) where it is hanging
1:38PM | WARN | unable to find default credentials: lstat /var/folders/ ... .terminal_session.aws: no such file or directory 1:38PM | WARN | unable to find default credentials: directory configuration not found 1:38PM | INFO | Using profile from /Users/.../.config/op/plugins/aws.json 1:38PM | DEBUG | Session delegation enabled 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | account not signed in, filter=... latest_signin_user=... 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAuthorization 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestDelegatedSession
2) executed after aborting the first attempt, now it succeeds
1:38PM | WARN | unable to find default credentials: lstat /var/folders/ ... .terminal_session.aws: no such file or directory 1:38PM | WARN | unable to find default credentials: directory configuration not found 1:38PM | INFO | Using profile from /Users/.../.config/op/plugins/aws.json 1:38PM | DEBUG | Session delegation enabled 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | account not signed in, filter=... latest_signin_user=... 1:38PM | DEBUG | not signed in reason: session file not found 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAuthorization 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestDelegatedSession 1:38PM | DEBUG | NM response: Success 1:38PM | DEBUG | NM request: NmRequestAccounts 1:38PM | DEBUG | NM response: Success
The parts that are edited out are the same in both attempts.
0 -
I see the same behaviour when using the aws plugin
That is, running
op plugin run --debug -- aws sts get-caller-identity
hangs on NmRequestDelegatedSession
0 -
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.0This 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.
0 -
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...0 -
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.
0 -
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-cli2.24.0
on arm64 installed via homebrew. The binary's SHA-1 hash isbe5be5649dedf18460a7608d2107ea346f7c323e
.Looks like a bunch of threads are stuck in
__psynch_cvwait
under acgo
call. I guess 1password-cli is written in Go?0 -
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,
0 -
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
0 -
@Joshua_ag Thanks for the response. Yes I am still experiencing the issue...
- To my knowledge all commands fail but specifically I am using op insert and op read.
- Yes, 1Password is set to appear in my menu bar (which is the default when installing).
- 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.
- MacOS Sonoma 14.1.1
- 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).
- 1Password 8.10.23 and op cli is 2.23.0 (just updated to 2.24.0 and bug still exists)
- No, I'm using a password to unlock.
0 -
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.
0 -
Thank you @tannerellen and @iwehrman,
I have passed along these details to the development team. We really appreciate the help!
0 -
@Joshua_ag any updates on the
op plugin
issue?0 -
I'm also experiencing this.
Im on macOS Sonoma 14.3.1
I can reproduce 100% of the time, by
- Closing down both 1Password app and 1Password in the menu bar
- Start 1Password again (that opens both the app and the 1password menu bar. I leave it locked
- From kitty or iTerm or Terminal , I run op --debug --cache=false read "op://Personal/xxxx"
- It will pop up the "1Password Access Requested" I use the Autorize with Touch ID
- I see the 1Password desktop app unlocking
- But the op read hangs forever
- If I kill it and run it again it will works (presumably because 1Password is already unlocked)
Responses to your questions @Joshua_ag
- What command(s) are failing?
- op --debug --cache=false read "op://Personal/xxxx"
- Do you have 1Password set to appear in your menu bar / notification area / task bar? yes
- Is 1Password running but locked, running and unlocked, or not running at all when you run the command(s)?
- Is running locked (both the app and the icon menu bar are visible)
- when the app is unlocked then op read won't hang for me.
- What operating system are you running? macOS Sonoma 14.3.1
- What shell are you running?
- I tried both zsh and bash, in macOS Terminal, kitty and iTerm2
- What version of 1Password the app and op are you running?
- op --version 2.25.0
- 1Password for Mac 8.10.27 (81027003)
- Do you have biometrics enabled to unlock 1Password?
- yes, I use TouchID
op --debug --cache=false read "op://Personal/xxxx" 9:19AM | DEBUG | Session delegation enabled 9:19AM | DEBUG | NM request: NmRequestAccounts 9:19AM | DEBUG | NM response: Success 9:19AM | DEBUG | NM request: NmRequestAccounts 9:19AM | DEBUG | NM response: Success 9:19AM | DEBUG | account not signed in, filter= latest_signin_user=xxxxx 9:19AM | DEBUG | NM request: NmRequestAccounts 9:19AM | DEBUG | NM response: Success 9:19AM | DEBUG | NM request: NmRequestAuthorization 9:19AM | DEBUG | NM response: Success 9:19AM | DEBUG | NM request: NmRequestAccounts 9:19AM | DEBUG | NM response: Success 9:19AM | DEBUG | NM request: NmRequestDelegatedSession
0 -
Hello, it's been a few months now. Any progress?
0 -
- What command(s) are failing?
"op --account https://companyname.1password.eu signin" but also every other command which requires re-authentication - Do you have 1Password set to appear in your menu bar / notification area / task bar? yes
- Is 1Password running but locked, running and unlocked, or not running at all when you run the command(s)?
running, and i guess locked because of the re-authentication - What operating system are you running? MacOS Sonoma 14.3 (23D56)
- What shell are you running? bash script within zsh
- What version of 1Password the app and op are you running? 1Password for Mac 8.10.28 (81028034) + op 2.24.0
- Do you have biometrics enabled to unlock 1Password? yes
0 - What command(s) are failing?
-
Hi there,
I'm experiencing the same issue with all plugin commands, but one thing that hasn't been mentioned, is that the failing op read does prompt me for a login (put up a unlock screen and accept my fingerprint) before i hangs, and if i break the command with ctrl+c and run the exact same op command again, everything works just fine, since i'm already logged in to 1Password - which also might explain why running 1Password in the menu helps in some cases, since it might keep the login session running a bit longer...
Update: Just updated to latest CLI version (2.26.1), and so far it seems to be working quite a lot better
0 -
Hi @sagmor, @wonnage, @iwehrman, @teacy123, @JKnockaert, @dewe, @tannerellen, @jeb1138, @tamrid, @ecerulm, @sebastianreloaded, @MimerPlusPlus,
I have an update to share for the original reported issue of the CLI hanging when the 1Password app is locked. The latest nightly version of the 1Password app has a fix for this issue!
If anyone is willing to test it out that would be really helpful to confirm we have fully resolved the issue.
Please make sure you are running:
- 1Password 8.10.32 (81032006) or later - Learn how to Use 1Password nightly releases
op --version
2.26.1 or later, learn how to Update to the latest version of 1Password CLI
If you are still experiencing the same issue with the CLI hanging when trying to authenticate with a locked copy of the 1Password app (or new issues) please let me know.
If you are not able to switch the nightly version of the 1Password app the fix should make it to the beta version and then eventually production version barring any potential regressions or issues (hopefully there are none).
1 -
Hi @Joshua_ag, seems to work for me with the update!
1 -
Thanks so much for the update @JKnockaert glad to hear the fix has helped!
0