treeverse / lakeFS

lakeFS - Data version control for your data lake | Git for data
https://docs.lakefs.io
Apache License 2.0
4.47k stars 359 forks source link

UploadObject ifAbsent fails with "not found" / 500 ISE when it should succeed #4984

Closed arielshaqed closed 1 year ago

arielshaqed commented 1 year ago

What

lakeFS fails "upload if absent" when it should succeed.

How to reproduce

Either look at lakeFSFS in #4947 tests failing to mkdir, or apply these patches and then try to upload to a non-existent path:

❯ echo foo | go run ./cmd/lakectl   -c ~/.lakectl.prod-e2e.yaml fs upload --if-absent -s - lakefs://ariels-repo/main/upload/3
not found
500 Internal Server Error
exit status 1

If the path does exist, it gives a nice 412 error as it should:

❯ echo foo | go run ./cmd/lakectl   -c ~/.lakectl.prod-e2e.yaml fs upload --if-absent -s - lakefs://ariels-repo/main/upload/2
path already exists
412 Precondition Failed
exit status 1

Context

Discovered as part of work on lakeFSFS in #4947. It fails integration tests. I believe that this is due to a bug in the lakeFS server, and indeed the above patches reproduce it without lakeFSFS. Also "Internal Server Error" hints at an issue on the server.

arielshaqed commented 1 year ago

More context: This is blocking for #4947, which is lakeFSFS performance work.