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

TransportException during push - expected Content-Type application/x-git-receive-pack-result; received Content-Type null #98

Open
padmalcom opened this issue Oct 14, 2024 · 2 comments

Comments

@padmalcom
Copy link

Version

7.0.0.202409031743-r

Operating System

Linux/Unix, MacOS, Windows

Bug description

Hi, thanks for providing the library. I have a strange error that I'm not able to track down so maybe you can help. When it comes to the push, the git.push() command returns the error in the title. The repository works fine, I tested it via another git client.

org.eclipse.jgit.api.errors.TransportException: https://huggingface.co/datasets/sth/images: expected Content-Type application/x-git-receive-pack-result; received Content-Type null

It seems that the server actually returns the Content-Type null but I have no option to handle this exception so that the push fails whereas I can push with any other git client I use.

Actual behavior

The commit succeeds but the push fails.

Expected behavior

The push should succeed but report that the Content-Type is not correct.

Relevant log output

No response

Other information

No response

@msohn
Copy link
Member

msohn commented Oct 14, 2024

The http protocol documentation mentions the expected content type here. Hence git servers implementing the smart git http protocol should set this response header. I think it makes sense that a git client expects git servers to implement the protocol properly.

The client-side expected content type "application/x-git-receive-pack-result" for receive-pack is defined in JGit in TransportHttp.Service.Service() and is enforced in TransportHttp.Service.openResponse().

Did you raise a bug against HuggingFace asking them to check their implementation of the git smart http protocol ?

@padmalcom
Copy link
Author

Hi @msohn, thanks for the quick response. I did create an issue on the huggingface datasets project here. I wasn't sure if I had to look at the client or the server side for the issue. Do I have an option to manipulate the Service implementation inside TransportHttp?

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

No branches or pull requests

2 participants