Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#73587 closed defect (fixed)

Simultaneous fetch of ports with distfiles in common can fail

Reported by: fpeos Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.12.3
Component: base Version:
Keywords: Cc:
Port: gettext

Description (last modified by jmroot (Joshua Root))

On 3/8/26, I ran this

sudo port -d selfupdate

sudo port upgrade outdated

and received the following error. It remind me of ticket #66394 but I do not know what to do> Any help would be appreciated.

Burkhard

The following ports will be upgraded:
 gettext-runtime
 ncurses
 bash
 xz
 zlib
 libpng
 expat
 lcms2
 openssl3
 openssl
 sqlite3
 glib2
 gobject-introspection
 libunistring
 libtextstyle
 gettext-tools-libs
 gettext
 texinfo
 libgpg-error
 libassuan
 libgcrypt
 libtasn1
 p11-kit
 nettle
 pinentry-mac
 lmdb
 gnupg2
 gpgme
 nss
 lzma
 poppler
 texlive-common
 texlive-bin
 libarchive
 dvisvgm
 jasper
 m4
 ImageMagick
 texlive-basic
 texlive-latex
 latexmk
 libaec
 libopus
 luametatex
 p5.34-clone
 p5.34-compress-raw-bzip2
 p5.34-compress-raw-zlib
 p5.34-date-manip
 p5.34-dbd-sqlite
 p5.34-io-compress
 p5.34-net-ssleay
 p5.34-io-socket-ssl
 p5.34-timedate
 p5.34-lwp-protocol-https
 python313
 py313-markdown
 py313-setuptools
 texlive-tlpdb
 texlive-pictures
 texlive-latex-recommended
 texlive-bin-extra
 texlive-metapost
 texlive-plain-generic
 texlive-xetex
 texlive-fonts-recommended
 texlive-math-science
 texlive-context
 texlive-fontutils
 texlive-luatex
 texlive-lang-czechslovak
 texlive-lang-english
 texlive-lang-european
 texlive-lang-french
 texlive-lang-german
 texlive-lang-italian
 texlive-lang-polish
 texlive-lang-portuguese
 texlive-lang-spanish
 texlive
 texlive-latex-extra
 texlive-publishers
 tree-sitter-elixir
 tree-sitter-phpdoc
 
The following new ports will be installed as dependencies:
 python_select-314
 python3_select-314
 python314
 py314-markupsafe
 py314-mako
 py314-markdown
 py314-setuptools
 p5.34-locale-gettext
 help2man
 gpgmepp
 boost188
 cmake
Continue? [Y/n]: Y

--->  Upgrading gettext-runtime (1/95)
--->  Computing dependencies for gettext-runtime
--->  Fetching archive for gettext-runtime
--->  Archive not available for gettext-runtime, building locally
--->  Fetching distfiles for gettext-runtime
--->  Verifying checksums for gettext-runtime

Error: Checksum (rmd160) mismatch for gettext-1.0.tar.xz
Error: Checksum (sha256) mismatch for gettext-1.0.tar.xz
Error: Checksum (size) mismatch for gettext-1.0.tar.xz
Error: Failed to checksum gettext-runtime: Unable to verify file checksums
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gettext/gettext-runtime/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.

 /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gettext/gettext-runtime/main.log

