Skip to content

fix: packages.sh - Download jaq via release tag not latest#3852

Merged
polarathene merged 1 commit intomasterfrom
fix/jaq-install-from-correct-gh-url
Jan 29, 2024
Merged

fix: packages.sh - Download jaq via release tag not latest#3852
polarathene merged 1 commit intomasterfrom
fix/jaq-install-from-correct-gh-url

Conversation

@polarathene
Copy link
Copy Markdown
Member

@polarathene polarathene commented Jan 29, 2024

Description

As the filename includes the version / tag, we cannot rely on the latest URL to be stable.

This additionally bumps jaq from v1.2.0 to v1.3.0.


I performed a build locally with make build and while it didn't fail on the build, I was watching the log output and noticed a curl 404 line, which turned out to be:

7.203 [  TRACE  ]  Installing jaq
7.848 curl: (22) The requested URL returned error: 404

The build AFAIK failed for other reasons (Debian package repos being unavailable, which is common experience lately for me), so I'm not sure if the jaq curl failure above would normally be caught (EDIT: Had a successful build, it wasn't caught as a failure):

Debian package build log failure snippets
61.90 Ign:215 http://deb.debian.org/debian bookworm/main amd64 whois amd64 5.5.17
65.90 Err:177 http://deb.debian.org/debian bookworm/main amd64 libio-string-perl all 1.08-4
65.90   Could not connect to debian.map.fastlydns.net:80 (151.101.166.132), connection timed out Unable to connect to deb.debian.org:http: [IP: 151.101.166.132 80]

...

65.90 Err:215 http://deb.debian.org/debian bookworm/main amd64 whois amd64 5.5.17
65.90   Unable to connect to deb.debian.org:http: [IP: 151.101.166.132 80]
65.90 Fetched 56.9 MB in 47s (1207 kB/s)
65.90 E: Failed to fetch http://deb.debian.org/debian/pool/main/libi/libio-string-perl/libio-string-perl_1.08-4_all.deb  Could not connect to debian.map.fastlydns.net:80 (151.101.166.132), connection timed out Unable to connect to deb.debian.org:http: [IP: 151.101.166.132 80]

...

65.90 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
Dockerfile:31
--------------------
  29 |     COPY target/scripts/helpers/log.sh /usr/local/bin/helpers/log.sh
  30 |
  31 | >>> RUN /bin/bash /build/packages.sh && rm -r /build
  32 |
  33 |     # -----------------------------------------------
--------------------
ERROR: failed to solve: process "/bin/bash -e -o pipefail -c /bin/bash /build/packages.sh && rm -r /build" did not complete successfully: exit code: 100
make: *** [Makefile:21: build] Error 1

NOTE: The initial package install with postfix was successful, usually I just run make build a few times and it'll be successful, perhaps the system (Docker on WSL2) has trouble with DNS or too many queries 🤷‍♂️ (it's common for the debian package web search frontend to be unreachable via host browsers too though)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

As the filename includes the version / tag, we cannot rely on the latest URL to be stable.
@polarathene polarathene added area/ci area/scripts kind/bug/fix A fix (PR) for a confirmed bug labels Jan 29, 2024
@polarathene polarathene added this to the v14.0.0 milestone Jan 29, 2024
@polarathene polarathene self-assigned this Jan 29, 2024
@polarathene
Copy link
Copy Markdown
Member Author

If the failure can be caught during build that'd be good.

We only use jaq for update-check atm, but we could also add a test-case to verify the command is available?

$ jaq -V
bash: jaq: command not found

@polarathene polarathene merged commit 244c455 into master Jan 29, 2024
@polarathene polarathene deleted the fix/jaq-install-from-correct-gh-url branch January 29, 2024 22:11
@casperklein
Copy link
Copy Markdown
Member

The reason why packages.sh continued to run when "curl" failed, is the usage of the && operator. The operator is not needed, as we set -e at the top.

@casperklein casperklein mentioned this pull request Jan 29, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci area/scripts kind/bug/fix A fix (PR) for a confirmed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants