Raku / App-Rakubrew

Raku environment manager
https://rakubrew.org/
Other
26 stars 13 forks source link

"Unauthenticated git protocol... " error when building zef #53

Closed JJ closed 2 years ago

JJ commented 2 years ago

Version 28

~/rakubrew


Same problem as indicated in #48. That's been fixed, but it now occurs when doing rakubrew build zef.

HEAD está ahora en 3edbbcf Bump version 0.13.7
fatal: error remoto: 
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
Failed running git checkout -f -q master && git reset --hard HEAD && git pull -q at /home/jmerelo/.rakubrew/bin/rakubrew line 839.
patrickbkr commented 2 years ago

Thanks for the report! I have just released version 29 fixing this. A rakubrew self-upgrade should get your installation repaired.

vrurg commented 2 years ago

Thanks for the report! I have just released version 29 fixing this. A rakubrew self-upgrade should get your installation repaired.

@patrickbkr BTW, it is not 100% true. I once had to manually remove local zef repository clone because rakubrew tried to update it and was failing. Not sure if it worth special handling in the code. Likely not.

patrickbkr commented 2 years ago

@JJ Did it work for you? I wonder if vrurg had a non-normal setup or if this always fails...

JJ commented 2 years ago

Right, worked like a charm.

patrickbkr commented 2 years ago

OK. Then I'll for now assume some special case haunted vrurg and leave it as is. Thanks everyone!

vrurg commented 2 years ago

@patrickbkr I can tell you exactly what it was. An old cloned repo of zef which was using git protocol. rakubrew tried to update it and was failing. After I removed it manually the new clone was fetched using https. Nothing really special.

patrickbkr commented 2 years ago

@vrurg Do you know why it was failing to upgrade the repo?

The code doing the upgrade is:

$repo = catdir($repo, '.git') if -d catdir($repo, '.git');
my $config_file = catfile($repo, 'config');
if (-f $config_file) {
    my $content = slurp($config_file);
    my $replaced = ($content =~ s|^(\s* url \s* = \s*) git (://github\.com/)|$1https$2|gmx);
    if ($replaced) {
        spurt($config_file, $content);
    }
}

My first guess would be a permissions issue.

vrurg commented 2 years ago

Wrote a comment only to wipe it out and start afresh...

A simple experiment. I have replaced the url line in .git/config:

        url = git://github.com/ugexe/zef.git

And now:

⇒ rakubrew build zef
HEAD is now at 7c46ca2 Bump version 0.13.8
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
Failed running git checkout -f -q master && git reset --hard HEAD && git pull -q at /home/vrurg/.rakubrew/bin/rakubrew line 839.
patrickbkr commented 2 years ago

@vrurg That approach doesn't reproduce the situation entirely. The logic to fix the repos is only run during the rakubrew update process and then also only when the old version is 28 or lower, not on every run. So to reproduce you would now have to download a rakubrew v28 (https://rakubrew.org/files/28/macos/rakubrew), replace ~/.rakubrew/bin/rakubrew with it and then run rakubrew self-upgrade to trigger the logic that fixes the repo URLs.

vrurg commented 2 years ago

I barely going to give it all a try. :) So, let's see if somebody else hits the issue. If not then we can safely assume there is no problematic installations are left in the wild.