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

docker: print HTTP errors on failure #10929

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

pjonsson
Copy link
Contributor

@pjonsson pjonsson commented Oct 4, 2024

What does this PR do?

The -q parameter to wget makes it completely
silent, even on faliure which gives build errors
that are difficult to diagnose. Someone
else had the same problem 15 years ago:

https://serverfault.com/questions/70889/wget-to-print-errors-but-nothing-otherwise

and the easiest way to robustly print
errors but nothing else seems to be
to use curl instead.

Since the docker images already include
curl, switch them to use that instead.

What are related issues/pull requests?

I'm getting intermittent build failures when building GDAL images. I can't reproduce the problem, but network-related operations have failed before (#9571), so print an error when things go wrong.

No issue filed.

Tasklist

  • ADD YOUR TASKS HERE
  • Make sure code is correctly formatted (cf pre-commit configuration)
  • Add test case(s)
  • Add documentation
  • Updated Python API documentation (swig/include/python/docs/)
  • Review
  • Adjust for comments
  • All CI builds and checks have passed

Environment

Provide environment details, if relevant:

  • OS:
  • Compiler:

The -q parameter to wget makes it completely
silent, even on faliure which gives build errors
that are difficult to diagnose. Someone
else had the same problem 15 years ago:

https://serverfault.com/questions/70889/wget-to-print-errors-but-nothing-otherwise

and the easiest way to robustly print
errors but nothing else seems to be
to use curl instead.

Since the docker images already include
curl, switch them to use that instead.
@pjonsson
Copy link
Contributor Author

pjonsson commented Oct 4, 2024

Tested by building all images locally for the 3.9.2 release, and that worked except ubuntu-full which failed because of PDFium changes. Cherry-picked the commit to release/3.9 branch to build ubuntu-full image, and that worked.

I realize 3.9.3 is really close, but is it possible to get this into 3.9.3?

@rouault rouault merged commit 88bca08 into OSGeo:master Oct 4, 2024
37 checks passed
@rouault
Copy link
Member

rouault commented Oct 4, 2024

The backport to release/3.9 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 37ff70389c... docker: print HTTP errors on failure
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging docker/alpine-normal/Dockerfile
CONFLICT (content): Merge conflict in docker/alpine-normal/Dockerfile
Auto-merging docker/alpine-small/Dockerfile
Auto-merging docker/ubuntu-full/Dockerfile
CONFLICT (content): Merge conflict in docker/ubuntu-full/Dockerfile
Auto-merging docker/ubuntu-full/bh-gdal.sh
Auto-merging docker/ubuntu-full/bh-proj.sh
Auto-merging docker/ubuntu-small/Dockerfile

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release/3.9 release/3.9
# Navigate to the new working tree
cd .worktrees/backport-release/3.9
# Create a new branch
git switch --create backport-10929-to-release/3.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 37ff70389c28228773a1ab3cc1b137ddee2c346d
# Push it to GitHub
git push --set-upstream origin backport-10929-to-release/3.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.9

Then, create a pull request where the base branch is release/3.9 and the compare/head branch is backport-10929-to-release/3.9.

@pjonsson pjonsson deleted the print-http-errors branch October 5, 2024 10:46
@rouault
Copy link
Member

rouault commented Oct 5, 2024

cherry-picked to 3.9 per ffa080c

@rouault rouault added this to the 3.9.3 milestone Oct 5, 2024
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