question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependency resolver fails behind proxy on init command

See original GitHub issue
  • 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: Ubuntu 18.04

  • Poetry version: 0.11.1

Hi,

even with the proper environment variables it seems that the dependency resolver fails to contact PyPI repository in interactive init command. Here is the trace:

poetry init -vvv
[...]
Would you like to define your dependencies (require) interactively? (yes/no) [yes] 
Search for package: numpy
                                      
[OSError]              
[Errno 101] Network is unreachable  
                                      
Exception trace:
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/_vendor/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/_vendor/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/console/commands/command.py in run() at line 72
   return super(BaseCommand, self).run(i, o)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/_vendor/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/_vendor/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/console/commands/init.py in handle() at line 114
   self._determine_requirements(self.option("dependency"))
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/console/commands/init.py in _determine_requirements() at line 157
   matches = self._get_pool().search(package)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/repositories/pool.py in search() at line 98
   results += repository.search(query, mode=mode)
 /home/alex/anaconda3/lib/python3.6/site-packages/poetry/repositories/pypi_repository.py in search() at line 198
   hits = client.search(search, "or")
 /home/alex/anaconda3/lib/python3.6/xmlrpc/client.py in __call__() at line 1112
   return self.__send(self.__name, args)
 /home/alex/anaconda3/lib/python3.6/xmlrpc/client.py in __request() at line 1452
   verbose=self.__verbose
 /home/alex/anaconda3/lib/python3.6/xmlrpc/client.py in request() at line 1154
   return self.single_request(host, handler, request_body, verbose)
 /home/alex/anaconda3/lib/python3.6/xmlrpc/client.py in single_request() at line 1166
   http_conn = self.send_request(host, handler, request_body, verbose)
 /home/alex/anaconda3/lib/python3.6/xmlrpc/client.py in send_request() at line 1279
   self.send_content(connection, request_body)
 /home/alex/anaconda3/lib/python3.6/xmlrpc/client.py in send_content() at line 1309
   connection.endheaders(request_body)
 /home/alex/anaconda3/lib/python3.6/http/client.py in endheaders() at line 1234
   self._send_output(message_body, encode_chunked=encode_chunked)
 /home/alex/anaconda3/lib/python3.6/http/client.py in _send_output() at line 1026
   self.send(msg)
 /home/alex/anaconda3/lib/python3.6/http/client.py in send() at line 964
   self.connect()
 /home/alex/anaconda3/lib/python3.6/http/client.py in connect() at line 1392
   super().connect()
 /home/alex/anaconda3/lib/python3.6/http/client.py in connect() at line 936
   (self.host,self.port), self.timeout, self.source_address)
 /home/alex/anaconda3/lib/python3.6/socket.py in create_connection() at line 724
   raise err
 /home/alex/anaconda3/lib/python3.6/socket.py in create_connection() at line 713
   sock.connect(sa)

The odd thing is poetry add numpy with an empty pyproject.toml works just fine although it relies on the same _determine_requirements() method.

I did not encounter this issue on an unproxied connection.

Edit: upgrade poetry version from 0.10.2 to 0.11.1 & follow contributing guide

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Batalexcommented, Nov 13, 2018

Still experiencing the very same issue on 0.12.7.

0reactions
lieutdan13commented, Dec 21, 2020

This is occurring for me on poetry 1.1.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve proxy issue in owasp dependency check?
Run the following command: mvn clean install org.owasp:dependency-check-maven:check -DscanSet.fileSet=['src/main/resources/'].
Read more >
How to resolve NPM proxy issue whilel running node JS ...
Run below command in npm command prompt or Visual Studio Code terminal. npm config rm proxy npm config rm https-proxy
Read more >
Common errors | npm Docs
Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. · This can be caused...
Read more >
kube-proxy - Kubernetes
Synopsis The Kubernetes network proxy runs on each node. This reflects services as defined in the Kubernetes API on each node and can...
Read more >
ArcGIS Pro 2.8.1 bug in urllib3 with proxy server
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found