Skip to content

GH Actions: work around intermittent apt-get errors - #322

Merged
sirbrillig merged 1 commit into
2.xfrom
feature/ghactions-xmllint-bypass-apt-get-update
Apr 24, 2024
Merged

sirbrillig merged 1 commit into
2.xfrom
feature/ghactions-xmllint-bypass-apt-get-update

Conversation

@jrfnl

@jrfnl jrfnl commented Apr 24, 2024

Copy link
Copy Markdown
Collaborator

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:

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
@jrfnl
jrfnl requested a review from sirbrillig April 24, 2024 11:16

@sirbrillig sirbrillig left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fascinating. Thanks for spotting it and coming up with a workaround!

@sirbrillig
sirbrillig merged commit bb070b8 into 2.x Apr 24, 2024
@sirbrillig
sirbrillig deleted the feature/ghactions-xmllint-bypass-apt-get-update branch April 24, 2024 14:41
@jrfnl

jrfnl commented Apr 24, 2024

Copy link
Copy Markdown
Collaborator Author

@sirbrillig Yes, this was an interesting WTF indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants