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

Poetry inheriting issue for git-client on github.com #3222

Closed
3 tasks done
rienafairefr opened this issue Oct 16, 2020 · 5 comments · Fixed by #5880
Closed
3 tasks done

Poetry inheriting issue for git-client on github.com #3222

rienafairefr opened this issue Oct 16, 2020 · 5 comments · Fixed by #5880
Labels
kind/bug Something isn't working as expected

Comments

@rienafairefr
Copy link

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Linux Mint 20, Py3.8.2 virtualenv

  • Poetry version: 1.1.2

  • Link of a Gist with the contents of your pyproject.toml file:

Issue

While installing or locking, if the github git repo is wrong (e.g. returns a 404 in a browser), then poetry (sometimes) shows an authentication error and ask for the username for that url.

Resolving dependencies...
   1: fact: actions-gateway is 0.7.0
   1: derived: actions-gateway
Username for 'https://github.com':

The pyproject.toml has a git dependency like

Flask-Pika = { git = "https://github.com/rienafairefr/flask_pika.git", rev= "b2b4d68186c52ae034b39f4fb56fe86786b3a055"}

The typo is hard to see, it should be flask-pika instead of flask_pika

If the command is run without verbose output, then the "Username for 'https://github.com':" is sometimes shown only for a fraction of a second, so the command may never terminate and it's hard to know why.

Not sure poetry can or should mitigate the problem that comes from a lower level.

The problem comes (pretty sure) from github.com returning a 401 when it should return a 404:

GET /inexistent-user/inexistent-repo/info/refs?service=git-upload-pack
Host github.com
User-Agent: git/inexistent-version

gives us

HTTP/1.1 401 Authorization Required
Server: GitHub Babel 2.0

This makes the git client (which is called in a subprocess by poetry) to ask for authentication.

setting the GIT_ASKPASS variable to false while caling git is an option, the credentials to use for a git dependency should be provided by poetry, not leaving git to figure it out by itself

@rienafairefr rienafairefr added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 16, 2020
@abn
Copy link
Member

abn commented Oct 16, 2020

At first glance I do not think this is an issue. Because there are legitimate cases where an http url is used and authentication is expected via CLI interaction. This probably is a different case if for example --no-interaction is set etc.

@abn
Copy link
Member

abn commented Oct 16, 2020

Does this cause the process to hang as indicated in #2825? As in, is the user able to enter the details required?

@rienafairefr
Copy link
Author

I've encountered it. not sure why, but it's not consistent, sometimes I could try to enter the credentials, sometimes I couldn't

@abn
Copy link
Member

abn commented Oct 16, 2020

As I suggested in the other issue might be better to recommend the use of https://git-scm.com/docs/gitcredentials and disable interactions as you suggested.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants