jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
538 stars 236 forks source link

http error 403 #714

Open Arun1111 opened 4 years ago

Arun1111 commented 4 years ago

I have a python repo and I am using jfrog cli to upload the artifact and dependencies.

I am able to upload the build but for some dependencies the build fails and gives http error while connecting to jfrog . As instructed I have added --trusted-host in my requirements.txt file but the issue is still the same.

It downloads few dependencies from the file while give http error for other. Can you suggest how can I resolve it

Below pasted are the logs:

ERROR: HTTP error 403 while getting http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/packages/55/6f/c87dffdd88a54dd26a3a9fef1d14b6384a9933c455c54ce3ca7d64a84c88/lxml-4.5.1-cp36-cp36m-manylinux1_x86_64.whl#sha256=51bb4edeb36d24ec97eb3e6a6007be128b720114f9a875d6b370317d62ac80b9 (from http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/simple/lxml/) (requires-python:>=2.7, !=3.0., !=3.1., !=3.2., !=3.3., != 3.4.) 12:32:57 ERROR: Could not install requirement lxml>=4.5.0 from http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/packages/55/6f/c87dffdd88a54dd26a3a9fef1d14b6384a9933c455c54ce3ca7d64a84c88/lxml-4.5.1-cp36-cp36m-manylinux1_x86_64.whl#sha256=51bb4edeb36d24ec97eb3e6a6007be128b720114f9a875d6b370317d62ac80b9 (from -r requirements.txt (line 7)) because of error 403 Client Error: Forbidden for url: http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/packages/55/6f/c87dffdd88a54dd26a3a9fef1d14b6384a9933c455c54ce3ca7d64a84c88/lxml-4.5.1-cp36-cp36m-manylinux1_x86_64.whl 12:32:57 ERROR: Could not install requirement lxml>=4.5.0 from http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/packages/55/6f/c87dffdd88a54dd26a3a9fef1d14b6384a9933c455c54ce3ca7d64a84c88/lxml-4.5.1-cp36-cp36m-manylinux1_x86_64.whl#sha256=51bb4edeb36d24ec97eb3e6a6007be128b720114f9a875d6b370317d62ac80b9 (from -r requirements.txt (line 7)) because of HTTP error 403 Client Error: Forbidden for url: http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/packages/55/6f/c87dffdd88a54dd26a3a9fef1d14b6384a9933c455c54ce3ca7d64a84c88/lxml-4.5.1-cp36-cp36m-manylinux1_x86_64.whl for URL http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/packages/55/6f/c87dffdd88a54dd26a3a9fef1d14b6384a9933c455c54ce3ca7d64a84c88/lxml-4.5.1-cp36-cp36m-manylinux1_x86_64.whl#sha256=51bb4edeb36d24ec97eb3e6a6007be128b720114f9a875d6b370317d62ac80b9 (from http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/api/pypi/python-ge/simple/lxml/) (requires-python:>=2.7, !=3.0., !=3.1., !=3.2., !=3.3., != 3.4.) 12:32:57 WARNING: The repository located at internal-jfrog-1269719551.us-east-1.elb.amazonaws.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host internal-jfrog-1269719551.us-east-1.elb.amazonaws.com'. 12:32:57 exit status 1

barbelity commented 4 years ago

@Arun1111 thanks for reaching us with this issue. Please specify the versions of your python, pip and JFrog CLI so I could reproduce your case, as with pip version 20.1.1 it worked for me.

In addition, did you try adding '--trusted-host internal-jfrog-1269719551.us-east-1.elb.amazonaws.com' to your build command? It should be something as: jfrog rt pip-install -r requirements.txt --trusted-host internal-jfrog-1269719551.us-east-1.elb.amazonaws.com

Arun1111 commented 4 years ago

Hello barbelity ,

Thanks for the suggestion,

I am using the latest cli version . downoading the cli using the curl command in my pipeline. curl -fL https://getcli.jfrog.io

the pip version is 10.0.1

sure I will try with jfrog rt pip-install -r requirements.txt --trusted-host internal-jfrog-1269719551.us-east-1.elb.amazonaws.com.

And the issue is actually intermittent.

barbelity commented 4 years ago

@Arun1111 did you get a chance to try the command? What were the results?

Arun1111 commented 4 years ago

Hello @barbelity

I have made the changes just one question , will it affect if instead of --trusted-host internal-jfrog-1269719551.us-east-1.elb.amazonaws.com , I use --trusted-host http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/

like below command ./jfrog rt pipi --no-cache-dir -r requirements.txt --build-name=VC-Installer --build-number=0.7.0-dev.24 --trusted-host http://internal-jfrog-1269719551.us-east-1.elb.amazonaws.com/

barbelity commented 4 years ago

@Arun1111 I couldn't put a full url as the --trusted-host, my pip failed with a 'ValueError: Invalid IPv6 URL'. I am running pip version 20.1.1. I suggest trying to run the command on your environment and see if it succeeds.

The 403 error you received was thrown by your pip client, as it doesn't allow downloading from non-https indexes unless you specifically list them as 'trusted'. According to pip documentation, you can also declare your pip-index as 'trusted' in your pip.config file and it will affect all your pip executions.

Please let me know if it helped you.