POST to accounts/containers returned 500 when should be 400
@lightningrob is already working on this.
Since Nov 13, 2020.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 298
- Avg merge
- 21h 43m
- Merged PRs (30d)
- 9
Description
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.(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:?]
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.