Importer hangs when rich history URL requires authentication

Bug #1980982 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Fix Released
Medium
Robie Basak

Bug Description

Importing amavisd-new currently fails with:

$ git-ubuntu import --no-push -d amavisd-new -v amavisd-new

...

07/07/2022 18:06:22 - DEBUG:Executing: git fetch https://git.launchpad.net/~ahasenack/ubuntu/+source/amavisd-new refs/heads/merge-lp1946841-jammy
Username for 'https://git.launchpad.net':

This is because the rich history URL provided against 1:2.12.2-1ubuntu1 requires authentication. Probably because the repository doesn't exist - I noticed that Launchpad returns initially with requiring authentication since it doesn't know whether or not to present a private repository or not, and presumably doesn't want to leak the existence of private repositories by doing anything else.

We need to figure out how to tell "git fetch" to never auth and not block.

Related branches

Revision history for this message
Robie Basak (racb) wrote :

A shorter reproducer:

mkdir reproducer
cd reproducer
git init
git fetch https://git.launchpad.net/~ahasenack/ubuntu/+source/amavisd-new refs/heads/merge-lp1946841-jammy

This hangs with:

Username for 'https://git.launchpad.net':

How do we make it not hang? I tried redirecting stdin from /dev/null but that didn't work.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

You can encode user/pw in the URL that you fetch.
Maybe you can try with this one first?

git fetch --dry-run https://none:<email address hidden>/~ahasenack/ubuntu/+source/amavisd-new refs/heads/merge-lp1946841-jammy
remote: Authorisation required.
fatal: Authentication failed for 'https://git.launchpad.net/~ahasenack/ubuntu/+source/amavisd-new/'

The only problem is that you probably want to separate those really asking for auth from those just failing because we are using a fake user. But it might be a step forward as it does not hang.

Revision history for this message
Robie Basak (racb) wrote :

We found that Nish had already found the solution. GitUbuntuRepository.fetch_remote() sets GIT_TERMINAL_PROMPT=0.

Robie Basak (racb)
Changed in git-ubuntu:
status: Triaged → In Progress
assignee: nobody → Robie Basak (racb)
Revision history for this message
Robie Basak (racb) wrote :

Fixed in 8a489b3d2bee82e6938afb96675528334e9ffcd3

Changed in git-ubuntu:
status: In Progress → Fix Committed
Revision history for this message
Robie Basak (racb) wrote : Fix released in git-ubuntu

Fix released in git-ubuntu version 1.1

Changed in git-ubuntu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.