Closed Zebradil closed 2 years ago
Thanks again for reporting this!
Any ideas how to debug this further?
I have all I need to know, since you have mentioned:
Looking at logs in journal reveals that flexo panics on unwrap here.
Flexo is supposed to work well even if individual mirrors behave strangely, so the correct behavior would be to try the next mirror if that mirror does not respond with the content length. Just assuming the content length is set and panicking when it's not is incomplete error handling which leads to Flexo not being as robust as it's supposed to be.
Flexo panics when I try to upgrade system on one of my machines.
I have three machines: "Mirror" (M) which runs flexo (and also uses it as a mirror) and two "clients" (A and B) which uses M as their mirror.
When I'm running
pacman -Suy
on one of the machines I'm getting errors.Looking at logs in journal reveals that flexo panics on
unwrap
here. If I understood correctly, this happens because a remote mirror's response doesn't containcontent-length
header. Unfortunately, I was not able to see which exact remote mirror it is.Logs
``` Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.178Z DEBUG flexo] Established connection with client. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.178Z DEBUG flexo] All set, spawning new thread. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.178Z DEBUG flexo] Established connection with client. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] All set, spawning new thread. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Started new thread. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Reading header from client. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo::mirror_flexo] Received header from client Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Schedule new job Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Established connection with client. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] All set, spawning new thread. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Started new thread. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Reading header from client. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Job was scheduled, will serve from growing file Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo::mirror_flexo] Received header from client Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Started new thread. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Reading header from client. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Schedule new job Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo::mirror_flexo] Received header from client Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Attempt number 1 Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Schedule new job Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo::provider_guards] Selected DownloadProvider { uri: "https://archmirror.it/repos/", name: "https://archmirror.it/repos/", mirror_results: MirrorResults { total_time: 0ns, namelookup_duration: 0ns, connect_duration: 0ns, pretransfer_time: 0ns, starttransfer_time: 0ns }, country_code: "Unknown" }, number of usages: 1 [ThreadId(5)] Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Selected provider: ProviderGuard { guarded_provider: DownloadProvider { uri: "https://archmirror.it/repos/", name: "https://archmirror.it/repos/", mirror_results: MirrorResults { total_time: 0ns, namelookup_duration: 0ns, connect_duration: 0ns, pretransfer_time: 0ns, starttransfer_time: 0ns }, country_code: "Unknown" } } Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Trying to serve core/os/x86_64/core.db via https://archmirror.it/repos/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] No providers are left after this provider? false Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Job was scheduled, will serve from growing file Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Attempt to establish new connection Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.179Z DEBUG flexo] Establish a new connection to https://archmirror.it/repos/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Job was scheduled, will serve from growing file Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Attempt to create file: "/tmp/flexo/uncacheable/core/os/x86_64/core.db-6357ff0a-9e28-4275-964b-f9cfb058b651" Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Attempt number 1 Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Attempt number 1 Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::provider_guards] Selected DownloadProvider { uri: "https://mirror.osbeck.com/archlinux/", name: "https://mirror.osbeck.com/archlinux/", mirror_results: MirrorResults { total_time: 0ns, namelookup_duration: 0ns, connect_duration: 0ns, pretransfer_time: 0ns, starttransfer_time: 0ns }, country_code: "Unknown" }, number of usages: 1 [ThreadId(7)] Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Selected provider: ProviderGuard { guarded_provider: DownloadProvider { uri: "https://mirror.osbeck.com/archlinux/", name: "https://mirror.osbeck.com/archlinux/", mirror_results: MirrorResults { total_time: 0ns, namelookup_duration: 0ns, connect_duration: 0ns, pretransfer_time: 0ns, starttransfer_time: 0ns }, country_code: "Unknown" } } Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Fetch package from remote mirror: https://archmirror.it/repos/core/os/x86_64/core.db. Resume from byte 0. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] No speed limit was set. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Trying to serve community/os/x86_64/community.db via https://mirror.osbeck.com/archlinux/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::provider_guards] Selected DownloadProvider { uri: "https://ftp.halifax.rwth-aachen.de/archlinux/", name: "https://ftp.halifax.rwth-aachen.de/archlinux/", mirror_results: MirrorResults { total_time: 0ns, namelookup_duration: 0ns, connect_duration: 0ns, pretransfer_time: 0ns, starttransfer_time: 0ns }, country_code: "Unknown" }, number of usages: 1 [ThreadId(6)] Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] No providers are left after this provider? false Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Start download from https://archmirror.it/repos/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Selected provider: ProviderGuard { guarded_provider: DownloadProvider { uri: "https://ftp.halifax.rwth-aachen.de/archlinux/", name: "https://ftp.halifax.rwth-aachen.de/archlinux/", mirror_results: MirrorResults { total_time: 0ns, namelookup_duration: 0ns, connect_duration: 0ns, pretransfer_time: 0ns, starttransfer_time: 0ns }, country_code: "Unknown" } } Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Attempt to establish new connection Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Trying to serve extra/os/x86_64/extra.db via https://ftp.halifax.rwth-aachen.de/archlinux/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] No providers are left after this provider? false Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Establish a new connection to https://mirror.osbeck.com/archlinux/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Attempt to establish new connection Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Attempt to create file: "/tmp/flexo/uncacheable/community/os/x86_64/community.db-c9916ddb-29f5-42aa-b192-4431e10e3302" Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Fetch package from remote mirror: https://mirror.osbeck.com/archlinux/community/os/x86_64/community.db. Resume from byte 0. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo] Establish a new connection to https://ftp.halifax.rwth-aachen.de/archlinux/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] No speed limit was set. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Start download from https://mirror.osbeck.com/archlinux/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.180Z DEBUG flexo::mirror_flexo] Attempt to create file: "/tmp/flexo/uncacheable/extra/os/x86_64/extra.db-995e92a5-43cf-448c-bd17-76574e2eef9a" Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.181Z DEBUG flexo::mirror_flexo] Fetch package from remote mirror: https://ftp.halifax.rwth-aachen.de/archlinux/extra/os/x86_64/extra.db. Resume from byte 0. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.181Z DEBUG flexo::mirror_flexo] No speed limit was set. Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.181Z DEBUG flexo::mirror_flexo] Start download from https://ftp.halifax.rwth-aachen.de/archlinux/ Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.312Z DEBUG flexo::mirror_flexo] Received complete header from remote mirror Sep 28 20:11:36 home flexo[507945]: [2021-09-28T20:11:36.312Z DEBUG flexo::mirror_flexo] HTTP response code is 200 Sep 28 20:11:36 home flexo[507945]: thread 'Any ideas how to debug this further?
UPD: I'm using a predefined list of mirrors and regenerating the list resolves the issue. But I'm still puzzled: why this error was reproducible only on one machine...