Open NixBiks opened 1 year ago
The keyring error is based on the fact the macOS keyring doesn't let you store an internet password as a username only. Despite the fact we were unable to set things in the keyring/threw an exception, we fell back to setting auth.toml
successfully.
What is more interesting is that the solver crashes on an assertion -- either our typing is incorrect, or prodigy wheels are malformed.
I suspect @radoering and @dimbleby will be interested in looking at this. The Poetry team will need access to these wheels to introspect them. You can provide them privately by emailing me (you may find my email in Git history) and I can distribute them to the relevant parties -- alternatively, have the Prodigy people reach out via the same method.
Also, please provide a sanitized pyproject.toml per the issue template -- thanks!
Also, please provide a sanitized pyproject.toml per the issue template -- thanks!
@neersighted I thought I did already? (or was it just the sanitized bit - marking it as toml?)
I wasn't sure if your minimal pyproject.toml
reproduced with only prodigy, or if there were more dependencies. Typically we want to see the actual pyproject.toml (or as close as we can get) when there are solver errors. However in this case it looks like just prodigy might be enough?
Yes the minimal example is enough - I can't get to 403 Client Error: Forbidden for url: https://s3.eu-...
anymore though. That only happened once on my first attempt
It would have happened once due to not having credentials set up properly -- it should not reproduce now that they're in auth.toml
.
I'm not so sure actually. Since the credentials is needed to get the wheel link - see #4497.
The error occurs due to poetry passing my HTTP Basic auth credentials to the AWS S3 pre-signed URL. AWS throws the error saying there can only be 1 auth method (which is the pre-signed URL) but Basic Auth credentials were also passed
So there might be multiple problems here...
I don't think that is at all what is going on -- that wouldn't result in a 403, and the authenticator code has been pretty much replaced. Poetry is clearly able to grab the wheel given it can count releases and chokes on solving for incompatibility.
The keyring error is based on the fact the macOS keyring doesn't let you store an internet password as a username only.
Btw. I get the same error if I try to add a password as well, i.e. Unable to store the password for poetry-repository-prodigy in the key ring: Can't store password on keychain: (-25299, 'Unknown Error')
I'm not sure why your keyring is broken, but you can isolate it by turning off support and forcing the auth.toml fallback: see #1917 for methods to do so.
Ah so I can go to Keychain Access in macOS and delete the keyring from there. Then I can add it again.
Now it becomes really strange though. Instead of doing poetry config http-basic.prodigy <my-licence-key> ""
I did
poetry config http-basic.prodigy <my-licence-key>
and then just clicked enter twice to confirm an empty password. After this I was able to install prodigy in my main project!?
However I still can't install prodigy this way in a fresh project. Very strange
I suggest we focus on the solver issue here, since once we solve that it's easier to isolate and open issues for other problems. When reproducing, I'd always suggest using a container to isolate local configuration issues -- e.g. can you try to solve with a fresh container?
Sounds like a good idea!
A docker container? Do you have an image template you use or?
The python:3.x
library images on the Docker Hub are great as they use Python.org builds with no patches, and include most of the software you want (e.g. git, a C compiler, etc) out of the box.
So I made a container with
FROM python:3.9.9
ENV POETRY_HOME=/usr/local
RUN curl -sSL https://install.python-poetry.org | python3 -
Then I ran a interactive session and did the following
mkdir project && cd project
poetry init
poetry source add prodigy "https://download.prodi.gy"
poetry config http-basic.prodigy <my-licence-key>
poetry add --source prodigy prodigy
And it just worked. So I'm not sure what's going on in my other case there...
When I added the auth I got this
> poetry config http-basic.prodigy <my-licence>
Password:
Using a plaintext file to store credentials
Invalid type <class 'NoneType'>
but it worked never the less
Hi @NixBiks , did you ever figure out why the Invalid type <class 'NoneType'> appeared? I'm running into some some issues with in builds because of it.
@mrcontre If you see the detailed error by adding -vvv
to the command (e.g. poetry -vvv config ...
), then it shows the error Invalid type <class 'NoneType'>
itself comes from the tomlkit
library (see related issue), but the mistake is actually much simpler - it happens when you try set the password config with an empty value.
I had the exact same issue in CI only, but it turns out it was because the environment variable wasn't set, e.g. when running poetry config http-basic.local_registry username $REGISTRY_PASSWORD
and REGISTRY_PASSWORD
wasn't set.
The error message could definitely be more helpful, although this seems to be a bit of an edge-case because if there's an interactive terminal then the command would try and allow the password to be entered via prompt (you can duplicate the issue then by just pressing enter twice at that prompt).
Thanks @samuller, I eventually found the issue and if I'm not mistaken it had something to do with an unset environment variable as you pointed out. A more specific error message would definitely help!
-vvv
option) and have included the output below.Issue
I'm trying to install a package from a private repo but I'm seeing different bugs in the process. First I add the repo by
Then I add http-basic auth with
And finally I'm trying to add the package with
which yields
However the first time I tried I got another error:
403 Client Error: Forbidden for url: https://s3.eu-...
so I figured that my licence key was wrong (I later realized that it is most likely related to #4497). So I tried to add it again withpoetry config http-basic.prodigy <my-licence-key> ""
which then gave this errorI checked in
auth.toml
and it looks fine.... If I add verbose logging on thepoetry config
command then I getI know this issue is getting out of hand but I'm not sure if these errors are all linked to eachother?
There is also an ongoing thread here.