Looks like snapshot.debian.org shuts down the SDK container mid-build

Had a spooky thing just start happening in the middle of the day, while adding project build dependencies to my VSCode TorizonCore extension based c++ project:

[06-15 16:24:07.577] Get:13 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 libdbus-1-3 amd64 1.12.20-1 [217 kB]
[06-15 16:24:08.328] Get:14 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 dbus amd64 1.12.20-1 [238 kB]
[06-15 16:24:08.830] Get:15 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 libglib2.0-0 amd64 2.64.4-1 [1341 kB]
[06-15 16:24:09.626] Err:16 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 shared-mime-info amd64 1.15-1
  Could not connect to snapshot.debian.org:80 (193.62.202.27). - connect (111: Connection refused) [IP: 193.62.202.27 80]
Err:17 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 libdouble-conversion3 amd64 3.1.5-5
  Unable to connect to snapshot.debian.org:http: [IP: 193.62.202.27 80]
[06-15 16:24:09.635] Err:18 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 libpcre2-16-0 amd64 10.34-7
  Unable to connect to snapshot.debian.org:http: [IP: 193.62.202.27 80]

Notice that snapshot.debian.org basically hangs up on apt mid build. My host network is completely fine, I can manually and wget all these packages from my host.
This is from a fresh host restart, the only thing I’ve done from VSCode is run the “Rebuild SDK” command. Looks like it’s rate/request limiting on the server side right??

Running it again, it doesn’t always fail at the exact same step either. This time it can grip the mime-info package, while before it couldn’t:

 [06-15 16:38:59.369] Get:16 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 shared-mime-info amd64 1.15-1 [789 kB]

[06-15 16:38:59.976] Err:17 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 libdouble-conversion3 amd64 3.1.5-5

Could not connect to snapshot.debian.org:80 (193.62.202.27). - connect (111: Connection refused) [IP: 193.62.202.27 80]

Err:18 http://snapshot.debian.org/archive/debian/20200908T070000Z bullseye/main amd64 libpcre2-16-0 amd64 10.34-7

Unable to connect to snapshot.debian.org:http: [IP: 193.62.202.27 80]

Any guidance as to how to work around this seemingly uncontrollable error/bug in two stage build process??

Greetings @edbear,

This is actually a known issue. Just to explain, since Debian Bullseye is not “stable” release from Debian we use snapshots for the packaging so that we have a somewhat stable package-set for the time being. How this differs is that the snapshot servers have limits on them to prevent DoS attacks essentially. Which is why sometimes you can observe the connection errors.

At the moment possible workarounds are limited. The most common workaround would be to try again later when the servers are less loaded. Another workaround that we’ve seen somewhat work is to rate limit apt-get. For example: apt-get -o Acquire::http::Dl-Limit=500

However since you’re using the extension where Dockerfile is auto-generated that 2nd option may be difficult to implement. The good news though is, next month Debian Bullseye will enter in hard freeze mode. Which will possibly enable us to move off the snapshot feeds which should alleviate the server limit issues.

Therefore my suggestion in the short-term would be to just bear with it, since in the long-term this hopefully sorts itself out.

However I will check with the team internally to see if there is something else we could possibly do.

Best Regards,
Jeremias