Opened 6 years ago

Last modified 6 years ago

#10105 new bug

[package_daemon] leaves packages inactivated

Reported by: diver Owned by: bonefish
Priority: normal Milestone: R1
Component: Servers/package_daemon Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

package_daemon fails to activate packages after (manual?) install if one of the packages is broken and can't be activated.

For example I have these packages on my Desktop:

groff-1.20.1-3-x86_gcc2.hpkg readline-6.2-3-x86_gcc2.hpkg distcc-3.1-2-x86_gcc2.hpkg <--- this one is broken nano-2.2.6-3-x86_gcc2.hpkg sqlite-3.8.0.2-1-x86_gcc2.hpkg python-2.6.8-4-x86_gcc2.hpkg

and I'm installing them to ~/config/packages.

After doing that package_daemon complains that it failed to commit transaction (btw, it's not clear what to to about that nor how to fix it nor where this message came from) because of the broken distcc package and leaves all other packages unactivated. That way if you manually try to install distcc-3.1-2-x86_gcc2.hpkg to~/config/packages (where all previous packages already present) package_daemon will try to redownload and install all these packages again which it will fail to do (install part) because these packages are already exist.

Change History (6)

comment:1 by diver, 6 years ago

Installing distcc using HaikuDepot also fails:

package_daemon [209019941: 197] Volume::_PackagesEntryCreated("groff-1.20.1-3-x86_gcc2.hpkg") package_daemon [209019983: 197] failed to init package for file "groff-1.20.1-3-x86_gcc2.hpkg" package_daemon [209019995: 197] Volume::_PackagesEntryCreated("sqlite-3.8.0.2-1-x86_gcc2.hpkg") package_daemon [209020006: 197] failed to init package for file "sqlite-3.8.0.2-1-x86_gcc2.hpkg" package_daemon [209020014: 197] Volume::_PackagesEntryCreated("readline-6.2-3-x86_gcc2.hpkg") package_daemon [209020024: 197] failed to init package for file "readline-6.2-3-x86_gcc2.hpkg" package_daemon [209020033: 197] Volume::_PackagesEntryCreated("nano-2.2.6-3-x86_gcc2.hpkg") package_daemon [209020043: 197] failed to init package for file "nano-2.2.6-3-x86_gcc2.hpkg" package_daemon [209020051: 197] Volume::_PackagesEntryCreated("python-2.6.8-4-x86_gcc2.hpkg") package_daemon [209020061: 197] failed to init package for file "python-2.6.8-4-x86_gcc2.hpkg" package_daemon [209020069: 197] Volume::_PackagesEntryCreated("distcc-3.1-2-x86_gcc2.hpkg") package_daemon [209020079: 197] failed to init package for file "distcc-3.1-2-x86_gcc2.hpkg" package_daemon [209020086: 197] Volume::_PackagesEntryRemoved("groff-1.20.1-3-x86_gcc2.hpkg") package_daemon [209020089: 197] Volume::_PackagesEntryRemoved("distcc-3.1-2-x86_gcc2.hpkg") package_daemon [209020092: 197] Volume::_PackagesEntryRemoved("python-2.6.8-4-x86_gcc2.hpkg") package_daemon [209020094: 197] Volume::_PackagesEntryRemoved("nano-2.2.6-3-x86_gcc2.hpkg") package_daemon [209020097: 197] Volume::_PackagesEntryRemoved("readline-6.2-3-x86_gcc2.hpkg") package_daemon [209020099: 197] Volume::_PackagesEntryRemoved("sqlite-3.8.0.2-1-x86_gcc2.hpkg")

comment:2 by diver, 6 years ago

Same problem using pkgman

pkgman install --home distcc
Downloading repochecksum-1...
##################################################
Finished downloading repochecksum-1.
Validating checksum for HaikuPorts...
Validating checksum for HaikuPorts complete.
The following changes will be made:
  in home:
    install package groff-1.20.1-3-x86_gcc2.hpkg from repository HaikuPorts
    install package sqlite-3.8.0.2-1-x86_gcc2.hpkg from repository HaikuPorts
    install package readline-6.2-3-x86_gcc2.hpkg from repository HaikuPorts
    install package nano-2.2.6-3-x86_gcc2.hpkg from repository HaikuPorts
    install package python-2.6.8-4-x86_gcc2.hpkg from repository HaikuPorts
    install package distcc-3.1-2-x86_gcc2.hpkg from repository HaikuPorts
Continue? [y/n] (y) : y
Downloading groff-1.20.1-3-x86_gcc2.hpkg...
##################################################
Finished downloading groff-1.20.1-3-x86_gcc2.hpkg.
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/groff-1.20.1-3-x86_gcc2.hpkg...
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/groff-1.20.1-3-x86_gcc2.hpkg complete.
Downloading sqlite-3.8.0.2-1-x86_gcc2.hpkg...
##################################################
Finished downloading sqlite-3.8.0.2-1-x86_gcc2.hpkg.
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/sqlite-3.8.0.2-1-x86_gcc2.hpkg...
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/sqlite-3.8.0.2-1-x86_gcc2.hpkg complete.
Downloading readline-6.2-3-x86_gcc2.hpkg...
##################################################
Finished downloading readline-6.2-3-x86_gcc2.hpkg.
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/readline-6.2-3-x86_gcc2.hpkg...
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/readline-6.2-3-x86_gcc2.hpkg complete.
Downloading nano-2.2.6-3-x86_gcc2.hpkg...
##################################################
Finished downloading nano-2.2.6-3-x86_gcc2.hpkg.
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/nano-2.2.6-3-x86_gcc2.hpkg...
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/nano-2.2.6-3-x86_gcc2.hpkg complete.
Downloading python-2.6.8-4-x86_gcc2.hpkg...
##################################################
Finished downloading python-2.6.8-4-x86_gcc2.hpkg.
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/python-2.6.8-4-x86_gcc2.hpkg...
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/python-2.6.8-4-x86_gcc2.hpkg complete.
Downloading distcc-3.1-2-x86_gcc2.hpkg...
##################################################
Finished downloading distcc-3.1-2-x86_gcc2.hpkg.
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/distcc-3.1-2-x86_gcc2.hpkg...
Validating checksum for http://haiku-files.org/files/repo/d39e5e5db891ef4c5327232776a4f9915d26bff74dbe25f1445746b5af3c01cc/packages/distcc-3.1-2-x86_gcc2.hpkg complete.
[home] Applying changes ...
*** failed to commit transaction: No such file or directory

Also it is not clear which package caused commit transaction to fail. And while we're here can't we print Validating checksum (and then complete) in the same line to reduce the amount of output?

comment:3 by diver, 6 years ago

Still reproducible in hrev46360 with hrev46284 reverted.

comment:4 by bonefish, 6 years ago

TBH, I'm not sure what to do about this. IIRC I fixed the error message, so that the reason for the failed transaction should be shown at least.

When you manually move several packages at once into the packages folder, they will be handled together. This is intentional, since there could be dependencies between them. But this also means that either all or none of them will be activated.

If you've moved the packages in manually, you will have to move them out manually as well (unless you've done something else in between Tracker's undo should do the trick). It would be nice, if the Tracker window could show which packages are active and which aren't, but with the current Tracker this isn't trivial to implement.

Generally a more intelligent handling of package downloading should be implemented. Packages that have been deactivated or failed to activate and are still lying around in one of the old-state or transaction directories shouldn't be re-downloaded, when requesting to install them. There should also be an option (or an automatism) to clean up old package files.

in reply to:  4 comment:5 by diver, 6 years ago

Replying to bonefish:

When you manually move several packages at once into the packages folder, they will be handled together. This is intentional, since there could be dependencies between them. But this also means that either all or none of them will be activated.

Is this also true for packages/deps installed with pkgman? Because that also fails. I wonder if it's possible to detect such dependencies between them and install at least those which can be installed.

comment:6 by bonefish, 6 years ago

All installation methods (manual, pkgman, HaikuDepot) work the same in this respect. When you request the installation/activation of something, all or nothing will be activated. I also don't think it would be a good idea, when the user requests pkgman foo and something fails, that the end result is that the requested "foo" is not activated, but stuff that wasn't requested is.

For the manual installation it would certainly make some sense to try to be more user friendly. E.g. popping up a dialog with more options -- select which of the pending packages to activate, or move them out again -- would be a possibility. ATM that isn't a priority, though.

Note: See TracTickets for help on using tickets.