Bug: Putting a new version fails after 10 versions
curiousbug opened this issue · 5 comments
Issue:
- When a key gets up to 10 versions, trying to add version 11 will fail with a 400 error.
Current workaround:
- Delete the key, which deletes all the current versions.
- Insert key with newest version.
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '1'
• stored name=test-v10-issue version=1
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds get test-v10-issue
1
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '2'
• stored name=test-v10-issue version=2
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '3'
• stored name=test-v10-issue version=3
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '4'
• stored name=test-v10-issue version=4
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '45
> '
• stored name=test-v10-issue version=5
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '6'
• stored name=test-v10-issue version=6
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '7'
• stored name=test-v10-issue version=7
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '8'
• stored name=test-v10-issue version=8
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '9'
• stored name=test-v10-issue version=9
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '10'
• stored name=test-v10-issue version=10
vagrant@vagrant-ubuntu-trusty-64:~$ unicreds --alias='alias/nonprod-aem-creds-key' put "test-v10-issue" '11'
⨯ failed error=ConditionalCheckFailedException: The conditional request failed
status code: 400, request id: 724BNHJ30K36ML3H1DEE5704OBVV4KQNSO5AEMVJF66Q9ASUAAJG
Issue is still present on version 1.3.0
Hi there!
Create DB methods between Credstash and Unicreds look identical, is this reproducible with credstash? (pip install credstash
, running your tests should be (almost) identical with it.)
Adding --debug would help seeing if this fails in the lookup of the highest version or the putting of said secret (both have use conditionals) could you please rerun your test with '--debug'?
@wolfeidau when fixed it would be nice to have an integration test to verify there is no regression. See #17
Going to follow the lead of credstash to resolve this, they now pad the version with zeros.
Working on a change to address this now.
May have been a bit hasty in my diagnosis, restored my neglected adhoc integration test which passes with values over 11.
Definitely need to sit down with @curiousbug and debug this more thoroughly before proceeding.