Skip to main content
August 27, 2024
Question

Problem with 1Password CLI and Service Account

  • August 27, 2024
  • 5 replies
  • 297 views

I am trying to use a service account to read secrets from a vault. And it did work for a few tries but now I get the following error message:


[ERROR] 2024/08/26 08:10:39 failed to re-initialize service account session - number of retries (1) exceeds max (1)

And yes that error message is 1 day old.

I have tried to rotate the token and to create a new service account but nothing has changed. I still get the same error.


$ op --version
2.30.0


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided

5 replies

May 30, 2025

Hi, How did you solve the problem?

June 21, 2025

we hit the same issue using `op inject` in CI/CD pipelines.

for now, we're simply retrying the command a few times with a brief sleep interval. hopefully that covers it.

June 27, 2025

Hi all (@veitsanner , @Reghyna  & @jmader8-xona ),

I was just digging into this and am having trouble reproducing the error. 

Could you provide a bit more context (environment, script, number concurrent 1P actions...)?

Thanks! Phil

June 30, 2025

in my case, we're using Linux. estimate at most 10 concurrent 1Password actions using the same "service account" token across CI jobs. more likely that 10-15 operations would execute in rapid succession.

[jenkins@jenkins-builder-1 ~]$ op --version
2.30.3

 

September 17, 2026

edit: Figured it out immediately. Windows’ clock was out of sync. I think I have windows syncing to a time server at some longish interval. For the record, these error messages are extremely unhelpful.

Click on clock in system tray → Date and Time Settings → Additional Settings → Sync Now

---

I’m hitting this as well, on windows 11 pro, powershell 7.6.6.

I can’t do any `op read ...` successfully, until I wait some number of hours (not sure how long). Then I come back, and suddenly `op read` works again as expected.

Is there some manual way of initializing or kill a service account session? Or maybe this is a networking issue?

op whoami reads this way no matter the cli version:

op whoami

URL: https://my.1password.com
Integration ID: <redacted>
User Type: SERVICE_ACCOUNT

These versions are installed with mise:

op --version

2.30.3


op read "op://homelab/authorized_keys/text" --debug

3:56PM | DEBUG | Skipped loading desktop app settings file. The desktop app might not be installed: read file: CreateFile C:\Users\chris\AppData\Local\1Password\settings\settings.json: The system cannot find the path specified.
[ERROR] 2026/09/16 15:56:31 could not read secret 'op://homelab/authorized_keys/text': error initializing client: failed to re-initialize service account session - number of retries (1) exceeds max (1)
op --version

2.39.0


op read "op://homelab/authorized_keys/text" --debug
3:59PM | DEBUG | running op read
3:59PM | DEBUG | Skipped loading desktop app settings file. The desktop app might not be installed: read file: GetFileAttributesEx C:\Users\chris\AppData\Local\1Password\settings\settings.json: The system cannot find the path specified.
3:59PM | DEBUG | server request data_source=network dur=203ms method=GET path=/api/v2/overview retry=false
3:59PM | DEBUG | server request data_source=network dur=89ms method=POST path=/api/v3/auth/start retry=false
3:59PM | DEBUG | server request data_source=network dur=79ms method=POST path=/api/v1/auth retry=false
3:59PM | DEBUG | server request data_source=network dur=93ms method=POST path=/api/v2/auth/verify retry=false
3:59PM | DEBUG | server request data_source=network dur=79ms method=GET path=/api/v2/account/keysets retry=false
3:59PM | DEBUG | server request data_source=network dur=60ms method=GET path=/api/v2/overview retry=false
3:59PM | DEBUG | server request data_source=network dur=52ms method=GET path=/api/v2/account/keysets retry=false
3:59PM | DEBUG | server request data_source=network dur=75ms method=POST path=/api/v3/auth/start retry=false
3:59PM | DEBUG | server request data_source=network dur=79ms method=POST path=/api/v1/auth retry=false
3:59PM | DEBUG | server request data_source=network dur=102ms method=POST path=/api/v2/auth/verify retry=false
3:59PM | DEBUG | server request data_source=network dur=71ms method=GET path=/api/v2/account/keysets retry=false
3:59PM | DEBUG | server request data_source=network dur=52ms method=GET path=/api/v2/account/keysets retry=false
[ERROR] 2026/09/16 15:59:32 could not read secret 'op://homelab/authorized_keys/text': error initializing client: Authorization: (401) (Unauthorized), You aren't authorized to perform this action.
3:59PM | DEBUG | server requests complete requests=12 total_request_time=1033ms
3:59PM | DEBUG | command complete total_command_time=1065ms

This version installed with scoop:

op --version
2.39.0


op read "op://homelab/authorized_keys/text" --debug
4:01PM | DEBUG | running op read
4:01PM | DEBUG | Skipped loading desktop app settings file. The desktop app might not be installed: read file: GetFileAttributesEx C:\Users\chris\AppData\Local\1Password\settings\settings.json: The system cannot find the path specified.
4:01PM | DEBUG | server request data_source=network dur=217ms method=GET path=/api/v2/overview retry=false
4:01PM | DEBUG | server request data_source=network dur=81ms method=POST path=/api/v3/auth/start retry=false
4:01PM | DEBUG | server request data_source=network dur=79ms method=POST path=/api/v1/auth retry=false
4:01PM | DEBUG | server request data_source=network dur=132ms method=POST path=/api/v2/auth/verify retry=false
4:01PM | DEBUG | server request data_source=network dur=80ms method=GET path=/api/v2/account/keysets retry=false
4:01PM | DEBUG | server request data_source=network dur=58ms method=GET path=/api/v2/overview retry=false
4:01PM | DEBUG | server request data_source=network dur=56ms method=GET path=/api/v2/account/keysets retry=false
4:01PM | DEBUG | server request data_source=network dur=83ms method=POST path=/api/v3/auth/start retry=false
4:01PM | DEBUG | server request data_source=network dur=55ms method=POST path=/api/v1/auth retry=false
4:01PM | DEBUG | server request data_source=network dur=120ms method=POST path=/api/v2/auth/verify retry=false
4:01PM | DEBUG | server request data_source=network dur=78ms method=GET path=/api/v2/account/keysets retry=false
4:01PM | DEBUG | server request data_source=network dur=50ms method=GET path=/api/v2/account/keysets retry=false
[ERROR] 2026/09/16 16:01:42 could not read secret 'op://homelab/authorized_keys/text': error initializing client: Authorization: (401) (Unauthorized), You aren't authorized to perform this action.
4:01PM | DEBUG | server requests complete requests=12 total_request_time=1089ms
4:01PM | DEBUG | command complete total_command_time=1120ms