#72677 closed defect (fixed)
Error when updating MacPorts tree after I updated to MacPorts 2.11.0
| Reported by: | bjmarfito (Bryan Marfito) | Owned by: | jmroot (Joshua Root) |
|---|---|---|---|
| Priority: | Normal | Milestone: | MacPorts 2.11.1 |
| Component: | base | Version: | |
| Keywords: | Cc: | ||
| Port: |
Description
An error occurred when I update MacPorts tree after I updated to MacPorts 2.11.0 Below are the error details.
Warning: Can't open index file: /opt/local/var/macports/sources/github.com/macports/macports-ports/PortIndex
while executing
"mports_generate_quickindex $outpath"
(file "/opt/local/bin/portindex" line 489)
Command failed: /opt/local/bin/portindex /opt/local/var/macports/sources/github.com/macports/macports-ports
Exit code: 1
Error: updating PortIndex for file:///opt/local/var/macports/sources/github.com/macports/macports-ports/ failed
Warning: It looks like your PortIndex file for file:///opt/local/var/macports/sources/github.com/macports/macports-ports/ may be corrupt.
Error: /opt/local/bin/port: lookup of portname expat failed: expected non-negative integer but got "source"
while executing
"read $fd $len"
("macports_try" body line 6)
Attachments (1)
Change History (14)
comment:1 Changed 5 months ago by jmroot (Joshua Root)
| Component: | ports → base |
|---|
comment:2 Changed 5 months ago by bjmarfito (Bryan Marfito)
/
opt/local/var/macports/sources/github.com
and all its subdirectories have this permission.
drwxrwxrwx
comment:3 Changed 5 months ago by jmroot (Joshua Root)
Does the PortIndex path shown exist? What about ownership?
comment:4 Changed 5 months ago by jmroot (Joshua Root)
The complete debug output might be helpful. It's not clear what had already happened before this.
comment:5 Changed 5 months ago by bjmarfito (Bryan Marfito)
I attached the log file before the error occurred for your reference.
comment:6 Changed 5 months ago by jmroot (Joshua Root)
Unfortunately I can't tell exactly what the problem is here from the information provided. My guess would still be that it is some kind of permissions or ownership problem, since the main change to syncing in 2.11 is that portindex is no longer run with root privileges (specifically it runs as whichever user owns the parent directory of the PortIndex).
comment:7 follow-up: 9 Changed 5 months ago by bjmarfito (Bryan Marfito)
I managed to solve it by deleting the github.com folder and cloning it again.
Please close this issue. Thank you jmroot for your help.
comment:8 Changed 5 months ago by dgilman (David Gilman)
Same issue and I was able to fix it with a chmod a+rwx PortIndex*.
comment:9 Changed 5 months ago by jmroot (Joshua Root)
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
Replying to bjmarfito:
I managed to solve it by deleting the github.com folder and cloning it again.
Please close this issue. Thank you jmroot for your help.
Alright, closing. I wonder though if it would be possible to detect and correct this issue automatically.
comment:10 Changed 5 months ago by jmroot (Joshua Root)
| Owner: | set to jmroot |
|---|---|
| Resolution: | worksforme → fixed |
comment:11 Changed 5 months ago by jmroot (Joshua Root)
| Milestone: | → MacPorts 2.11.1 |
|---|
I think that should probably do it, though I can't be 100% sure.
comment:12 Changed 5 months ago by dojoteef (Nader Akoury)
I ran sudo port selfupdate which updated to 2.11.1 which had this change in it. I first ran into #72689 and was able to work around it as mentioned in that bug. I then executed sudo port selfupdate again at which point it attempted to update my port tree and got the following error: rsync(57391): error: PortIndex: utimensat (2): Permission denied (full details below).
Updating MacPorts
---> Checking for newer releases of MacPorts
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 63 100 63 0 0 187 0 --:--:-- --:--:-- --:--:-- 188
MacPorts base version 2.11.1 installed,
MacPorts base version 2.11.1 available.
---> MacPorts base is already the latest version
---> Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/macports/release/tarballs/ports.tar
Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.
Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.
Transfer starting: 3 files
./
ports.tar.gz
ports.tar.gz.rmd160
sent 35907 bytes received 442275 bytes 4781820000 bytes/sec
total size is 35522346 speedup is 74.29
Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.
Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.
Transfer starting: 3 files
rsync(57391): error: PortIndex: utimensat (2): Permission denied
./
PortIndex
PortIndex.rmd160
sent 138 bytes received 3130041 bytes 31301790000 bytes/sec
total size is 24679350 speedup is 7.88
Creating port index in /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports
Adding port devel/fzy
Adding port devel/legacy-support
Adding subport legacy-support-devel
Adding port games/ldmud
Adding port graphics/gifski
Adding subport libgifski
Adding port lang/julia
Adding port lang/llvm-20
Adding subport flang-20
Adding subport clang-20
Adding port llm/fabric
Adding subport mlir-20
Adding subport lldb-20
Adding port multimedia/x264
Adding port net/filebrowser
Adding port net/qBittorrent
Adding port perl/p5-digest-gost
Adding subport p5.32-digest-gost
Adding subport p5.34-digest-gost
Adding subport p5.30-digest-gost
Adding subport p5.28-digest-gost
Adding port perl/p5-object-pad
Adding subport p5.32-object-pad
Adding subport p5.34-object-pad
Adding subport p5.28-object-pad
Adding subport p5.30-object-pad
Adding port python/py-astropy-iers-data
Adding port python/py-astropy-healpix
Adding subport py311-astropy-healpix
Adding subport py313-astropy-iers-data
Adding subport py39-astropy-healpix
Adding subport py313-astropy-healpix
Adding subport py311-astropy-iers-data
Adding subport py310-astropy-iers-data
Adding subport py312-astropy-healpix
Adding subport py39-astropy-iers-data
Adding subport py312-astropy-iers-data
Adding subport py310-astropy-healpix
Adding port python/py-expandvars
Adding subport py311-expandvars
Adding subport py39-expandvars
Adding subport py313-expandvars
Adding subport py312-expandvars
Adding subport py310-expandvars
Adding port sysutils/MacPorts
Adding port sysutils/fq
Adding port sysutils/eza
Adding port textproc/ispell
Adding port textproc/qsv
Total number of ports parsed: 49
Ports successfully parsed: 49
Ports failed: 0
Up-to-date ports skipped: 39977
The ports tree has been updated.
8 ports are outdated. Run 'port outdated' for details.
To upgrade your installed ports, you should run
port upgrade outdated
When checking the file permissions on each on the PortIndex related files, I see that the PortIndex.quick file has an unspecified group (id=505):
-rw-r--r-- 1 macports admin 24678838 Jul 14 12:27 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/remote/PortIndex -rw-r--r-- 1 macports admin 512 Jul 14 11:50 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/remote/PortIndex.rmd160 -rw-r--r-- 1 macports wheel 24678399 Jul 14 10:15 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/PortIndex -rw-r--r-- 1 macports 505 932401 Jul 14 14:07 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/PortIndex.quick
I cannot find the associated group with dscl . list /Groups PrimaryGroupID. Not sure what, if any, ramifications there are to this rsync error since it reports successfully updating the ports tree. I'm reporting it since it seemed like it might be related to the proposed fix.
comment:13 Changed 5 months ago by dojoteef (Nader Akoury)
Note, a subsequent sudo port selfupdate succeeded without any rsync error.

What are the permissions on
/opt/local/var/macports/sources/github.comand its subdirs?