lakeFS
lakeFS copied to clipboard
[Bug]: HEAD endpoints are not returning error messages in the response body
What happened?
Related to #7451
Steps to Reproduce: Running this code:
import lakefs
lakefs.Repository("<invalid-name>").branch("branch-name").object("something").exists()
Throws:
...
lakefs.exceptions.BadRequestException: code: 400, reason: Bad Request, body: {}
While running this code:
lakefs.Repository("<invalid-name>").branch("branch-name").object("something").stat()
Throws:
...
lakefs.exceptions.BadRequestException: code: 400, reason: Bad Request, body: {'message': 'argument repository: repository id: invalid value: validation error'}
The exists API calls HEAD /repositories/{repository}/refs/{ref}/objects, while the stat API does a GET request to the same endpoint.
The HEAD request doesn't accept content in the response body, which contains crucial information about the failure reason.
Expected behavior
Both code snippets should produce the same exception:
lakefs.exceptions.BadRequestException: code: 400, reason: Bad Request, body: {'message': 'argument repository: repository id: invalid value: validation error'}
lakeFS version
No response
How lakeFS is installed
No response
Affected clients
No response
Relevant log output
No response
Contact details
No response
This is not a "Python Wrapper" issue. This is an issue with all of our clients. The reason is: head response does not return a body and as a result we don't get the full description of the error. Potentially we should somehow make the error description available in the lakeFS response also for head requests.
@N-o-Z I see your point, changed the issue title accordingly.
@N-o-Z I see your point, changed the issue title accordingly.
Thanks!