1Password / solutions

Examples and templates from the 1Password Solutions team
MIT License
100 stars 14 forks source link

Python `create_vaults_from_input.py` example script fails on Windows #63

Closed ag-adampike closed 3 weeks ago

ag-adampike commented 5 months ago

In Windows environments, getMyUUID() catches an error on every run of the script, even after recently signing in. The response from the subprocess.run implementation of 1Password CLI seems to include a non-zero return code in every case, so the script exits here:

https://github.com/1Password/solutions/blob/4e7dab5c54be2f0464099c91741a999b62e7040b/account-management/create_vaults_from_input.py#L38-L41

I've not yet been able to work out why this is an issue for Windows, but it's easily reproduced. The error message consistently includes account not signed in.

scottisloud commented 5 months ago

Does this happen both when using the desktop integration and when signing into op manually?

ag-adampike commented 5 months ago

This error happens on Windows when 1Password CLI is integrated with 1Password for Windows. The desktop app integration does not seem to allow a subprocess to delegate sign in using the desktop app.

A workaround is to sign in manually: https://developer.1password.com/docs/cli/sign-in-manually/

The script behaves as expected on Windows when signing in manually.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. 1Password employees have been nudged.

github-actions[bot] commented 3 weeks ago

This issue has been automatically closed due to inactivity. Please re-open if this still requires attention.