genotrance / px

An HTTP proxy server to automatically authenticate through an NTLM proxy
MIT License
952 stars 98 forks source link

APT periodically receiving response code 444 during updates #113

Closed kusalk closed 2 years ago

kusalk commented 4 years ago

This error occurs even when PX has no proxy configured. So I suspect the issue is not related to communication with the proxy but the way PX passes thru connections.

APT output:

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-meta/ubuntu-wsl_1.450.2_amd64.deb  444   [IP: 127.0.0.1 3128]

PX logs:

Process-1: Thread_2: 1599439182: do_GET: Entering
Process-1: Thread_2: 1599439182: do_GET: Path = http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-meta/ubuntu-wsl_1.450.2_amd64.deb
Process-1: Thread_2: 1599439182: do_transaction: Entering
Process-1: Thread_2: 1599439182: get_destination: archive.ubuntu.com:80
Process-1: Thread_2: 1599439182: load_proxy: Skip proxy refresh
Process-1: Thread_2: 1599439182: find_proxy_for_url: Proxy found: <redacted>,<redacted>
Process-1: Thread_2: 1599439182: get_destination: Proxy from PAC = <redacted>,<redacted>
Process-1: Thread_2: 1599439182: get_response_wkb: winkerberos SSPI
Process-1: Thread_2: 1599439182: fwd_data: Reading response data
Process-1: Thread_2: 1599439182: do_socket: Entering
Process-1: Thread_2: 1599439182: do_socket: GET http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-meta/ubuntu-wsl_1.450.2_amd64.deb HTTP/1.1
Process-1: Thread_2: 1599439182: do_socket: Sending Host: archive.ubuntu.com
Process-1: Thread_2: 1599439182: do_socket: Sending User-Agent: Debian APT-HTTP/1.3 (2.0.2ubuntu0.1)
Process-1: Thread_2: 1599439182: do_socket: Sending extra Proxy-Authorization: sanitized len(2750)
Process-1: Thread_2: 1599439182: do_socket: Sending extra b'Connection: Keep-Alive'
Process-1: Thread_2: 1599439182: do_socket: Reading response code
Process-1: Thread_2: 1599439182: do_socket: Bad response b''
Process-1: Thread_2: 1599439182: do_socket: Client closed connection
Process-1: Thread_2: 1599439182: do_transaction: No auth required cached
Process-1: Thread_2: 1599439182: do_GET: Error 444
Process-1: Thread_2: 1599439182: fwd_resp: Entering
Process-1: Thread_2: 1599439182: log_message: "GET http://archive.ubuntu.com/ubuntu/pool/main/u/ubuntu-meta/ubuntu-wsl_1.450.2_amd64.deb HTTP/1.1" 444 -
Process-1: Thread_2: 1599439182: fwd_data: Reading response data
Process-1: Thread_2: 1599439182: fwd_resp: Done
Process-1: Thread_2: 1599439182: do_GET: Done

Error can generally be reproduced with the following (there must be pending OS updates). Note that repeated runs of the command may not throw an error (not reliably reproducible).

sudo apt upgrade

Also note that APT has its own proxy configuration and does not respect env variables.

cswgr commented 3 years ago

Have the same problem described here: https://github.com/genotrance/px/issues/100

genotrance commented 2 years ago

I've made some minor tweaks and no longer see any 444s with apt. Any testing with the latest versions will be appreciated.