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

denokv serve: 500 An internal server error occurred when attempting to sum a non kvu64 #32

Closed
johnspurlock-skymethod opened this issue Nov 11, 2023 · 3 comments · Fixed by #33

Comments

@johnspurlock-skymethod
Copy link
Contributor

To reproduce: run denokv serve locally, connect via Deno.openKv, then attempt a sum operation on an existing non kvu64 value.

Expected:
http 4xx response, this is a non-retryable client error

Actual:
An error is logged: [ERROR denokv] Failed to write to database: Failed to perform 'sum' mutation on a non-U64 value in the database and an http 500 is returned to the client with body An internal server error occurred. The spec encourages retrying 5xx, so it's probably important to return a 4xx here instead.

@johnspurlock-skymethod
Copy link
Contributor Author

Upgrading to Deno 1.38.1 from 1.37.2, I see the built-in Deno.openKv('http://localhost:4512/') client will actually retry forever in this case - another reason to use 4xx here.

@lucacasonato
Copy link
Member

Yes, this is a bug.

@johnspurlock-skymethod
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants