Closed dwrobel closed 4 years ago
I have rebuilt the metadata and hope that this has fixed the issue. Could you please check?
It looks like in this case the repo is behaving correctly, but the package is not. This would only affect yum
and dnf
installs.
error: unpacking of archive failed on file /var/lib/openhab2/tmp/README: cpio: chown
I haven't changed anything to the packages since last time I tested on Fedora 31, but I'll see what the cause of this could be.
I think, I have a reproducible scenario by using the following set of commands:
$ rpm -qv openhab2
$ sudo rpm -vU --oldpackage openhab2-2.5.0-1.noarch.rpm
$ rpm -qv openhab2
$ sudo dnf localinstall -y openhab2-2.5.1-2.noarch.rpm
$ rpm -qv openhab2
$ sudo dnf localinstall -y openhab2-2.5.1-2.noarch.rpm
$ rpm -qv openhab2
$ sudo rpm -vU --oldpackage openhab2-2.5.0-1.noarch.rpm
$ rpm -qv openhab2
$ sudo rpm -vU --oldpackage openhab2-2.5.0-1.noarch.rpm
$ rpm -qv openhab2
where openhab2-2.5.0-1.noarch.rpm and openhab2-2.5.1-2.noarch.rpm should be available locally. I'm using the versions which were downloaded from the dnf
repo shortly after I did an initial installation and noticed the problem with the installation.
Here is the full log:
[dw@rpi4-dw ~]$ rpm -qv openhab2
openhab2-2.5.1-2.noarch
[dw@rpi4-dw ~]$ sudo rpm -vU --oldpackage openhab2-2.5.0-1.noarch.rpm
Verifying packages...
Preparing packages...
openhab2-0:2.5.0-1.noarch
[openHAB] openHAB was not running so will not start after upgrade.
[openHAB] Please use the command:
sudo /bin/systemctl start openhab2.service
openhab2-0:2.5.1-2.noarch
[dw@rpi4-dw ~]$ rpm -qv openhab2
openhab2-2.5.0-1.noarch
[dw@rpi4-dw ~]$ sudo dnf localinstall -y openhab2-2.5.1-2.noarch.rpm
Last metadata expiration check: 0:38:09 ago on Mon 13 Jan 2020 18:08:09 CET.
Dependencies resolved.
==============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================================================
Upgrading:
openhab2 noarch 2.5.1-2 @commandline 79 M
Transaction Summary
==============================================================================================================================================================================================================================================
Upgrade 1 Package
Total size: 79 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: openhab2-2.5.1-2.noarch 1/1
Preparing : 1/1
Running scriptlet: openhab2-2.5.1-2.noarch 1/1
Running scriptlet: openhab2-2.5.1-2.noarch 1/2
Upgrading : openhab2-2.5.1-2.noarch 1/2
Error unpacking rpm package openhab2-2.5.1-2.noarch
Running scriptlet: openhab2-2.5.0-1.noarch 2/2
error: unpacking of archive failed on file /var/lib/openhab2/tmp/README: cpio: chown
error: openhab2-0:2.5.1-2.noarch: install failed
Cleanup : openhab2-2.5.0-1.noarch 2/2
Running scriptlet: openhab2-2.5.0-1.noarch 2/2
Verifying : openhab2-2.5.1-2.noarch 1/2
Verifying : openhab2-2.5.0-1.noarch 2/2
Failed:
openhab2-2.5.1-2.noarch
Error: Transaction failed
[dw@rpi4-dw ~]$ rpm -qv openhab2
package openhab2 is not installed
[dw@rpi4-dw ~]$ sudo dnf localinstall -y openhab2-2.5.1-2.noarch.rpm
Last metadata expiration check: 0:38:37 ago on Mon 13 Jan 2020 18:08:09 CET.
Dependencies resolved.
==============================================================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================================================
Installing:
openhab2 noarch 2.5.1-2 @commandline 79 M
Transaction Summary
==============================================================================================================================================================================================================================================
Install 1 Package
Total size: 79 M
Installed size: 90 M
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: openhab2-2.5.1-2.noarch 1/1
Preparing : 1/1
Running scriptlet: openhab2-2.5.1-2.noarch 1/1
Installing : openhab2-2.5.1-2.noarch 1/1
warning: /etc/default/openhab2 created as /etc/default/openhab2.rpmnew
Running scriptlet: openhab2-2.5.1-2.noarch 1/1
[openHAB] Please use the following commands to launch openHAB on a system restart.
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable openhab2.service
[openHAB] You can start openhab2 manually by executing the command:
sudo /bin/systemctl start openhab2.service
Verifying : openhab2-2.5.1-2.noarch 1/1
Installed:
openhab2-2.5.1-2.noarch
Complete!
[dw@rpi4-dw ~]$ rpm -qv openhab2
openhab2-2.5.1-2.noarch
[dw@rpi4-dw ~]$ sudo rpm -vU --oldpackage openhab2-2.5.0-1.noarch.rpm
Verifying packages...
Preparing packages...
openhab2-0:2.5.0-1.noarch
error: unpacking of archive failed on file /var/lib/openhab2/tmp/README: cpio: chown failed - No such file or directory
error: openhab2-0:2.5.0-1.noarch: install failed
error: openhab2-0:2.5.1-2.noarch: erase skipped
[dw@rpi4-dw ~]$ rpm -qv openhab2
openhab2-2.5.1-2.noarch
[dw@rpi4-dw ~]$ sudo rpm -vU --oldpackage openhab2-2.5.0-1.noarch.rpm
Verifying packages...
Preparing packages...
openhab2-0:2.5.0-1.noarch
[openHAB] openHAB was not running so will not start after upgrade.
[openHAB] Please use the command:
sudo /bin/systemctl start openhab2.service
openhab2-0:2.5.1-2.noarch
[dw@rpi4-dw ~]$ rpm -qv openhab2
openhab2-2.5.0-1.noarch
The failure can be observed in the first attempt of both: update
and downgrade
procedure.
Looking more closely at the log I noticed that the second attempt of installation succeeded only because due to the previous transaction failure the package is marked as not installed.
$ rpm -qv openhab2
package openhab2 is not installed
Then, the next dnf
is not executed as an upgrade
but as an install
:
[dw@rpi4-dw ~]$ sudo dnf localinstall -y openhab2-2.5.1-2.noarch.rpm
That probably explains why it always succeeded in the second run.
Found the cause of the issue which has been resolved by #156. The RPM scripts were trying to force the README file from being installed even though the folder is marked for deletion on update.
Not sure if its worth creating a new package for Bintray though. Let me know your thoughts on that!
Found the cause of the issue which has been resolved by #156.
Great! I updated all my instances by using double dnf install
trick. So, if it's just one button click operation to create an update - then I would say yes. Otherwise, I would left it to you.
I have tried to update from 2.5.0 to 2.5.1-2 on RPi4 on Fedora31 and I’m observing the following error during update:
A full log (please ignore the everything related to mosquitto - it has no impact on openhab2 installation):
Interestingly, the same error happened earlier, when I tried to update from 2.4.0 to 2.5.0 using dnf, (I had to update it manually using rpm).