Bug 1047772 - [origin_runtime_169]Show stack trace messages when git push php app with dependencies in deplist.txt
Summary: [origin_runtime_169]Show stack trace messages when git push php app with depe...
Keywords:
Status: CLOSED DUPLICATE of bug 1047777
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1000223 1047777
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-02 08:28 UTC by Nan Wei
Modified: 2016-05-25 13:24 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1000223
Environment:
Last Closed: 2014-01-02 08:43:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Nan Wei 2014-01-02 08:28:45 UTC
+++ This bug was initially created as a clone of Bug #1000223 +++

Description of problem:
When git push a drupal-quickstart app, will meet "PHP Stack trace" messages, but the pushing is successful.

Version-Release number of selected component (if applicable):
devenv_3690

How reproducible:
always

Steps to Reproduce:
1. Create a drupal-quickstart app
rhc app create drupal php-5.3 mysql-5.1 cron --from-code=git://github.com/VojtechVitek/drupal-quickstart.git
2. Do some changes in this app local repo and git push
cd drupal
echo "I am testing file." > testccy.txt
git add .; git commit -amp ;git push
3. Check the result of pushing
rhc ssh drupal 'ls app-root/runtime/repo'

Actual results:
At step 2:
[master 15ba064] p
 1 file changed, 1 insertion(+)
 create mode 100644 testccy.txt
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 283 bytes, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Stopping Cron cartridge
remote: Stopping PHP cartridge
remote: Waiting for stop to finish
remote: Stopping MySQL cartridge
remote: Building PHP cartridge
remote: Checking pear: pear.drush.org/drush
remote: 
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Registry->doList() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Registry->doFileList() /usr/share/pear/PEAR/Command/Registry.php:146
remote: PHP   5. PEAR_Registry->getPackage() /usr/share/pear/PEAR/Command/Registry.php:278
remote: PHP   6. PEAR_Registry->_getPackage() /usr/share/pear/PEAR/Registry.php:1962
remote: PHP   7. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1443
remote: PHP   8. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: PHP Warning:  Invalid argument supplied for foreach() in /usr/share/pear/PEAR/Command/Registry.php on line 304
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Registry->doList() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Registry->doFileList() /usr/share/pear/PEAR/Command/Registry.php:146
remote: PHP Notice:  Undefined index: data in /usr/share/pear/PEAR/Frontend/CLI.php on line 511
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Registry->doList() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Registry->doFileList() /usr/share/pear/PEAR/Command/Registry.php:146
remote: PHP   5. PEAR_Frontend_CLI->outputData() /usr/share/pear/PEAR/Command/Registry.php:368
remote: PHP Notice:  Undefined index: data in /usr/share/pear/PEAR/Frontend/CLI.php on line 530
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Registry->doList() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Registry->doFileList() /usr/share/pear/PEAR/Command/Registry.php:146
remote: PHP   5. PEAR_Frontend_CLI->outputData() /usr/share/pear/PEAR/Command/Registry.php:368
remote: PHP Notice:  Undefined index: data in /usr/share/pear/PEAR/Frontend/CLI.php on line 535
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Registry->doList() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Registry->doFileList() /usr/share/pear/PEAR/Command/Registry.php:146
remote: PHP   5. PEAR_Frontend_CLI->outputData() /usr/share/pear/PEAR/Command/Registry.php:368
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Install->_filterUptodatePackages() /usr/share/pear/PEAR/Command/Install.php:619
remote: PHP   5. PEAR_REST_10->listLatestUpgrades() /usr/share/pear/PEAR/Command/Install.php:1233
remote: PHP   6. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/REST/10.php:672
remote: PHP   7. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP   8. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Install->_filterUptodatePackages() /usr/share/pear/PEAR/Command/Install.php:619
remote: PHP   5. PEAR_REST_10->listLatestUpgrades() /usr/share/pear/PEAR/Command/Install.php:1233
remote: PHP   6. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/REST/10.php:673
remote: PHP   7. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP   8. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: 
remote: Warning: in_array() expects parameter 2 to be array, boolean given in 10.php on line 707
remote: PHP Warning:  in_array() expects parameter 2 to be array, boolean given in /usr/share/pear/PEAR/REST/10.php on line 707
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Install->_filterUptodatePackages() /usr/share/pear/PEAR/Command/Install.php:619
remote: PHP   5. PEAR_REST_10->listLatestUpgrades() /usr/share/pear/PEAR/Command/Install.php:1233
remote: PHP   6. in_array() /usr/share/pear/PEAR/REST/10.php:707
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Command_Install->_filterUptodatePackages() /usr/share/pear/PEAR/Command/Install.php:619
remote: PHP   5. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/Command/Install.php:1250
remote: PHP   6. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP   7. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661
remote: PHP   5. PEAR_Downloader_Package->initialize() /usr/share/pear/PEAR/Downloader.php:279
remote: PHP   6. PEAR_Downloader_Package->_fromString() /usr/share/pear/PEAR/Downloader/Package.php:190
remote: PHP   7. PEAR_Downloader->_getPackageDownloadUrl() /usr/share/pear/PEAR/Downloader/Package.php:1713
remote: PHP   8. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/Downloader.php:815
remote: PHP   9. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP  10. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661
remote: PHP   5. PEAR_Downloader_Package->initialize() /usr/share/pear/PEAR/Downloader.php:279
remote: PHP   6. PEAR_Downloader_Package->_fromString() /usr/share/pear/PEAR/Downloader/Package.php:190
remote: PHP   7. PEAR_Downloader->_getPackageDownloadUrl() /usr/share/pear/PEAR/Downloader/Package.php:1713
remote: PHP   8. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/Downloader.php:816
remote: PHP   9. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP  10. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Downloader->download() /usr/share/pear/PEAR/Command/Install.php:661
remote: PHP   5. PEAR_Downloader_Package->removeInstalled() /usr/share/pear/PEAR/Downloader.php:429
remote: PHP   6. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/Downloader/Package.php:416
remote: PHP   7. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP   8. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: downloading drush-6.0.0.tgz ...
remote: Starting to download drush-6.0.0.tgz (508,464 bytes)
remote: .................................................................done: 508,464 bytes
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Installer->install() /usr/share/pear/PEAR/Command/Install.php:708
remote: PHP   5. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/Installer.php:1337
remote: PHP   6. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP   7. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: 
remote: Notice: unserialize(): Error at offset 51564 of 128421 bytes in Registry.php on line 1145
remote: PHP Notice:  unserialize(): Error at offset 51564 of 128421 bytes in /usr/share/pear/PEAR/Registry.php on line 1145
remote: PHP Stack trace:
remote: PHP   1. {main}() /usr/share/pear/pearcmd.php:0
remote: PHP   2. PEAR_Command_Common->run() /usr/share/pear/pearcmd.php:305
remote: PHP   3. PEAR_Command_Install->doInstall() /usr/share/pear/PEAR/Command/Common.php:271
remote: PHP   4. PEAR_Installer->install() /usr/share/pear/PEAR/Command/Install.php:708
remote: PHP   5. PEAR_Installer->_deletePackageFiles() /usr/share/pear/PEAR/Installer.php:1350
remote: PHP   6. PEAR_Registry->packageInfo() /usr/share/pear/PEAR/Installer.php:179
remote: PHP   7. PEAR_Registry->_packageInfo() /usr/share/pear/PEAR/Registry.php:1648
remote: PHP   8. unserialize() /usr/share/pear/PEAR/Registry.php:1145
remote: ERROR: pear.drush.org/drush not installed
remote: 
remote: Drupal is already installed at /var/lib/openshift/428370263392679565983744/app-root/data/downloads/drupal-7.23
remote: 
remote: Starting application drupal
remote: Starting Cron cartridge
remote: Starting MySQL cartridge
remote: Drupal is already configured.  Delete settings.php to rerun setup
remote: 
remote: Starting PHP cartridge
To ssh://428370263392679565983744.rhcloud.com/~/git/drupal.git/
   bbdf8e7..15ba064  master -> master

