Forum: PC Hard- und Software add-apt-repository, python kommt durch proxy nicht mehr hinaus
Moin zusammen,
ich stehe gerade auf dem Schlauch und komme nicht weiter.
Es betrifft ein frisch re-installiertes Ubuntu bionic. Das Gerät hängt,
nach wie vor, netzwerktechnisch unverändert - an gleicher Stelle im
gleichen Subnetz.
Infrastruktur: Oben drüber sitzt eine OPNsense, die sich für einige
Subnetze kümmert. Sie fängt u.a. samtlichen http, https, ftp-Verkehr ab
und leitet ihn transparent durch den Proxy. Ausreißer und Kandidaten die
aus der Reihe tanzen, werden umgeschrieben und durch den Proxy mit
Filter gezwungen. Direkte Ausgänge vorbei herum gibt es nicht, sie
ersticken im Timeout.
Für Paketierungsanfragen (apt) steht, eine Ebene darüber, ein apt-cacher
zur Verfügung. An ihn werden alle Paketanfragen, aller Geräte aus allen
Subnetzen gerichtet. Auch er verrichtet seinen Dienst sehr lobenswert.
Bei der frischen Neuinstallation sind die proxy-exports gesetzt (in
klein und groß). Alle apt-Aktionen funktionieren und finden den
apt-cacher ohne Verzögerung oder zu murren.
Problem stellt nur add-apt-repository dar. Etwa ein-zwei Minuten kommt
nichts, dann ein Timeout in Form 1 | sudo add-apt-repository ppa:kicad/kicad-5.1-releases
| 2 | Cannot add PPA: 'ppa:~kicad/ubuntu/kicad-5.1-releases'.
| 3 | ERROR: '~kicad' user or team does not exist.
|
Wenn ich das ganze vorher abbreche, sehe ich 1 | sudo add-apt-repository ppa:kicad/kicad-5.1-releases
| 2 | ^CTraceback (most recent call last):
| 3 | File "/usr/bin/add-apt-repository", line 137, in <module>
| 4 | shortcut = shortcut_handler(line)
| 5 | File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 868, in shortcut_handler
| 6 | ret = factory(shortcut)
| 7 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 398, in shortcut_handler
| 8 | return PPAShortcutHandler(shortcut)
| 9 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 355, in __init__
| 10 | info = get_ppa_info(self.shortcut)
| 11 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 326, in get_ppa_info
| 12 | ret = get_ppa_info_from_lp(user, ppa)
| 13 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 101, in get_ppa_info_from_lp
| 14 | return get_info_from_lp(lp_url)
| 15 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 95, in get_info_from_lp
| 16 | return get_info_from_https(lp_url, True)
| 17 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 88, in get_info_from_https
| 18 | data = _get_https_content_py3(url, accept_json)
| 19 | File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 120, in _get_https_content_py3
| 20 | lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
| 21 | File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
| 22 | return opener.open(url, data, timeout)
| 23 | File "/usr/lib/python3.6/urllib/request.py", line 526, in open
| 24 | response = self._open(req, data)
| 25 | File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
| 26 | '_open', req)
| 27 | File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
| 28 | result = func(*args)
| 29 | File "/usr/lib/python3.6/urllib/request.py", line 1368, in https_open
| 30 | context=self._context, check_hostname=self._check_hostname)
| 31 | File "/usr/lib/python3.6/urllib/request.py", line 1325, in do_open
| 32 | encode_chunked=req.has_header('Transfer-encoding'))
| 33 | File "/usr/lib/python3.6/http/client.py", line 1281, in request
| 34 | self._send_request(method, url, body, headers, encode_chunked)
| 35 | File "/usr/lib/python3.6/http/client.py", line 1327, in _send_request
| 36 | self.endheaders(body, encode_chunked=encode_chunked)
| 37 | File "/usr/lib/python3.6/http/client.py", line 1276, in endheaders
| 38 | self._send_output(message_body, encode_chunked=encode_chunked)
| 39 | File "/usr/lib/python3.6/http/client.py", line 1042, in _send_output
| 40 | self.send(msg)
| 41 | File "/usr/lib/python3.6/http/client.py", line 980, in send
| 42 | self.connect()
| 43 | File "/usr/lib/python3.6/http/client.py", line 1434, in connect
| 44 | super().connect()
| 45 | File "/usr/lib/python3.6/http/client.py", line 952, in connect
| 46 | (self.host,self.port), self.timeout, self.source_address)
| 47 | File "/usr/lib/python3.6/socket.py", line 713, in create_connection
| 48 | sock.connect(sa)
| 49 | KeyboardInterrupt
|
OK, python hat anscheinend Probleme hinaus zu kommen.
Hier die entsprechende(n) Verbindung(en) zur Anfrage. 1 | Proto Recv-Q Send-Q Local Address Foreign Address State
| 2 | tcp 0 0 10.16.1.50:38426 10.16.1.254:3128 VERBUNDEN
| 3 | tcp 0 1 10.16.1.50:42078 91.189.89.223:443 SYN_SENT
| 4 | tcp 0 0 10.16.1.50:39954 10.16.1.254:3128 TIME_WAIT
|
Am Proxy sehe ich keine Anfrage, auch kein deny oder die Umleitung, die
folgen sollte. Die 2+3 Verbindung hier wurde auch nicht abgefangen und
umgeschrieben.
Ein kleiner check 1 | nslookup 91.189.89.223
| 2 | 223.89.189.91.in-addr.arpa name = launchpad-net.banana.canonical.com.
|
Ich kann mich nicht erinnern, dass es jemals (bis xenial) wo anders, als
unter *.launchpad.net abgelegt war.
Zumindest habe/hatte ich bisher canonical.com auf der Unbound DNS
blacklist. Und die muss unter allen Umständen wieder da drauf :)
Gut, ich könnte nun eine weitere Sonderwurscht eintragen 1 | cat /etc/apt/apt.conf
| 2 | Acquire::ForceIPv4 "true";
| 3 | Acquire::http::Proxy::localhost "DIRECT";
| 4 | Acquire::http::Proxy::cronet.local "DIRECT";
| 5 | Acquire::https::Proxy::download.oracle.com "DIRECT";
| 6 | Acquire::https::Proxy::download.docker.com "DIRECT";
| 7 | Acquire::https::Proxy::registry-1.docker.io "DIRECT";
| 8 | Acquire::https::Proxy::deb.nodesource.com "DIRECT";
| 9 | Acquire::https::Proxy::packages.grafana.com "DIRECT";
| 10 | Acquire::https::Proxy::repos.influxdata.com "DIRECT";
| 11 | Acquire::http { Proxy "http://192.168.178.55:3142"; };
| 12 | Acquire::https { Proxy "http://192.168.178.55:3142"; };
| 13 | Acquire::ftp { Proxy "http://192.168.178.55:3142"; };
|
nur kann das nicht die Lösung sein. Bis xenial hatte ich damit keinen
Stress.
Wäre es nur das add-apt-repository könnte man ja die Äuglein zudrücken.
Nur geht es weiter mit pip3 und anderen python-Zeugs.
Habt ihr Ideen, Vorschläge oder gar eine Lösung?
Wie bringe ich python den Proxybetrieb nun bei? Was wurde verändert,
dass er/es sich weder an ${https_proxy}, noch apt.conf hält?
Segelt launchpad nun endgültig unter Canonical-Flagge und schleust
weitere Sauereien ein?
...
Hier ist was https://pypi.org/project/proxy.py/
1 | sudo apt install python-pip python3-pip
| 2 | pip3 install --upgrade proxy.py
|
Nur dumm, dass pip/pip3 nicht am Proxy vorbei kommt, um sich das plugin
für den Proxy zu installieren, damit es später benutzt werden kann.
Hirn lass es regnen :)
---
Nachtrag: 1 | export https_proxy=https://10.16.1.254:3128
| 2 | export http_proxy=$https_proxy
| 3 | export ftp_proxy=$https_proxy
| 4 | pip3 completion --bash >> ~/.profile
| 5 | pip3 install --proxy ${https_proxy} --upgrade setuptools
| 6 | pip3 install --proxy ${https_proxy} --upgrade proxy
|
OK, das funktioniert schon mal. Vorher gehe ich eine Runde schlafen...
Es hat mir keine Ruhe gegeben. Hier die finale Lösung:
1 | sudo visudo
| 2 | Defaults env_keep+="http_proxy https_proxy no_proxy"
|
Entschuldigt bitte das zutexten und geführte Selbstgespräch. Es war eine
lange Nacht.
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
|