Upgrading a RPM reports: Error: RPM failed: ... cpio: chmod failed - No such file or directory

This document (000020364) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15 SP3
SUSE Linux Enterprise Server 15 SP2

Mounted network share, eg NFS mount

 

Situation

When upgrading a RPM, the following error is reported when a mountpoint is being covered by e.g. NFS mount (see the additional information section for an example output for /home):
Installing: filesystem-15.0-11.3.2.x86_64 [....Installation of filesystem-15.0-11.3.2.x86_64 failed:
[...]
Error: Subprocess failed. Error: RPM failed: error: unpacking of archive failed on file /home: cpio: chmod failed - No such file or directory
It does not matter whether the RPM is being upgraded or downgraded, the issue is seen while installing a RPM that tries to touch the mountpoint.

Resolution

To avoid this behaviour, please add the following to /etc/rpm/macros
echo "%_netsharedpath /home" >> /etc/rpm/macros
This will prevent the RPM from touching the mountpoint while this is being covered by a network-mounted filesystem.

Cause

From /usr/lib/rpm/macros
# A colon separated list of paths where files should *not* be installed.
# Usually, these are network file system mount points.
#
# %_netsharedpath

Additional Information

Example NFS mount for /home (fail)

cssle15sp1:~ # zypper in --oldpackage filesystem=15.0-9.2
Refreshing service 'Basesystem_Module_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Server_x86_64'.
Refreshing service 'Server_Applications_Module_x86_64'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be downgraded:
  filesystem

1 package to downgrade.
Overall download size: 68.8 KiB. Already cached: 0 B. After the operation, 142.0 B will be freed.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package filesystem-15.0-9.2.x86_64                                                                                          (1/1),  68.8 KiB (  393   B unpacked)
Retrieving: filesystem-15.0-9.2.x86_64.rpm ...........................................................................................................................[done]

Checking for file conflicts: .........................................................................................................................................[done]
(1/1) Installing: filesystem-15.0-9.2.x86_64 ........................................................................................................................[error]
Installation of filesystem-15.0-9.2.x86_64 failed:
Error: Subprocess failed. Error: RPM failed: error: unpacking of archive failed on file /home: cpio: chmod failed - No such file or directory                               
error: filesystem-15.0-9.2.x86_64: install failed                                                                                                                           
error: filesystem-15.0-11.3.2.x86_64: erase skipped


Successful mount with active echo "%_netsharedpath /home" >> /etc/rpm/macros (solution)

cssle15sp1:~ # echo "%_netsharedpath /home" >> /etc/rpm/macros
cssle15sp1:~ # zypper in --oldpackage filesystem=15.0-9.2
Refreshing service 'Basesystem_Module_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Server_x86_64'.
Refreshing service 'Server_Applications_Module_x86_64'.
Retrieving repository 'SLE-Module-Basesystem15-SP2-Updates' metadata .................................................................................................[done]
Building repository 'SLE-Module-Basesystem15-SP2-Updates' cache ......................................................................................................[done]
Retrieving repository 'SLE-Module-Server-Applications15-SP2-Updates' metadata ........................................................................................[done]
Building repository 'SLE-Module-Server-Applications15-SP2-Updates' cache .............................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be downgraded:
  filesystem

1 package to downgrade.
Overall download size: 68.8 KiB. Already cached: 0 B. After the operation, 142.0 B will be freed.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package filesystem-15.0-9.2.x86_64                                                                                          (1/1),  68.8 KiB (  393   B unpacked)
Retrieving: filesystem-15.0-9.2.x86_64.rpm ...........................................................................................................................[done]

Checking for file conflicts: .........................................................................................................................................[done]
(1/1) Installing: filesystem-15.0-9.2.x86_64 .........................................................................................................................[done]
 
cssle15sp1:~ # zypper in filesystem
Refreshing service 'Basesystem_Module_x86_64'.
Refreshing service 'SUSE_Linux_Enterprise_Server_x86_64'.
Refreshing service 'Server_Applications_Module_x86_64'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following package is going to be upgraded:
  filesystem

1 package to upgrade.
Overall download size: 64.1 KiB. Already cached: 0 B. After the operation, additional 142.0 B will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package filesystem-15.0-11.3.2.x86_64                                                                                       (1/1),  64.1 KiB (  535   B unpacked)
Retrieving: filesystem-15.0-11.3.2.x86_64.rpm ........................................................................................................................[done]

Checking for file conflicts: .........................................................................................................................................[done]
(1/1) Installing: filesystem-15.0-11.3.2.x86_64 ......................................................................................................................[done]
 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020364
  • Creation Date: 13-Aug-2021
  • Modified Date:13-Aug-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center