At step 3:
deplist.txt
libs
misc
php
README.md
testccy.txt

Expected results:
Should not prompt stack trace messages when pushing a drupal-quickstart app.

Additional info:

--- Additional comment from Vojtech Vitek on 2013-09-02 12:33:57 EDT ---

These notices point to PEAR data unserialization. Let me dig into the PEAR registry files that could be potentially malformed.

--- Additional comment from Andy Goldstein on 2013-10-16 09:07:06 EDT ---

I looked into this a bit more, and I've determined the root cause is because of this line that replaces absolute paths to the gear home directory with ~:

https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-php/bin/control#L92

For my test app, it created a registry file such as /var/lib/openshift/php1-agoldste/php/phplib/pear/pear/php/.registry/.channel.pear.drush.org/drush.reg. Looking at this file, when the home dir replacement is done, the string serialization info (i.e. string length) is not updated, so deserialization fails. In my test app, this

s:12:"installed_as";s:96:"/var/lib/openshift/525e8b574e4758f096000007/php/phplib/pear/pear/php/drush/classes/DrushRole.php";}

is converted to

s:12:"installed_as";s:96:"~/php/phplib/pear/pear/php/drush/classes/DrushRole.php";}

The s:96 isn't changed accordingly to reflect the shorter string length, which breaks deserialization.

