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

Unexpected unpack status when using abapGit #156

Open
pokrakam opened this issue Jul 12, 2021 · 8 comments
Open

Unexpected unpack status when using abapGit #156

pokrakam opened this issue Jul 12, 2021 · 8 comments

Comments

@pokrakam
Copy link
Sponsor Contributor

Getting the following error when committing with abapGit:
Git protocol error: Unexpected unpack status

Comparing GitHub and AGS, there is a difference in response. When committing to GitHub, I get the response:

000eunpack ok
0017ok refs/heads/main
00000000

but committing to AGS I get:

0013#000eunpack ok
001e#0019ok refs/heads/master
0009#00000000

Looks like the length header is added twice by AGS?

@pokrakam
Copy link
Sponsor Contributor Author

pokrakam commented Jul 12, 2021

Hmm, so been learning about Git protocol bands. The header may be correct if it's shown raw. Not sure which side the issue is. Either it's doubling up the band in AGS or not stripping it out in abapGit.

See also abapGit/abapGit#4872

@mbtools
Copy link
Contributor

mbtools commented Jul 20, 2021

i'm not using AGS, but I would say the error is here:
https://github.com/larshp/abapGitServer/blob/main/src/service/zcl_ags_service_git.clas.abap#L488

Suggestion:

    lo_response->append_length( zcl_ags_util=>string_to_xstring_utf8( |unpack ok\n| ) ).

    lo_response->append_length( zcl_ags_util=>string_to_xstring_utf8( |ok { iv_branch_name }\n| ) ).

    lo_response->append_length( zcl_ags_util=>string_to_xstring_utf8( '0000' ) ).

    rv_xstring = lo_response->get( ).

@pokrakam
Copy link
Sponsor Contributor Author

Have debugged that and it is definitely correct in adding the band. The other unusual thing is that I can pull from CLI, which makes me wonder if it's not AG. The protocol seems to agree with the docs too.

Mind you, I didn't try CLI with the latest version, might do that when I get some time.

@mbtools
Copy link
Contributor

mbtools commented Jul 20, 2021

As far as I see it, AG (client) does not set the side-band when checking report-status (it does for upload_pack):
https://github.com/abapGit/abapGit/blob/main/src/git/zcl_abapgit_git_transport.clas.abap#L288
Therefore, AG server should not send multiplexed data.

To support also other Git clients, AGS would need to be enhanced for both situations (i.e. evaluate header, use current code if side-band was requested, use my code otherwise).

@pokrakam
Copy link
Sponsor Contributor Author

Perhaps, or AG should handle it as it did before. That's why I logged it in both.

In any case I don't have time to do this myself right now. I'm using AGS for a PoC, and the simple workaround is to revert AG to where it still worked.

@AndreaBorgia-Abo
Copy link
Contributor

@pokrakam Oh, well, nice to see I am not the only one: thing is, I wanted to use aGS instead of GH, because reasons, and it seemed a quicker option than setting up an internal git server. I'll discuss with colleagues if we can spend time on this issue.

@pokrakam
Copy link
Sponsor Contributor Author

pokrakam commented Jan 9, 2023

@AndreaBorgia-Abo as this is turning out to be a bit of rabbit hole that I don't have time for and it's still unclear where it should be addressed, I've moved onto running a Gitea image. Really easy to set up.

@AndreaBorgia-Abo
Copy link
Contributor

I believe you, we had to explore this option and this was something I could do (mostly) without external help. Thanks for the suggestion, I'll bring it up.

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

3 participants