lakeFS icon indicating copy to clipboard operation
lakeFS copied to clipboard

Bug: UploadObject with `if-none-match` returns 500 instead of 412

Open itaiad200 opened this issue 2 years ago • 1 comments

If the object exists, the returned response to the client is 500 instead of 412. At this line we check for graveler.ErrPreconditionFailed, but the code returns kv.ErrPreconditionFailed.

An error log from v0.102.2 that returns 500:

log | {"error":"predicate failed","file":"build/pkg/api/controller.go:2069","func":"pkg/api.(*Controller).handleAPIErrorCallback","host":"***","level":"error","method":"POST","msg":"API call returned status internal server error","operation_id":"UploadObject","path":"/api/v1/repositories/<REPO>/branches/<BRANCH>/objects?path=<PATH>","request_id":"<>","service":"api_gateway","service_name":"rest_api","time":"2023-06-20T20:12:59Z","user":"<USER>"}

itaiad200 avatar Jun 25 '23 12:06 itaiad200

This issue is now marked as stale after 90 days of inactivity, and will be closed soon. To keep it, mark it with the "no stale" label.

github-actions[bot] avatar Nov 01 '23 15:11 github-actions[bot]