Skip to main content
Mar 23, 2023 4:39 PM UTC
Question

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

41 replies

May 31, 2023 3:55 AM UTC

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 https://1password.com/downloads/command-line/ 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?

Sep 12, 2023 7:51 PM UTC

+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.

Oct 5, 2023 1:22 PM UTC

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

Oct 15, 2023 8:59 PM UTC

+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.

Nov 6, 2023 8:16 AM UTC

Same issue here

  • OP CLI 2.22.0
  • MacOS 14.1
  • 1Password for Mac 8.10.18 (81018040)
dewe
Nov 8, 2023 10:21 AM UTC

Same here, hangs on NmRequestDelegatedSession. Usually works after a ctrl-c and retry.

op version 2.22.0

dewe
Nov 8, 2023 1:13 PM UTC

@ArunV1P I tested running with --cache=false but still get the same issue, hanging on NmRequestDelegatedSession. Which kind of makes sense, since the caching happens after a successful login, right?

Nov 8, 2023 1:18 PM UTC

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.

Nov 8, 2023 1:46 PM UTC

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.

dewe
Nov 9, 2023 7:39 AM UTC

I see the same behaviour when using the aws plugin

That is, running

shell
op plugin run --debug -- aws sts get-caller-identity

hangs on NmRequestDelegatedSession