Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.16

Bug #10261 Transaction handling fails to halt/rollback on certain errors
Submitted: 2007-03-04 11:35 UTC
From: timj at php dot net Assigned: cellog
Status: Closed Package: PEAR (version 1.5.0)
PHP Version: 5.1.6 OS:
Roadmaps: 1.5.2    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2007-03-21 05:24 UTC
Package:
Bug Type:
Summary:
From: timj at php dot net
New email:
PHP Version: Package Version: OS:

 

 [2007-03-04 11:35 UTC] timj at php dot net (Tim Jackson)
Description: ------------ The PEAR transaction handler fails to halt/roll back on some critical errors. Consider package X, which requires package Y. If I do "pear install X", and the installation of "Y" fails then I would expect PEAR to roll back the whole transaction and not to continue installing X. Instead, for some types of installation errors, PEAR will report X as being correctly installed even though it's required dependency Y failed to install. A 100% reproducible test scenario is available. Test script: --------------- This test script reproduces the described scenario, where by way of illustration, "X" is DB_ldap and "Y" is DB. However, there is nothing special about these particular packages; they just happen to be a simple and convenient example. Start with a clean PEAR install. Assume that 1.7.9 is the latest version of PEAR::DB. We manually force an error such that the place where PEAR expects to download DB-1.7.9.tgz to is unwriteable. (For those not familiar with UNIX, the below creates an unwriteable empty file called "DB-1.7.9.tgz" in the PEAR download directory) $ pear config-get download_dir /path/to/download $ touch /path/to/download/DB-1.7.9.tgz $ chmod 000 /path/to/download/DB-1.7.9.tgz $ pear install --onlyreqdeps DB_ldap Expected result: ---------------- Once PEAR realises that it is not possible to install a dependency of DB_ldap, it should abort the whole transaction and NOT proceed to install DB_ldap with missing dependencies. Actual result: -------------- pear/DB_ldap: Skipping required dependency "pear/PEAR", is already installed downloading DB_ldap-1.1.1.tgz ... Starting to download DB_ldap-1.1.1.tgz (7,950 bytes) .....done: 7,950 bytes downloading DB-1.7.9.tgz ... Could not download from "http://pear.php.net/get/DB-1.7.9.tgz", cannot download "pear/DB" (could not open /path/to/download/DB-1.7.9.tgz for writing) Error: cannot download "pear/DB" + create dir /path/to/pear/DB about to commit 4 file operations successfully committed 4 file operations install ok: channel://pear.php.net/DB_ldap-1.1.1 [tim@langesund pear2]$ pear -c pearrc list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.2 stable Console_Getopt 1.2.2 stable DB_ldap 1.1.1 stable PEAR 1.5.0 stable Structures_Graph 1.0.2 stable Note how DB_ldap has been installed *without* its required dependency DB! The transaction should have been aborted and rolled back at the point where PEAR reported "Error: cannot download "pear/DB"".

Comments

 [2007-03-21 05:24 UTC] cellog (Greg Beaver)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.