Poetry: All attempts to connect failed (3 causes, tested)
Poetry shows All attempts to connect to <host> failed for an untrusted certificate, a refused connection and an unresolvable hostname alike. Rerun with -v: the Caused by line names the real error.
Poetry prints the same All attempts to connect to <host> failed message for very different problems. We triggered three of them against a private source added with poetry source add --priority=primary corp <url>. Measured with Poetry 2.5.1 on Python 3.13.5 (Linux).
1. Untrusted certificate (corporate CA or proxy)
Transcript:
$ poetry add six
Creating virtualenv demo in /tmp/pow397/.venv
All attempts to connect to localhost:8963 failed.
Probable Causes:
- the server is not responding to requests at the moment
- the hostname cannot be resolved by your DNS
- your network is not connected to the internet
You can also run your poetry command with -v to see more information.
[exit 1]
Only -v shows the cause:
Transcript:
$ poetry add six -v 2>&1 | grep -E 'SSLError|Max retries' | head -3
| HTTPSConnectionPool(host='localhost', port=8963): Max retries exceeded with url: /simple/six/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1029)')))
Fix: trust the CA with certificates.<source>.cert.
2. Nothing listening: Connection refused
Transcript:
Removing source with name corp.
$ poetry add six
Creating virtualenv demo in /tmp/pow397/.venv
All attempts to connect to localhost:8965 failed.
Probable Causes:
- the server is not responding to requests at the moment
- the hostname cannot be resolved by your DNS
- your network is not connected to the internet
You can also run your poetry command with -v to see more information.
$ poetry add six -v 2>&1 | grep -E 'Error|refused' | head -2
| HTTPSConnectionPool(host='localhost', port=8965): Max retries exceeded with url: /simple/six/ (Caused by NewConnectionError("HTTPSConnection(host='localhost', port=8965): Failed to establish a new connection: [Errno 111] Connection refused"))
Same message, but -v shows [Errno 111] Connection refused: wrong port in the source URL, or the repository server or VPN is down.
3. Hostname does not resolve
Transcript:
Removing source with name corp.
$ poetry add six -v 2>&1 | grep -E 'Error|resolve' | head -2
| HTTPSConnectionPool(host='no-such-host.invalid', port=443): Max retries exceeded with url: /simple/six/ (Caused by NameResolutionError("HTTPSConnection(host='no-such-host.invalid', port=443): Failed to resolve 'no-such-host.invalid' ([Errno -2] Name or service not known)"))
- the hostname cannot be resolved by your DNS
NameResolutionError ... Name or service not known: a typo in the source URL, or an internal hostname that only resolves on the company VPN.
So: always rerun with -v and read the Caused by part. Check the URL with poetry source show. A 401 from the server is reported differently: see Authorization error accessing.
Related: Poetry ignore SSL errors, Poetry Authorization error accessing, Python 3.13 CA key usage extension.
Frequently asked questions
What does Poetry All attempts to connect failed mean?
Poetry could not reach the source. In our tests the same message appeared for SSL verify failure, Errno 111 connection refused and DNS NameResolutionError.
How do I see the real Poetry connection error?
Run the command with -v and read the Caused by part of the HTTPSConnectionPool line.
Written with AI assistance. Measured on 2026-10-23 with Poetry 2.5.1 on Python 3.13.5 (Linux) against a local HTTPS index, a closed port and an unresolvable hostname. Each transcript was produced by running the commands verbatim. PlainHeaders is our extension; Poetry is free.