Seite 1 von 1

opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 15 Feb 2022, 12:59
von dassit-steffens
Anscheinend unterstützt zsync2 keine Proxy Nutzung. In dem Fall hängt es dann minutenlang, bevor es fehlschlägt dann der Fallback auf direkten Download greift:

Code: Alles auswählen

 opsi-package-updater -v update win10-x64
[5] [2022-02-15 12:25:18.152] [               ] win10-x64_4.2.0.1-7.opsi - installation required: a more recent version of product 'win10-x64' was found (installed: 4.2.0.1-4, available: 4.2.0.1-7) and auto update is set for repository 'uib_windows'   (Updater.py:607)
[5] [2022-02-15 12:25:18.175] [               ] win10-x64_4.2.0.1-7.opsi - download of package is required: found local package win10-x64_4.2.0.1-4.opsi which differs from available   (Updater.py:586)
[3] [2022-02-15 12:29:40.397] [               ] Zsync of 'http://download.uib.de/opsi4.2/stable/packages/windows/netboot/win10-x64_4.2.0.1-7.opsi' failed: Command ['/usr/bin/zsync2', '-o', '/var/lib/opsi/repository/win10-x64_4.2.0.1-7.opsi', 'http://download.uib.de/opsi4.2/stable/packages/windows/netboot/win10-x64_4.2.0.1-7.opsi.zsync'] failed with exit code 3: zsync2 version 2.0.0-alpha-1 (commit ), build <local dev build> built on 2021-12-09 16:14:28 UTC
Checking for changes...
Failed to connect to download.uib.de port 80: Connection timed out
Reading and/or parsing .zsync file failed!
Failed to check for changes!
   (Updater.py:686)
[4] [2022-02-15 12:29:40.423] [               ] win10-x64: zsync download has failed, trying full download   (Updater.py:654)
...
Ein einzelner Aufruf von zsync2 scheint das zu bestätigen:

Code: Alles auswählen

/usr/bin/zsync2 -vvv -o /tmp/win10-x64_4.2.0.1-7.opsi http://download.uib.de/opsi4.2/stable/packages/windows/netboot/win10-x64_4.2.0.1-7.opsi.zsync
zsync2 version 2.0.0-alpha-1 (commit ), build <local dev build> built on 2021-12-09 16:14:28 UTC
Checking for changes...
Failed to connect to download.uib.de port 80: Connection timed out
Reading and/or parsing .zsync file failed!
Failed to check for changes!
Per lsof sieht man auch, dass nur ein direkter Zugriff versucht wird:

Code: Alles auswählen

sof -p 5931
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/110/gvfs
      Output information may be incomplete.
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
zsync2  5931 root  txt    REG    8,1   387432 3623239 /usr/bin/zsync2
...
zsync2  5931 root    3u  IPv4  51612      0t0     TCP opsi.example.com:39958->download.uib.de:http (SYN_SENT)
Unter /etc/opsi/package-updater.repos.d/*.repo ist proxy gesetzt (sonst würde es über HTTP direkt auch nicht funktionieren). Die Variablen http_proxy und https_proxy sind ebenfalls gesetzt.

Umgebung:

Code: Alles auswählen

Ubuntu 18.04

export | grep proxy
http_proxy="http://proxy:3128"
https_proxy="http://proxy:3128

ii  zsync2         2.0.0-alpha-2 amd64        A rewrite of the advanced file download/sync tool zsync.
ii  opsi-server          4.2.0.57-1   all          opsi server

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 15 Feb 2022, 19:24
von j.schneider
Hallo,

zsync2 unterstützt Proxies.
Warum das in dieser Umgebung nicht funktioniert, müssen wir uns genauer anschauen.

Wie ist die Ausgabe von:

Code: Alles auswählen

http_proxy="http://proxy:3128" /usr/bin/zsync2 -vvv -o /tmp/win10-x64_4.2.0.1-7.opsi http://download.uib.de/opsi4.2/stable/packages/windows/netboot/win10-x64_4.2.0.1-7.opsi.zsync

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 15 Feb 2022, 19:33
von j.schneider
So sieht das auf einem unserer Test-Systeme aus:

Code: Alles auswählen

root@bionic:~# http_proxy="http://10.10.10.10:3128" /usr/bin/zsync2 -vvv -o /tmp/win10-x64_4.2.0.1-7.opsi http://download.uib.de/opsi4.2/stable/packages/windows/netboot/win10-x64_4.2.0.1-7.opsi.zsync
zsync2 version 2.0.0-alpha-1 (commit ), build <local dev build> built on 2021-12-09 14:47:04 UTC
Checking for changes...
Cannot find file /tmp/win10-x64_4.2.0.1-7.opsi, triggering full download
/tmp/win10-x64_4.2.0.1-7.opsi.part found, using as seed file
Target file: /tmp/win10-x64_4.2.0.1-7.opsi
Reading seed file: /tmp/win10-x64_4.2.0.1-7.opsi.part
Usable data from seed files: 0.000000%
Renaming temp file
Fetching remaining blocks
Downloading from http://download.uib.de/opsi4.2/stable/packages/windows/netboot/win10-x64_4.2.0.1-7.opsi

-------------------- 0.0%*   Trying 10.10.10.10...
* TCP_NODELAY set


Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 16 Feb 2022, 13:37
von skoloschin
Moin,
unter Debian 10 funktioniert zsync auch nicht einwandfrei. Es wird zwar über den Proxy angezeigt, welche Updates es gibt, aber der Download schlägt fehl. Es gibt aber ja die Option --no-zsync für den Updater, dann klappt es sofort.
Gruß
Sigi

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 16 Feb 2022, 13:41
von j.schneider
Auch das kann man nicht verallgemeinern.
Es sollte geprüft werden, ob der Proxy HTTP range requests unterstützt.
Ohne diese kann zsync nicht funktionieren.
Neuere Versionen der opsi-utils prüfen, ob range requests unterstützt werden und nutzen nur in diesem Fall zsync.

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 17 Feb 2022, 10:20
von skoloschin
Guter Tipp! Das wird in unserem Squid nicht konfiguriert sein, da noch nie gebraucht.

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 17 Feb 2022, 10:34
von j.schneider
Ich wäre dankbar für eine Rückmeldung, ob das funktioniert hat.
Und wenn es funktioniert welche Konfiguration am Squid nötig war.
Danke!

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 21 Feb 2022, 06:42
von dth2906
Hallo,

hat leider nicht funktioniert:
http_proxy="http://xxxxxxx:3128" /usr/bin/zsync2 -vvv -o /tmp/win10-x64_4.2.0.1-7.opsi http://download.uib.de/opsi4.2/stable/p ... opsi.zsync
zsync2 version 2.0.0-alpha-1 (commit ), build <local dev build> built on 2021-12-09 16:14:28 UTC
Checking for changes...
Failed to connect to download.uib.de port 80: Connection timed out
Reading and/or parsing .zsync file failed!
Failed to check for changes!

Ist ein Checkpoint Proxy unserer Datenzentrale, an dem wir leider keine Änderungen vornehmen können.

Re: opsi-package-updater: zsync2 mit proxy schlägt fehl

Verfasst: 22 Feb 2022, 14:40
von j.schneider
Aufgrund der anhaltenden Probleme mit zsync2 in einigen Umgebungen, haben wir uns dazu entschlossen zukünftig zsync-curl zu verwenden.
Ich hoffe, dass sich damit auch die Unterstützung von HTTP-Proxies verbessert.

viewtopic.php?t=12882