Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error handling 3 #255

Merged
merged 26 commits into from
Dec 22, 2023
Merged

improve error handling 3 #255

merged 26 commits into from
Dec 22, 2023

Conversation

adrelanos
Copy link
Contributor

@adrelanos
Copy link
Contributor Author

Debian stretch build still failing as mentioned earlier in #248 (comment).

But not an issue introduced by this PR. This PR here makes the issue only visible.

I compared with an arbitrary different recent PR. A PR not authored by me. Namely this PR:

Here is the relevant excerpt from the other PR build log:

2023-11-18T11:48:47.2487870Z Err:7 http://security.debian.org stretch/updates/main amd64 Packages
2023-11-18T11:48:47.2488469Z   404  Not Found
2023-11-18T11:48:47.2529303Z Get:9 http://archive.debian.org/debian stretch/main Translation-en [5377 kB]
2023-11-18T11:48:47.2586326Z Ign:8 http://security.debian.org stretch/updates/main Translation-en
2023-11-18T11:48:48.6862318Z Fetched 5380 kB in 1s (2900 kB/s)
2023-11-18T11:48:49.1516508Z Reading package lists...
2023-11-18T11:48:49.1748396Z W: The repository 'http://security.debian.org stretch/updates Release' does not have a Release file.
2023-11-18T11:48:49.1750626Z E: Failed to fetch http://security.debian.org/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found
2023-11-18T11:48:49.1752139Z E: Some index files failed to download. They have been ignored, or old ones used instead.

This issue seems parmement. And also not worth reporting to Debian as stretch doesn't have security support by Debian anymore anyhow.

Potential solutions:

  • A) Dropping support for Debian stretch. This requires the least code. I am not a big fan of supporting legacy versions but you might have other requirements here.

Quote https://wiki.debian.org/DebianStretch

Security updates have been discontinued as of 2020-07-06.

  • B) Not enabling the security repository for Debian stretch builds.
  • C) Adding || true for invocations of $APTUPDATE (and similar) but only for Debian stretch builds. Not a fan of this.

I'll attempt to implement option B) for now until I receive other feedback.

@adrelanos
Copy link
Contributor Author

All tests are passing now except shellcheck but these seem to be unrelated to this PR.

I would appreciate some feedback on how to proceed with this PR.

grml-debootstrap Outdated
@@ -257,7 +257,9 @@ cleanup() {

# Remove temporary mountpoint again
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
rmdir "$MNTPOINT" 2>/dev/null
if test -d "$MNTPOINT" ; then
Copy link
Member

Choose a reason for hiding this comment

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

please use if [ -d .... style here, as we do elsewhere in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

May I.

  • A) simply add a commit on top (preferred, easier for me) or,
  • B) should I (learn to) modify the existing commit and fix the style?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed after force push just now.

if stage $i ; then
$i
stage $i 'done'
if stage "$i" ; then
Copy link
Member

Choose a reason for hiding this comment

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

leaving the comment here, since on GitHub one sadly can't seem to comment on the commit message itself, AFAICS: the change itself LGTM, though please use something like "chroot-script: properly quote stage execution code" in the commit message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This means I should leave most commit messages as is but modify this specific commit message?

Copy link
Member

Choose a reason for hiding this comment

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

I'd be more than happy to get nice commit messages! This one only clearly jumped into my eye :) So please feel free and invited to the reword your commit messages (and also squash logically related commits!), so they tell a nice story when going through them, but also have a (somewhat) nice state/story for debian/changelog (the first line of each commit message message shows up there by default when I release a new version, see gbp dch!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was about to suggest, I was hoping, all of these commits could be squashed into 1. These changes aren't really interesting for users. Just "improved error handling".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I rewrote this commit message, grouped together and also improved other commit messages.

unstable|sid) ;; # no security pool available
jessie|stretch|buster)
unstable|sid|stretch) ;; # no security pool available
jessie|buster)
Copy link
Member

Choose a reason for hiding this comment

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

are you sure this change makes sense? stretch is in between jessie and buster (see https://wiki.debian.org/DebianReleases)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, I am sure. The repository is defunct but not worth reporting upstream to Debian because that suite is end of life.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, but then at least jessie should be affected as well, nor? :)
Also see http://archive.debian.org/debian-security/dists/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In theory, I agree. It should also be affected. But in practice, it's not as I could see from the CI tests. I don't have an explanation why it is as is. I just noticed that oddly 1 Debian security repository for an EOL suite is broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Porting to archive.debian.org might fix this issue but lets consider that a separate issue that is not worth doing for an EOL suite? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not that not enabling security repository for stretch didn't reduce the security or change installed packages.

  • Previously: the stretch build would just show an error message that the stretch repository is unavailable, ignore it, and proceed.
  • After this PR that enabled strict error checking: That resulted in a build failure so we at least know something is wrong. It only made this issue apparent. But the issue was there all along even if nobody noticed.This PR however didn't worsen anything. Well, could argue in theory if that stretch security repository ever comes back online then it's missing from these builds. If that is considered an issue then indeed code to make stretch use archive.debian.org might be required.

chroot-script Outdated
@@ -480,6 +480,10 @@ EOF
local rootfs_mount_options=""

if [ -z "${FILESYSTEM}" ] ; then
## Debugging.
ls -la /dev/disk/by-uuid/"${TARGET_UUID}"
blkid /dev/disk/by-uuid/"${TARGET_UUID}"
Copy link
Member

Choose a reason for hiding this comment

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

no reason to leave this commit in this PR, nor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Removed after force push. Done.

@mika
Copy link
Member

mika commented Dec 7, 2023

All tests are passing now except shellcheck but these seem to be unrelated to this PR.

Ok great

I would appreciate some feedback on how to proceed with this PR.

Yeah I think we can go forward with this, I left comments on some of the commits, and think we should get rid of the debugging related changes that shouldn't be part of the main grml-debootstrap? (No objections to enable debugging code when running with --debug option or alike though!)

because these are now covered by the error_handler
No need to use both, `eend 1` and `bailout 1`.
In these cases, only `bailout 1` is sufficient.
@adrelanos
Copy link
Contributor Author

I've hopefully addressed all your feedback. Please kindly let me know if there's other blockers to get this merged.

There's a new related issue which is triggered (but not caused) by this PR for which I created a separate issue:

@mika mika merged commit bfe0fed into grml:master Dec 22, 2023
34 of 40 checks passed
@mika
Copy link
Member

mika commented Dec 22, 2023

Sorry for the delay, finally found some spare minutes to take care of this. Thanks for all your work around this, @adrelanos ! 👍

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.

error not caught
2 participants