version:1
:debug:main Starting logging for gettext-runtime @1.0_0
:debug:sysinfo macOS 15.7.4 (darwin/24.6.0) arch arm
:debug:sysinfo MacPorts 2.12.2
:debug:sysinfo Xcode 26.3, CLT 26.3.0.0.1.1771626560
:debug:sysinfo SDK 15
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 15.0
:msg:main --->  Computing dependencies for gettext-runtime:info:main .:debug:main Searching for dependency: libiconv
:debug:main Found Dependency: receipt exists for libiconv
:debug:main Searching for dependency: xz-bootstrap
:debug:main Found Dependency: receipt exists for xz-bootstrap
:debug:main Executing org.macports.main (gettext-runtime)
:debug:main dropping privileges: euid changed to 502, egid changed to 501.
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:archivefetch archivefetch phase started at 2026-03-08T16:20:32.269+0000 (Sun Mar  8 09:20:32 PDT 2026)
:msg:archivefetch --->  Fetching archive for gettext-runtime
:debug:archivefetch Executing org.macports.archivefetch (gettext-runtime)
:debug:archivefetch Fetching https://packages.macports.org/gettext-runtime/gettext-runtime-1.0_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching http://mirror.fcix.net/macports/packages/gettext-runtime/gettext-runtime-1.0_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching https://bos.us.packages.macports.org/gettext-runtime/gettext-runtime-1.0_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching https://packages.macports.org/zlib/zlib-1.3.2_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching http://mirror.fcix.net/macports/packages/zlib/zlib-1.3.2_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching https://bos.us.packages.macports.org/zlib/zlib-1.3.2_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching https://packages.macports.org/expat/expat-2.7.4_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Fetching http://mirror.fcix.net/macports/packages/expat/expat-2.7.4_0.darwin_24.arm64.tbz2 failed: The requested URL returned error: 404
:debug:archivefetch Privilege de-escalation not attempted as not running as root.
:debug:fetch fetch phase started at 2026-03-08T16:20:32.276+0000 (Sun Mar  8 09:20:32 PDT 2026)
:notice:fetch --->  Archive not available for gettext-runtime, building locally
:notice:fetch --->  Fetching distfiles for gettext-runtime
:debug:fetch euid/egid changed to: 0/0
:debug:fetch chowned /opt/local/var/macports/distfiles/gettext to macports
:debug:fetch euid/egid changed to: 502/501
:debug:fetch Executing org.macports.fetch (gettext-runtime)
:debug:fetch Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at 2026-03-08T16:20:32.277+0000 (Sun Mar  8 09:20:32 PDT 2026)
:notice:checksum --->  Verifying checksums for gettext-runtime
:debug:checksum Executing org.macports.checksum (gettext-runtime)
:info:checksum --->  Checksumming gettext-1.0.tar.xz
:debug:checksum Calculated (rmd160) is 9c1185a5c5e9fc54612808977ee8f548b2258d31
:error:checksum Checksum (rmd160) mismatch for gettext-1.0.tar.xz
:info:checksum Portfile checksum: gettext-1.0.tar.xz rmd160 30d857886c367f8632b35fc5e61a3ce5b6b37381
:info:checksum Distfile checksum: gettext-1.0.tar.xz rmd160 9c1185a5c5e9fc54612808977ee8f548b2258d31
:debug:checksum Calculated (sha256) is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
:error:checksum Checksum (sha256) mismatch for gettext-1.0.tar.xz
:info:checksum Portfile checksum: gettext-1.0.tar.xz sha256 71132a3fb71e68245b8f2ac4e9e97137d3e5c02f415636eb508ae607bc01add7
:info:checksum Distfile checksum: gettext-1.0.tar.xz sha256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
:debug:checksum Calculated (size) is 0
:error:checksum Checksum (size) mismatch for gettext-1.0.tar.xz
:info:checksum Portfile checksum: gettext-1.0.tar.xz size 10721600
:info:checksum Distfile checksum: gettext-1.0.tar.xz size 0
:info:checksum The correct checksum line may be:
:info:checksum checksums           rmd160  9c1185a5c5e9fc54612808977ee8f548b2258d31 \
:info:checksum                     sha256  e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 \
:info:checksum                     size    0
:error:checksum Failed to checksum gettext-runtime: Unable to verify file checksums
:debug:checksum Error code: NONE
:debug:checksum Backtrace: Unable to verify file checksums
:debug:checksum     while executing
:debug:checksum "$procedure $targetname"
:error:checksum See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_gettext/gettext-runtime/main.log for details.

Attachments (3)

upgrade.log (529.7 KB) - added by fpeos 6 months ago.
output from: sudo port -d upgrade outdated 2>&1
upgrade2.log (529.0 KB) - added by fpeos 6 months ago.
after applying the patch, here is again the output from "sudo port -d upgrade outdated 2>&1"
upgrade3.log (529.3 KB) - added by fpeos 6 months ago.
Output after applying the second patch

Download all attachments as: .zip

Change History (23)

comment:1 Changed 6 months ago by fpeos

