Skip to content

Commit d1b3f7d

Browse files
committed
GH Actions: work around intermittent apt-get errors
Okay, so apparently, there is a long-standing bug in the Microsoft package deploy process which caused `apt-get update` to fail in the first half hour after Microsoft has deployed a package. The failure looks like this: ``` E: Failed to fetch https://packages.microsoft.com/ubuntu/22.04/prod/dists/jammy/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) ``` As this only happens intermittently (after a MS package deploy), the chance of running into this bug are slim, but guess what: today I ran into it. This change to the workflow is intended to prevent the next person running into this issue from having to waste time on figuring this out. By splitting the "Install xmllint" step into two steps: one doing the `apt-get update` and one doing the actual install and making the first step one which is allowed to `continue-on-error`, this issue should hopefully not crop up anymore. Any errors in the `apt-get update` step will now be ignored and as most errors which could potentially come from that step are irrelevant for the rest of the job anyway, this is fine. If a relevant error would be surfaced, the next step (the xmllint install), will fail the job anyway. Refs: * actions/runner-images#3410 * dotnet/core#4167
1 parent bdc6304 commit d1b3f7d

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

.github/workflows/cs.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ jobs:
5353
# Bust the cache at least once a month - output format: YYYY-MM.
5454
custom-cache-suffix: $(date -u "+%Y-%m")
5555

56+
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
57+
# This should not be blocking for this job, so ignore any errors from this step.
58+
# Ref: https://github.com/dotnet/core/issues/4167
59+
- name: Update the available packages list
60+
continue-on-error: true
61+
run: sudo apt-get update
62+
5663
# @link http://xmlsoft.org/xmllint.html
5764
- name: Install xmllint
58-
run: |
59-
sudo apt-get update
60-
sudo apt-get install --no-install-recommends -y libxml2-utils
65+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
6166

6267
- name: Download the XSD schema
6368
run: curl http://www.w3.org/2001/XMLSchema.xsd --output XMLSchema.xsd

.github/workflows/quicktest.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ jobs:
3838
- name: Checkout code
3939
uses: actions/checkout@v4
4040

41+
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
42+
# This should not be blocking for this job, so ignore any errors from this step.
43+
# Ref: https://github.com/dotnet/core/issues/4167
44+
- name: Update the available packages list
45+
continue-on-error: true
46+
run: sudo apt-get update
47+
4148
- name: Install xmllint
42-
run: |
43-
sudo apt-get update
44-
sudo apt-get install --no-install-recommends -y libxml2-utils
49+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
4550

4651
# On stable PHPCS versions, allow for PHP deprecation notices.
4752
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ jobs:
8282
- name: Checkout code
8383
uses: actions/checkout@v4
8484

85+
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
86+
# This should not be blocking for this job, so ignore any errors from this step.
87+
# Ref: https://github.com/dotnet/core/issues/4167
88+
- name: Update the available packages list
89+
continue-on-error: true
90+
run: sudo apt-get update
91+
8592
- name: Install xmllint
86-
run: |
87-
sudo apt-get update
88-
sudo apt-get install --no-install-recommends -y libxml2-utils
93+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
8994

9095
- name: Setup ini config
9196
id: set_ini

0 commit comments

Comments
 (0)