Unable to create new item with empty password with cli

crumpstar
crumpstar
Community Member

I'm using cli 2.28.0

op item get "item-uuid" --format=json | op item create --vault=runtime-testing --tags=test

is returning "unable to process line 1: Validation: (validateVaultItem failed to Validate), Couldn't validate the item: "[ItemValidator] has found 1 errors, 0 warnings: \nErrors:{1. Password item requires ps value}"

"item-uuid" is a correct UUID for an existing item of "category": "PASSWORD". This only happens when the 'item-uuid" has an empty value for password. The 1password app allows me to create/save an item with an empty password thus I would expect the CLI to allow the same.

Note that if I use the --generate-password option it will create the item. However i want the password to be empty.


1Password Version: 8.10.30
Extension Version: Not Provided
OS Version: macOS 14.4.1
Browser: Not Provided

Comments

  • Hey @crumpstar , I'm really sorry to hear you're running into some troubles with the CLI!

    I've done some testing on my end and have not been able to replicate your issue running op item get "item-uuid" --format=json | op item create --vault="vault-name" --tags=test with either a password item or a login item that has nothing set in the password field.

    There is a chance that the item's json has broken behind the scenes. This is incredibly rare, however it can sometimes happen if the item was created or edited using a flawed release of the 1Password desktop app at some point in the past.

    As a test, if you re-create the password item from scratch (and not manually copy it), in whichever vault you are attempting to make a copy of it out of, and then re-run the command using the 1Password CLI does it continue to run into this issue?

  • asteurer
    asteurer
    Community Member

    I'm running into the same error message when I try to run this command:

    op item edit my_item --vault my_vault "test_password=TEST"
    

    Here's the error message:

    [ERROR] 2024/10/24 20:23:47 validateVaultItem failed to Validate: Couldn't validate the item: "[ItemValidator] has found 1 errors, 0 warnings: \nErrors:{1. Password item requires ps value}"
    

    I'm using op version 2.30.0 on Ubuntu 24.04.1 LTS.