ambry
ambry copied to clipboard
POST to accounts/containers returned 500 when should be 400
Used curl to add a container with json missing a field. Got 500 status with no error message. Saw this error in frontend log:
2020/11/13 00:57:26.724 ERROR [NettyResponseChannel] [RequestWorker-1] [ambry-frontend] [] Unexpected error handling request /accounts/containers?x-ambry-target-account-name=Container-API-Test with method POST
java.lang.IllegalStateException: previouslyEncrypted should be true if the container is currently encrypted
at com.github.ambry.account.Container.checkPreconditions(Container.java:782) ~[ambry-api-0.3.385.jar:?]
at com.github.ambry.account.Container.<init>(Container.java:411) ~[ambry-api-0.3.385.jar:?]
at com.github.ambry.account.Container.fromJson(Container.java:551) ~[ambry-api-0.3.385.jar:?]
at com.github.ambry.account.AccountCollectionSerde.containersFromJson(AccountCollectionSerde.java:97) ~[ambry-api-0.3.385.jar:?]
at com.github.ambry.frontend.PostAccountsHandler$CallbackChain.updateContainers(PostAccountsHandler.java:189) ~[ambry-frontend-0.3.385.jar:?]
at com.github.ambry.frontend.PostAccountsHandler$CallbackChain.lambda$fetchAccountUpdateBodyCallback$2(PostAccountsHandler.java:150) ~[ambry-frontend-0.3.385.jar:?]
...
at com.github.ambry.frontend.PostAccountsHandler.handle(PostAccountsHandler.java:80) ~[ambry-frontend-0.3.385.jar:?]