--- Additional comment from Hiro Asari on 2013-10-21 16:53:59 EDT ---



--- Additional comment from Hiro Asari on 2013-10-21 16:57:01 EDT ---

https://github.com/openshift/origin-server/commit/ad869d8 introduced this `sed` logic.

--- Additional comment from Hiro Asari on 2013-10-21 17:04:38 EDT ---

Correction. https://github.com/openshift/origin-server/commit/e608e5a

--- Additional comment from Hiro Asari on 2013-10-22 10:11:09 EDT ---

Bypassing the `sed` logic on the main gear:

diff --git a/cartridges/openshift-origin-cartridge-php/bin/control b/cartridges/openshift-origin-cartridge-php/bin/control
index 0876d67..64156a3 100755
--- a/cartridges/openshift-origin-cartridge-php/bin/control
+++ b/cartridges/openshift-origin-cartridge-php/bin/control
@@ -90,8 +90,10 @@ function build() {
            else
                echo "Extension already installed in the system: $f"
            fi
            # Remove gear-specific absolute paths from the generated PEAR files on scaled gears
            if [ ${OPENSHIFT_APP_DNS} != ${OPENSHIFT_GEAR_DNS} ]; then
              find ${OPENSHIFT_PHP_DIR}phplib/pear/pear/ -type f ! -name '.*' -exec sed -i "s|${OPENSHIFT_HOMEDIR}|~/|g" {} \;
            fi
        done
    fi
    return 0


will resolve the problem with "PHP Stack trace" shown in the description of this ticket. (This *should* resolve the problem described in Bug 1020011.)

The problem with Drupal quickstart still exists after this, but it is very much like one described in Bug 1018387.

--- Additional comment from Andy Goldstein on 2013-10-22 10:16:32 EDT ---

I'm not sure any invocation of sed that ends up modifying the serialized registry files will work *unless* you also modify the string lengths.

--- Additional comment from Hiro Asari on 2013-10-22 10:30:35 EDT ---

After a little further investigation, I believe that it *appears* to work because:

1. 'git push' ends up copying files from the main gear to the secondary gears without modifying, and
2. the main gear and the secondary gears live on the same node, so that the directories exist.

This leads me to believe that https://trello.com/c/HOKvYxdJ/224-3-allow-php-pear-to-work-with-jenkins (which https://github.com/openshift/origin-server/commit/e608e5a aims to address) is not really complete.

--- Additional comment from Hiro Asari on 2013-10-23 10:13:59 EDT ---

Just realized this is a Trello card BZ. Sending back to Vojtech.

--- Additional comment from Hou Jianwei on 2013-10-24 23:18:33 EDT ---

Is pear causing this problem? I was unable to access pear channel
[php1-jhou.int.rhcloud.com 5269dc836cec0e8a8d0000e5]\> pear channel-discover shupp.github.com/pirum
Could not open input file: ~/php/phplib/pear/pear/php/pearcmd.php

--- Additional comment from Andy Goldstein on 2013-11-18 11:10:28 EST ---

Comment 1 Nan Wei 2014-01-02 08:43:01 UTC
sorry, I don't care to clone more than one.

*** This bug has been marked as a duplicate of bug 1047777 ***


Note You need to log in before you can comment on or make changes to this bug.