You are not logged in.

#1 2024-09-16 21:21:35

matersci
Member
From: Hellas
Registered: 2006-01-19
Posts: 169

pacman 7 unusable with cache on nfs mount

Sorry for the long post, I will try to give as much information as possible

So in my setup I have several arch installations at home and a NAS.

I am sharing the pacman cache between my arch installations using:

1. A folder on my NAS, inside the root folder of my nfs share (named LinuxCache)

2. A systemd service running on boot that will bind a folder on my NAS to /var/cache/pacman/pkg

[Unit]
Description=bind mounts pacman cache to nfs share 
Requires=home-giorgos-MP3\x2dNFS.mount
After=network.target home-giorgos-MP3\x2dNFS.mount

[Service]
ExecStart=mount --bind /home/giorgos/MP3-NFS/Linux/LinuxCache/ /var/cache/pacman/pkg/

[Install]
WantedBy=multi-user.target

3.  Another systemd service running on boot that will unmount/remount my nfs shares if not available/again available (not important at the moment)

4. Entries in fstab to mount the root folders of nfs shares (a few levels higher than LinuxCache folder.

NFS SHARES
Ouranos:/volume1/Ouranos                /home/giorgos/NFS-Data          nfs             noauto,users,x-systemd.automount,timeo=14,x-systemd.idle-timeout=1min   0 0
Ouranos:/volume2/OuranosMP3             /home/giorgos/MP3-NFS           nfs             noauto,users,x-systemd.automount,timeo=14,x-systemd.idle-timeout=1min   0 0

5. The standard entry for cache  in pacman.conf (still with a #, so default location)
#CacheDir    = /var/cache/pacman/pkg/

This way pacman will use the LinuxCache folder on my NAS when I am connected to my local network and the local /var/cache/pacman/pkg path if I am not.

Everything was working oerfectly for a few years, until upgrading to pacman 7 and merging the pacnew file to my pacman.conf

#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives

#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir     = /
#DBPath      = /var/lib/pacman/
#CacheDir    = /var/cache/pacman/pkg/
#LogFile     = /var/log/pacman.log
#GPGDir      = /etc/pacman.d/gnupg/
#HookDir     = /etc/pacman.d/hooks/
HoldPkg     = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg   =
#IgnoreGroup =

#NoUpgrade   =
#NoExtract   =

# Misc options
#UseSyslog
Color
#NoProgressBar
CheckSpace
#VerbosePkgLists
ParallelDownloads = 5
DownloadUser = alpm
#DisableSandbox
ILoveCandy

# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel    = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required

# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.

#
# REPOSITORIES
#   - can be defined here or included from another file
#   - pacman will search repositories in the order defined here
#   - local/custom mirrors can be added here or in separate files
#   - repositories listed first will take precedence when packages
#     have identical names, regardless of version number
#   - URLs will have $repo replaced by the name of the current repo
#   - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
#       [repo-name]
#       Server = ServerName
#       Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#

# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.

#[core-testing]
#Include = /etc/pacman.d/mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

#[extra-testing]
#Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.

#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist

[multilib]
Include = /etc/pacman.d/mirrorlist

[localrepo]
SigLevel = Optional TrustAll
Server = file:///mnt/Data/Arch/local/pkg/

[archlinuxgr]
SigLevel = Never
Server = https://archlinuxgr.tiven.org/archlinux/$arch

I also did a chown :alpm -R to my local repo path.

Now pacman cant install anything. I tried commenting/uncommenting DownloadUser = alpm and/or #DisableSandbox but no change.

If I run a -Syu pacman will sync, will download the updates (but not in the cache, I don't know where are saved) and then it will fail with an unknown error. Even if I try only to Sw a package, it will fail with same error and there will be no sign of the downloaded package anywhere...

With DownloadUser = alpm uncommented it wont even download the file

pacman -Sw linux
resolving dependencies...

Packages (1) linux-6.10.10.arch1-1

Total Download Size:  135.52 MiB

:: Proceed with download? [Y/n] 
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

or with debug option:

# pacman -Syw linux --debug 
debug: pacman v7.0.0 - libalpm v15.0.0
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: Architecture: auto
debug: config: arch: x86_64
debug: config: sandboxuser: alpm
debug: config: chomp
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 79: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 85: including /etc/pacman.d/mirrorlist
debug: config: new section 'multilib'
debug: config file /etc/pacman.conf, line 94: including /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': https://de.arch.mirror.kescher.at/core/os/x86_64
debug: adding new server URL to database 'core': https://ftp.lysator.liu.se/pub/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://ftp.acc.umu.se/mirror/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://ftp.acc.umu.se/mirror/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.osbeck.com/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://ftp.lysator.liu.se/pub/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://ftp.myrveln.se/pub/linux/archlinux/core/os/x86_64
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': https://de.arch.mirror.kescher.at/extra/os/x86_64
debug: adding new server URL to database 'extra': https://ftp.lysator.liu.se/pub/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://ftp.acc.umu.se/mirror/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://ftp.acc.umu.se/mirror/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.osbeck.com/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://ftp.lysator.liu.se/pub/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://ftp.myrveln.se/pub/linux/archlinux/extra/os/x86_64
debug: registering sync database 'multilib'
debug: database path for tree multilib set to /var/lib/pacman/sync/multilib.db
debug: "/var/lib/pacman/sync/multilib.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/multilib.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for multilib repository
debug: adding new server URL to database 'multilib': https://de.arch.mirror.kescher.at/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://ftp.lysator.liu.se/pub/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://ftp.acc.umu.se/mirror/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://ftp.acc.umu.se/mirror/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.osbeck.com/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://ftp.lysator.liu.se/pub/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://ftp.myrveln.se/pub/linux/archlinux/multilib/os/x86_64
debug: option 'sandboxuser' = alpm
:: Synchronising package databases...
 core downloading...
 extra downloading...
 multilib downloading...
debug: filesystem access has been restricted to /var/lib/pacman/sync/download-Rion2z/, landlock ABI is 5
debug: core.db: url is https://de.arch.mirror.kescher.at/core/os/x86_64/core.db
debug: core.db: maxsize 134217728
debug: core.db: using time condition 1726339233
debug: core.db: opened tempfile for download: /var/lib/pacman/sync/download-Rion2z/core.db.part (wb)
debug: extra.db: url is https://de.arch.mirror.kescher.at/extra/os/x86_64/extra.db
debug: extra.db: maxsize 134217728
debug: extra.db: using time condition 1726518505
debug: extra.db: opened tempfile for download: /var/lib/pacman/sync/download-Rion2z/extra.db.part (wb)
debug: multilib.db: url is https://de.arch.mirror.kescher.at/multilib/os/x86_64/multilib.db
debug: multilib.db: maxsize 134217728
debug: multilib.db: using time condition 1726325967
debug: multilib.db: opened tempfile for download: /var/lib/pacman/sync/download-Rion2z/multilib.db.part (wb)
debug: core.db: curl returned result 0 from transfer
debug: core.db: response code 304
debug: core.db.sig: url is https://de.arch.mirror.kescher.at/core/os/x86_64/core.db.sig
debug: core.db.sig: maxsize 16384
debug: core.db.sig: opened tempfile for download: /var/lib/pacman/sync/download-Rion2z/core.db.sig.part (wb)
debug: core.db: file met time condition
debug: multilib.db: curl returned result 0 from transfer
debug: multilib.db: response code 304
debug: multilib.db.sig: url is https://de.arch.mirror.kescher.at/multilib/os/x86_64/multilib.db.sig
debug: multilib.db.sig: maxsize 16384
debug: multilib.db.sig: opened tempfile for download: /var/lib/pacman/sync/download-Rion2z/multilib.db.sig.part (wb)
debug: multilib.db: file met time condition
debug: core.db.sig: curl returned result 0 from transfer
debug: core.db.sig: response code 404
debug: core.db.sig: no more servers to retry
debug: multilib.db.sig: curl returned result 0 from transfer
debug: multilib.db.sig: response code 404
debug: multilib.db.sig: no more servers to retry
debug: extra.db: curl returned result 0 from transfer
debug: extra.db: response code 200
debug: extra.db.sig: url is https://de.arch.mirror.kescher.at/extra/os/x86_64/extra.db.sig
debug: extra.db.sig: maxsize 16384
debug: extra.db.sig: opened tempfile for download: /var/lib/pacman/sync/download-Rion2z/extra.db.sig.part (wb)
debug: extra.db.sig: curl returned result 0 from transfer
debug: extra.db.sig: response code 404
debug: extra.db.sig: no more servers to retry
debug: curl_download_internal return code is 0
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: "/var/lib/pacman/sync/multilib.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/multilib.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: loading package cache for repository 'core'
debug: opening archive /var/lib/pacman/sync/core.db
debug: added 265 packages to package cache for db 'core'
debug: adding package 'linux'
debug: loading package cache for repository 'local'
debug: added 1106 packages to package cache for db 'local'
debug: adding package linux-6.10.10.arch1-1 to the transaction add list
resolving dependencies...
debug: resolving target's dependencies
debug: started resolving dependencies
debug: checkdeps: package linux-6.10.10.arch1-1
debug: finished resolving dependencies
debug: checking dependencies
debug: checkdeps: package linux-6.10.10.arch1-1
debug: setting download size 142098651 for pkg linux
debug: sorting by dependencies
debug: started sorting dependencies
debug: sorting dependencies finished

Packages (1) linux-6.10.10.arch1-1

Total Download Size:  135.52 MiB

:: Proceed with download? [Y/n] 
debug: using cachedir: /var/cache/pacman/pkg/
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.
debug: unregistering database 'local'
debug: freeing package cache for repository 'local'
debug: unregistering database 'core'
debug: freeing package cache for repository 'core'
debug: unregistering database 'extra'
debug: unregistering database 'multilib'

with DownloadUser = alpm commented it will download the file (no idea where, its not in /var/cache/pacman/pkg) and fail as before.

 # pacman -Syw linux
:: Synchronising package databases...
 core is up to date
 extra is up to date
 multilib is up to date
resolving dependencies...

Packages (1) linux-6.10.10.arch1-1

Total Download Size:  135.52 MiB

:: Proceed with download? [Y/n] 
:: Retrieving packages...
 linux-6.10.10.arch1...   135.5 MiB  5.10 MiB/s 00:27 [----------------------------] 100%
warning: failed to retrieve some files
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

and with debug

# pacman -Syw linux --debug 
debug: pacman v7.0.0 - libalpm v15.0.0
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: Architecture: auto
debug: config: arch: x86_64
debug: config: chomp
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 79: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 85: including /etc/pacman.d/mirrorlist
debug: config: new section 'multilib'
debug: config file /etc/pacman.conf, line 94: including /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': https://de.arch.mirror.kescher.at/core/os/x86_64
debug: adding new server URL to database 'core': https://ftp.lysator.liu.se/pub/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://ftp.acc.umu.se/mirror/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://ftp.acc.umu.se/mirror/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.osbeck.com/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': http://ftp.lysator.liu.se/pub/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://ftp.myrveln.se/pub/linux/archlinux/core/os/x86_64
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': https://de.arch.mirror.kescher.at/extra/os/x86_64
debug: adding new server URL to database 'extra': https://ftp.lysator.liu.se/pub/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://ftp.acc.umu.se/mirror/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://ftp.acc.umu.se/mirror/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.osbeck.com/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': http://ftp.lysator.liu.se/pub/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://ftp.myrveln.se/pub/linux/archlinux/extra/os/x86_64
debug: registering sync database 'multilib'
debug: database path for tree multilib set to /var/lib/pacman/sync/multilib.db
debug: "/var/lib/pacman/sync/multilib.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/multilib.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: setting usage of 15 for multilib repository
debug: adding new server URL to database 'multilib': https://de.arch.mirror.kescher.at/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://ftp.lysator.liu.se/pub/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://ftp.acc.umu.se/mirror/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://ftp.acc.umu.se/mirror/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.osbeck.com/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': http://ftp.lysator.liu.se/pub/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://ftp.myrveln.se/pub/linux/archlinux/multilib/os/x86_64
debug: option 'sandboxuser' = (null)
:: Synchronising package databases...
 core downloading...
 extra downloading...
 multilib downloading...
debug: core.db: url is https://de.arch.mirror.kescher.at/core/os/x86_64/core.db
debug: core.db: maxsize 134217728
debug: core.db: using time condition 1726339233
debug: core.db: opened tempfile for download: /var/lib/pacman/sync/download-4fCjvz/core.db.part (wb)
debug: extra.db: url is https://de.arch.mirror.kescher.at/extra/os/x86_64/extra.db
debug: extra.db: maxsize 134217728
debug: extra.db: using time condition 1726520613
debug: extra.db: opened tempfile for download: /var/lib/pacman/sync/download-4fCjvz/extra.db.part (wb)
debug: multilib.db: url is https://de.arch.mirror.kescher.at/multilib/os/x86_64/multilib.db
debug: multilib.db: maxsize 134217728
debug: multilib.db: using time condition 1726325967
debug: multilib.db: opened tempfile for download: /var/lib/pacman/sync/download-4fCjvz/multilib.db.part (wb)
debug: extra.db: curl returned result 0 from transfer
debug: extra.db: response code 304
debug: extra.db.sig: url is https://de.arch.mirror.kescher.at/extra/os/x86_64/extra.db.sig
debug: extra.db.sig: maxsize 16384
debug: extra.db.sig: opened tempfile for download: /var/lib/pacman/sync/download-4fCjvz/extra.db.sig.part (wb)
debug: extra.db: file met time condition
debug: multilib.db: curl returned result 0 from transfer
debug: multilib.db: response code 304
debug: multilib.db.sig: url is https://de.arch.mirror.kescher.at/multilib/os/x86_64/multilib.db.sig
debug: multilib.db.sig: maxsize 16384
debug: multilib.db.sig: opened tempfile for download: /var/lib/pacman/sync/download-4fCjvz/multilib.db.sig.part (wb)
debug: multilib.db: file met time condition
debug: core.db: curl returned result 0 from transfer
debug: core.db: response code 304
debug: core.db.sig: url is https://de.arch.mirror.kescher.at/core/os/x86_64/core.db.sig
debug: core.db.sig: maxsize 16384
debug: core.db.sig: opened tempfile for download: /var/lib/pacman/sync/download-4fCjvz/core.db.sig.part (wb)
debug: core.db: file met time condition
debug: extra.db.sig: curl returned result 0 from transfer
debug: extra.db.sig: response code 404
debug: extra.db.sig: no more servers to retry
debug: multilib.db.sig: curl returned result 0 from transfer
debug: multilib.db.sig: response code 404
debug: multilib.db.sig: no more servers to retry
debug: core.db.sig: curl returned result 0 from transfer
debug: core.db.sig: response code 404
debug: core.db.sig: no more servers to retry
debug: curl_download_internal return code is 1
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: "/var/lib/pacman/sync/multilib.db.sig" is not readable: No such file or directory
debug: sig path /var/lib/pacman/sync/multilib.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 599) : missing PGP signature
debug: missing optional signature
debug: loading package cache for repository 'core'
debug: opening archive /var/lib/pacman/sync/core.db
debug: added 265 packages to package cache for db 'core'
debug: adding package 'linux'
debug: loading package cache for repository 'local'
debug: added 1106 packages to package cache for db 'local'
debug: adding package linux-6.10.10.arch1-1 to the transaction add list
resolving dependencies...
debug: resolving target's dependencies
debug: started resolving dependencies
debug: checkdeps: package linux-6.10.10.arch1-1
debug: finished resolving dependencies
debug: checking dependencies
debug: checkdeps: package linux-6.10.10.arch1-1
debug: setting download size 142098651 for pkg linux
debug: sorting by dependencies
debug: started sorting dependencies
debug: sorting dependencies finished

Packages (1) linux-6.10.10.arch1-1

Total Download Size:  135.52 MiB

:: Proceed with download? [Y/n] 
debug: using cachedir: /var/cache/pacman/pkg/
debug: checking available disk space for download
debug: discovered mountpoint: /var/cache/pacman/pkg
debug: discovered mountpoint: /tmp
debug: discovered mountpoint: /sys/kernel/tracing
debug: discovered mountpoint: /sys/kernel/security
debug: discovered mountpoint: /sys/kernel/debug
debug: discovered mountpoint: /sys/kernel/config
debug: discovered mountpoint: /sys/fs/pstore
debug: discovered mountpoint: /sys/fs/fuse/connections
debug: discovered mountpoint: /sys/fs/cgroup
debug: discovered mountpoint: /sys/fs/bpf
debug: discovered mountpoint: /sys/firmware/efi/efivars
debug: discovered mountpoint: /sys
debug: discovered mountpoint: /run/user/1000/doc
debug: discovered mountpoint: /run/user/1000
debug: discovered mountpoint: /run/credentials/systemd-vconsole-setup.service
debug: discovered mountpoint: /run/credentials/systemd-udev-load-credentials.service
debug: discovered mountpoint: /run/credentials/systemd-tmpfiles-setup.service
debug: discovered mountpoint: /run/credentials/systemd-tmpfiles-setup-dev.service
debug: discovered mountpoint: /run/credentials/systemd-tmpfiles-setup-dev-early.service
debug: discovered mountpoint: /run/credentials/systemd-sysctl.service
debug: discovered mountpoint: /run/credentials/systemd-journald.service
debug: discovered mountpoint: /run/credentials/systemd-cryptsetup@Data.service
debug: discovered mountpoint: /run
debug: discovered mountpoint: /proc/sys/fs/binfmt_misc
debug: discovered mountpoint: /proc
debug: discovered mountpoint: /mnt/Data
debug: discovered mountpoint: /home/giorgos/NFS-Data
debug: discovered mountpoint: /home/giorgos/MP3-NFS
debug: discovered mountpoint: /home
debug: discovered mountpoint: /dev/shm
debug: discovered mountpoint: /dev/pts
debug: discovered mountpoint: /dev/mqueue
debug: discovered mountpoint: /dev/hugepages
debug: discovered mountpoint: /dev
debug: discovered mountpoint: /boot
debug: discovered mountpoint: /
debug: loading fsinfo for /var/cache/pacman/pkg
debug: partition /var/cache/pacman/pkg, needed 1085, cushion 161, free 732682
:: Retrieving packages...
 linux-6.10.10.arch1-1-x86_64 downloading...
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst: url is https://de.arch.mirror.kescher.at/core/os/x86_64/linux-6.10.10.arch1-1-x86_64.pkg.tar.zst
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst: maxsize 142098651
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst: opened tempfile for download: /var/cache/pacman/pkg/download-WFrGj9/linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.part (wb)
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst: curl returned result 0 from transfer
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst: response code 200
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig: url is https://de.arch.mirror.kescher.at/core/os/x86_64/linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig: maxsize 16384
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig: opened tempfile for download: /var/cache/pacman/pkg/download-WFrGj9/linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig.part (wb)
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig: curl returned result 0 from transfer
debug: linux-6.10.10.arch1-1-x86_64.pkg.tar.zst.sig: response code 200
debug: curl_download_internal return code is 0
warning: failed to retrieve some files
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.
debug: unregistering database 'local'
debug: freeing package cache for repository 'local'
debug: unregistering database 'core'
debug: freeing package cache for repository 'core'
debug: unregistering database 'extra'
debug: unregistering database 'multilib'

except pacman my nfs mount work as expected. I can browse my folder, I have rw access as user etc.

If run a
umount /var/cache/pacman/pkg
and switch from the nfs folder to my local var/cache/pacman/pkg, everything works as expected.

Any ideas?
Did I missed somthing obvious?
pacman output doenst really help...

Last edited by matersci (2024-09-16 21:23:18)

Offline

#2 2024-09-17 06:08:07

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Same issue here (although I'm pointing CacheDir directly to my NFS share instead of bind mounting to /var/cache/pacman/pkg).
I have an NFS share with all_squash option, so that all files on the share have the same user and group ownership.

The issue happens because Pacman 7 tries to change ownership of the target directory/files, but on an anonymous NFS share this operation is not permitted.
I've debugged it to two chown calls that were added in Pacman 7:
* libalpm/util.c – _alpm_temporary_download_dir_setup() – changing the ownership of temporary download directory to the user set in DownloadUser; if DownloadUser is not set, then this flow is skipped, which is why the download itself will succeed;
* libalpm/dload.c – finalize_download_file() – changing the ownership of downloaded files to root; this does not depend on DownloadUser, so it will always fail.

Modifying the code to ignore the result of those chown calls solves this issue.
Other than that, the only workaround that I can think of is to point CacheDir to a local directory, and then run a Pacman hook to move the downloaded files to the NFS share.


Edit:
chmod → chown

Last edited by stanczew (2024-09-20 19:56:00)

Offline

#3 2024-09-17 07:52:11

hwm
Member
From: Iserlohn, Germany
Registered: 2015-02-10
Posts: 22

Re: pacman 7 unusable with cache on nfs mount

I'm having the same problem, with /var/cache/pacman/pkg automounted to an nfs share. My workaround is to mount the nfs directory with overlayfs (upperdir and workdir on /tmp) and then copy back the new files to the nfs share. I would rather be able use the nfs share directly, however, since the pacman cache is used by 4 machines and the setup worked perfectly so far.

Offline

#4 2024-09-17 10:11:33

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,472
Website

Re: pacman 7 unusable with cache on nfs mount

If someone files abut report, I will fix this when I get back from holiday.  Otherwise I will likely forget...

Offline

#5 2024-09-17 10:28:23

icar
Member
From: Catalunya
Registered: 2020-07-31
Posts: 505

Re: pacman 7 unusable with cache on nfs mount

If issues are with permissions, have you read the announcement [0]?

You can try checking the man page [1] of Pacman configuration and see if there is anything else you can change.

[0]: https://archlinux.org/news/manual-inter … -required/
[1]: https://man.archlinux.org/man/pacman.conf.5.en

Last edited by icar (2024-09-17 10:29:43)

Online

#6 2024-09-17 11:23:18

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Yes, I have read the announcement, and the man pages, and I don't see anything else that can be done. This is just how NFS user squashing works ("man 5 exports", section "User ID Mapping").

# cd /n/pacman/cache
# mkdir test
# chown alpm:alpm test
chown: changing ownership of 'test': Operation not permitted
# chown root:root test
chown: changing ownership of 'test': Operation not permitted

----

Allan wrote:

If someone files abut report, I will fix this when I get back from holiday.  Otherwise I will likely forget...

I'll file an issue. Should it be in the https://gitlab.archlinux.org/pacman/pacman repository?

Offline

#7 2024-09-17 11:31:42

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Funnily enough, FAT has a mount option that would be helpful:

Mount options for fat
    ...
    quiet
        Turn on the quiet flag. Attempts to chown or chmod files do not return errors, although they fail. Use with caution!

Unfortunately there doesn't seem to be anything similar for NFS.

Offline

#8 2024-09-17 13:45:03

seth
Member
Registered: 2012-09-03
Posts: 58,657

Re: pacman 7 unusable with cache on nfs mount

https://man.archlinux.org/man/exports.5.en#anonuid
What if you map those to the alpm UID?

Online

#9 2024-09-17 14:08:58

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Then the first chown will work (with DownloadUser = alpm), but the second one will still fail (since it tries to change file ownership to root).
Also, ignoring the second part: alpm user is created with dynamic uid/gid, so there will probably be no way to set anonuid/anongid correctly (one would need to first manually change uid/gid of alpm user on all machines in the network to the same value).

Offline

#10 2024-09-17 14:12:38

seth
Member
Registered: 2012-09-03
Posts: 58,657

Re: pacman 7 unusable with cache on nfs mount

You can still set a fixed UID/GID, but w/ the forth and back that won't get us anywhere.
=> File a bug, the only solution is (probably) to turn the failure into a warning and hope for the best when alpm actually tries to write.

Online

#11 2024-09-17 17:05:57

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Actually, it would be easier to set DownloadUser to the user matching anonuid – then the download process would have access to anonuid's files, but since we're squashing anyway, that should not be something problematic.
But yeah, the fact that at the end Pacman tries to change ownership of downloaded files to root makes it basically incompatible with any kind of NFS squashing (which purpose is to not treat local root as remote root).
I tried replacing all_squash with root_squash (the default), so that only root user would be squashed (to the "nobody" user). This unfortunately doesn't help at all, since the nobody user doesn't have privileges to change file ownership.
The only way I found to make this work on NFS side is to use no_root_squash – then Pacman works without issues.

seth wrote:

the only solution is (probably) to turn the failure into a warning and hope for the best when alpm actually tries to write

I agree, a debug log should be enough in this case – if there are actual permission issues, then we should™ get the same error from file write that we would get from chown.

Offline

#12 2024-09-19 03:14:20

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,472
Website

Re: pacman 7 unusable with cache on nfs mount

stanczew wrote:
Allan wrote:

If someone files abut report, I will fix this when I get back from holiday.  Otherwise I will likely forget...

I'll file an issue. Should it be in the https://gitlab.archlinux.org/pacman/pacman repository?

Yes.

Offline

#13 2024-09-20 20:11:19

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Offline

#14 2024-10-05 23:12:38

madman_xxx
Member
From: PL
Registered: 2013-07-31
Posts: 35

Re: pacman 7 unusable with cache on nfs mount

(I am adding extra comments here, as I am unable to log in / register to Arch's Gitlab)

I have the same issue, but with sshfs - as I don't do "sshfs root@server" changing file owner fails. However I looked at the code and noticed:

static int finalize_download_file(const char *filename)
{
	struct stat st;
	uid_t myuid = getuid();
	ASSERT(filename != NULL, return -1);
	ASSERT(stat(filename, &st) == 0, return -1);
	if(st.st_size == 0) {
		unlink(filename);
                return 1;
	}
	if(myuid == 0) {
		ASSERT(chown(filename, 0, 0) != -1, return -1);
	}
	ASSERT(chmod(filename, ~(_getumask()) & 0666) != -1, return -1);
	return 0;
}

The condition with myuid == 0 implies that chowning is skipped when pacman is run as an unprivileged user, but I wonder how that could work if pacman disallows even downloading without installing when run as non-root:

# sudo -u alpm pacman -Sw john
error: you cannot perform this operation unless you are root.

Maybe this way we could do installs / upgrades in two steps: -Sw first, and then -S... Still a workaround, but it looks like the code is there...

Offline

#15 2024-10-05 23:15:47

madman_xxx
Member
From: PL
Registered: 2013-07-31
Posts: 35

Re: pacman 7 unusable with cache on nfs mount

Also, I don't understand this mechanic of "stealing" downloaded package files; They could stay owned by alpm, because root can read them anyway...

Offline

#16 2024-10-05 23:27:41

madman_xxx
Member
From: PL
Registered: 2013-07-31
Posts: 35

Re: pacman 7 unusable with cache on nfs mount

OK, I just found a workaround for sshfs (could be applied to other FSes that support ID mapping).

In my case all the packages are owned by UID 1000. So I mount  the cache folder with mapping root:1000 - now all the remotely cached packages look locally like they are owned by root by default. Also DownloadUser must be commented, so the packages are downloaded by root, not alpm.

Offline

#17 2024-10-06 10:42:11

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

madman_xxx wrote:

The condition with myuid == 0 implies that chowning is skipped when pacman is run as an unprivileged user, but I wonder how that could work if pacman disallows even downloading without installing when run as non-root:

You can see the reason for this condition in the commit that introduced it:
https://gitlab.archlinux.org/pacman/pac … 23aea848e5

Offline

#18 2024-10-11 12:57:30

ua4000
Member
Registered: 2015-10-14
Posts: 485

Re: pacman 7 unusable with cache on nfs mount

pacman ...
error: could not open file /var/cache/pacman/pkg/download-dPSv2e/thunderbird-128.2.2-1-x86_64.pkg.tar.zst.part: Permission denied

Problem for me was: (local) folder /var/cache/pacman/pkg was accessible  (rx) only by root, not by alpm.

ok, no surprise after reading the arch announcement, and fixed with chmod 755 /var/cache/pacman/

But it surprises, that "alpm" user "misuses" a sub-folder from root stuff.

Would it be better, to let the alpm user use it's "own" Independent temporary download folder?
in its /home/alpm, /run/user/alpm /tmp/alpm, /var/tmp/alpm, or whatsoever best ?

Last edited by ua4000 (2024-10-11 17:29:52)

Offline

#19 2024-10-11 14:22:41

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,472
Website

Re: pacman 7 unusable with cache on nfs mount

The subfolder is not the issue - the root user sets it up.  It is the changing of permissions after the download that fails.

I'll fix it when I feel motivated, but currently my I busy with things that pay my bills.

Offline

#20 2024-10-12 10:42:36

ua4000
Member
Registered: 2015-10-14
Posts: 485

Re: pacman 7 unusable with cache on nfs mount

It fails, because it's in these cases above a non local filesystem?

My proposal: Make the download folder for the alpm user configurable.
So the user could specify a local / tmpfs folder in case of issues.

# /etc/pacman.conf
#DownloadCache    = /var/cache/pacman/pkg/
DownloadCache    = /tmp/

Offline

#21 2024-10-18 21:11:59

anacron
Member
Registered: 2020-01-26
Posts: 33

Re: pacman 7 unusable with cache on nfs mount

I'm also affected by this bug. I've had to stop using my shared cache and just download everything to the local filesystem.

Offline

#22 2024-10-19 07:16:52

stanczew
Member
Registered: 2021-03-02
Posts: 91

Re: pacman 7 unusable with cache on nfs mount

Here is my workaround:

## /usr/lib/tmpfiles.d/pacman-nfs-cache.conf
d /run/pacman-cache - alpm alpm - -
## /usr/share/libalpm/hooks/zz-pacman-nfs-cache.hook
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = *

[Action]
Description = Moving packages to shared cache directory
When = PostTransaction
Exec = /bin/sh -c 'if [ "$(/bin/ls -A /run/pacman-cache)" ]; then mv /run/pacman-cache/* /your/nfs/cache/directory 2>/dev/null; fi'
## /etc/pacman.conf
[options]
CacheDir = /run/pacman-cache/

Offline

#23 2024-10-19 10:23:00

matersci
Member
From: Hellas
Registered: 2006-01-19
Posts: 169

Re: pacman 7 unusable with cache on nfs mount

I just created an alias until its fixed

"alias NFSP='umount /var/cache/pacman/pkg && pacman -Syu && mv /var/cache/pacman/pkg/* /PATH/TO/NFS/CACHE/FOLDER/ && systemctl start cacheonnfs.service'"

In case everything is already downloaded in the cache from another machine I just run a standard -Syu. If -Syu shows I have to download something I run the alias

Offline

#24 2024-10-29 08:58:08

gotheric
Member
Registered: 2012-03-27
Posts: 6

Re: pacman 7 unusable with cache on nfs mount

Still not fixed?
Is there a safe way to downgrade pacman to previous version?

Offline

#25 2024-10-29 12:58:05

seth
Member
Registered: 2012-09-03
Posts: 58,657

Re: pacman 7 unusable with cache on nfs mount

https://gitlab.archlinux.org/pacman/pacman/-/issues/194
https://bbs.archlinux.org/viewtopic.php … 9#p2201629

Is there a safe way to downgrade pacman to previous version?

No.
But you could use an older version of https://aur.archlinux.org/packages/pacman-static

Or, if this is NFS (I thik for CIFS you're fucked) just user proper posix permissions (at least for the relevant export, you can still squash the permissions for your por… media shares)

Online

Board footer

Powered by FluxBB