Description: modified (diff)

comment:2 Changed 6 months ago by jmroot (Joshua Root)

Description: modified (diff)
Port: gettext added

There is clearly something going on since #73586 reported the same thing, but no one has yet been able to reproduce the issue with debug output showing the distfile being downloaded. Could you please run this:

sudo port clean --dist gettext-runtime
sudo port -d upgrade outdated 2>&1 | tee upgrade.log

This will create a file named upgrade.log; please add it to the ticket as an attachment.

Changed 6 months ago by fpeos

Attachment: upgrade.log added

output from: sudo port -d upgrade outdated 2>&1

comment:3 Changed 6 months ago by fpeos

As instructed, I just attached the output from

sudo port -d upgrade outdated 2>&1

comment:5 Changed 6 months ago by jmroot (Joshua Root)

More confusing is that this occurs 3 times:

DEBUG: Fetching https://distfiles.macports.org/gettext/gettext-1.0.tar.xz failed: Transfer cancelled

The fetch phase should wait until that transfer is complete, but it seems to just continue immediately.

comment:6 Changed 6 months ago by jmroot (Joshua Root)

Are you able to try applying this patch to your local /opt/local/libexec/macports/lib/macports1.0/macports.tcl? https://github.com/macports/macports-base/commit/f8b0269c5d67b209af0d698b89dc008091bdf559

comment:7 Changed 6 months ago by fpeos

If you kindly gave the command to apply the patch, I would be happy to try. Sure.

comment:8 Changed 6 months ago by jmroot (Joshua Root)

I think this should work:

curl -o f8b0269.diff https://github.com/macports/macports-base/commit/f8b0269c5d67b209af0d698b89dc008091bdf559.diff
sudo patch /opt/local/libexec/macports/lib/macports1.0/macports.tcl < f8b0269.diff

comment:9 Changed 6 months ago by jmroot (Joshua Root)

And after patching, please try the commands from comment:2 again.

Changed 6 months ago by fpeos

Attachment: upgrade2.log added

after applying the patch, here is again the output from "sudo port -d upgrade outdated 2>&1"

comment:10 Changed 6 months ago by fpeos

I applied the patch and attached the output. There error persisted.

comment:11 Changed 6 months ago by jmroot (Joshua Root)

OK, please try this.

curl -o b02687f.diff https://github.com/macports/macports-base/commit/b02687f83d814665269f02ab7422bd726035a2ec.diff
sudo patch /opt/local/libexec/macports/lib/port1.0/portfetch.tcl < b02687f.diff

Changed 6 months ago by fpeos

Attachment: upgrade3.log added

Output after applying the second patch

comment:12 Changed 6 months ago by fpeos

I applied the second patch, re-run the upgrade command and uploaded output3.log for your consumption. The problem persisted.

comment:13 Changed 6 months ago by jmroot (Joshua Root)

Thank you for testing. I think the problem must be to do with the fact that multiple outdated ports share the same distfile. I'll have to have a think about how to solve it.

In the meantime, you should be able to work around the issue like this:

sudo port clean --dist gettext-runtime
sudo port checksum gettext-runtime
sudo port upgrade outdated

comment:14 Changed 6 months ago by jmroot (Joshua Root)

Component: portsbase
Summary: Error: Checksum (rmd160) mismatch for gettext-1.0.tar.xzSimultaneous fetch of ports with distfiles in common can fail

comment:15 Changed 6 months ago by fpeos

Yes, that work around worked for me. Thank you so much!

comment:16 Changed 6 months ago by bgilbert (Benjamin Gilbert)

Cc: bgilbert added

comment:17 Changed 6 months ago by bgilbert (Benjamin Gilbert)

Cc: bgilbert removed

comment:18 Changed 6 months ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In c4d21762d0b3a4ea649adaea915797ef8717809f/macports-base (master):

Skip async fetch if file is already being fetched

Can happen when a distfile is shared by multiple ports that will be
built from source by the same action.

Closes: #73587

comment:19 Changed 6 months ago by jmroot (Joshua Root)

Milestone: MacPorts Future

comment:20 Changed 6 months ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.12.3
Note: See TracTickets for help on using tickets.