Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST to accounts/containers returned 500 when should be 400 #1695

Open
lightningrob opened this issue Nov 13, 2020 · 0 comments
Open

POST to accounts/containers returned 500 when should be 400 #1695

lightningrob opened this issue Nov 13, 2020 · 0 comments
Assignees
Labels

Comments

@lightningrob
Copy link
Contributor

lightningrob commented Nov 13, 2020

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:?]

@lightningrob lightningrob self-assigned this Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant