FS#54239 - Post Update Hook not called after errors
Attached to Project:
Pacman
Opened by Florijan Hamzic (cin) - Wednesday, 31 May 2017, 11:53 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 31 May 2017, 15:15 GMT
Opened by Florijan Hamzic (cin) - Wednesday, 31 May 2017, 11:53 GMT
Last edited by Doug Newgard (Scimmia) - Wednesday, 31 May 2017, 15:15 GMT
|
Details
Description:
I always run into the same issue on my server. I am doing a system update "pacman -Syu". kernel and other packages are updated but the package mantisbt will throw some "existing file errors". Ok so then i solve this existing file problem and reinstall mantisbt, everything looks fine for me and i am going to reboot the server but it will not came up because the post install hook of linux package is not executed due to the errors. Not sure if this is a bug but it is a problem because linux or other packages which are installed correctly should complete or rollback their installation when other packages thrown errors otherwise it can lead to very strange problems |
This task depends upon
My guess is this is a bug in yaourt or esle you wouldn't have been the first to run into this.
[2017-05-30 14:59] [ALPM] error: problem occurred while upgrading roundcubemail
[2017-05-30 14:59] [ALPM] upgraded roundcubemail (1.2.4-1 -> 1.2.5-1)
[2017-05-30 14:59] [ALPM] transaction failed
[2017-05-30 15:00] [PACMAN] Running 'pacman --color auto -Sy'
[2017-05-30 15:00] [PACMAN] synchronizing package lists
[2017-05-30 15:00] [PACMAN] Running 'pacman --color auto -S -u'
[2017-05-30 15:00] [PACMAN] starting full system upgrade
sorry it was not mantisbt it was the package roundcube. It said some directories already exist (skin and program)
you can see in the log what happened. After the initial update i fixed the roundcube directory problem and triggered another update, i also wondered that the packages already have been installed and it showed so less packages this time, as normaly they not installed in case of an error
somewhere later you can see that i installed the linux package explicitley to get it work again
But it said there is an existing directory 3 times (skins, program and plugins)
from my bash history:
cd /usr/share/webapps/roundcubemail/public_html/skins
ll
..
ll
cd skins/
ll
..
ll
mv skins/ _skins
sudo mv skins/ _skins
ll
mv plugins/ _plugins
sudo mv plugins/ _plugins
sudo mv program/ _program
1839082 drwxr-xr-x 37 http http 4.0K Aug 29 2016 _plugins
2097164 drwxr-xr-x 2 root root 4.0K Apr 28 08:03 program
1840971 drwxr-xr-x 4 http http 4.0K Aug 29 2016 _program
1838795 drwxr-xr-x 5 http http 4.0K Aug 29 2016 _skins
1838523 lrwxrwxrwx 1 root root 12 Apr 28 08:03 .htaccess -> ../.htaccess
1838522 -rw-r--r-- 1 root root 1.5K Apr 28 08:03 index.php
1838525 lrwxrwxrwx 1 root root 10 Apr 28 08:03 plugins -> ../plugins
1838526 lrwxrwxrwx 1 root root 13 Apr 28 08:03 robots.txt -> ../robots.txt
1838524 lrwxrwxrwx 1 root root 8 Apr 28 08:03 skins -> ../skins
In my case, I ran pacman -Syu and got the following error (as written in /var/log/pacman.log):
...
[2017-06-17 00:31] [ALPM] upgraded linux (4.11.3-1 -> 4.11.5-1)
[2017-06-17 00:31] [ALPM-SCRIPTLET] >>> Updating module dependencies. Please wait ...
...
[2017-06-17 00:33] [ALPM] error: cannot remove /var/cache/pacman/pkg/ (Not a directory)
[2017-06-17 00:33] [ALPM] upgraded pacman (5.0.1-5 -> 5.0.2-1)
[2017-06-17 00:33] [ALPM] transaction failed
This occurred because I made /var/cache/pacman/pkg/ a symlink to another partition with more disk space. (Maybe there's a better way for me to do this?)
Anyways, I got pacman updated and ran pacman -Syu again to finish my system update, and then I rebooted. But of course, the hooks for linux (and many other packages) weren't run, so the boot failed. Of course, Arch is awesome so fixing this wasn't difficult once I figured out what had happened. However, I think the following suggestion would have prevented the premature reboot:
--------- SUGGESTION: ---------
I think it would be very very helpful if pacman would warn the user that the hooks for certain packages weren't run. This warning should be written out to the terminal and to /var/log/pacman.log and it should list the packages with hooks that still need to be run. This way, the user can run the hooks by just reinstalling these packages.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here is another user who seems to have had the same issue:
https://www.soimort.org/notes/170407/
He proposed a more complicated solution. However, I think a warning message should be simple and sufficient.
thanks!