Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1172055 - Can not install dependency by composer in php gear due to missing '$OPENSHIFT_PHP_DIR/usr/bin' in $OPENSHIFT_PHP_PATH_ELEMENT after upgrade from OSE 2.1->2.2
Can not install dependency by composer in php gear due to missing '$OPENSHIFT...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Upgrade (Show other bugs)
2.2.0
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Brenton Leanhardt
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-12-09 05:12 EST by Ma xiaoqiang
Modified: 2016-07-03 20:44 EDT (History)
8 users (show)

See Also:
Fixed In Version: openshift-origin-cartridge-php-1.33.1.1-1.el6op
Doc Type: Bug Fix
Doc Text:
The openshift-origin-cartridge-php upgrade script previously did not properly upgrade existing cartridges to allow for Composer to be used. As a result, any cartridges with a version greater than 0.0.17 was not properly upgraded with Composer functionality; the Composer directory was not created, breaking composer functionality. This bug fix updates the upgrade script to perform Composer migration steps on any cartridge with a version less than that used in OpenShift Enterprise release 2.2.6 (0.0.26.1). As a result, PHP cartridges existing before Composer features were added are able to use Composer after an upgrade.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-21 15:11:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1463 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.6 bug fix and enhancement update 2015-07-21 19:11:33 EDT

  None (edit)
Description Ma xiaoqiang 2014-12-09 05:12:29 EST
Description of problem:
Can not install dependency by composer in php gear after upgrade from OSE 2.1->2.2

Missing '$OPENSHIFT_PHP_DIR/usr/bin' element in $OPENSHIFT_PHP_PATH_ELEMENT

Version-Release number of selected component (if applicable):
openshift-origin-cartridge-php-1.29.1.0-1.el6op.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a php app on old server and upgrade to latest server
2. Add a use_composer marker
   # touch .openshift/markers/use_composer

3. Modify the composer.json in repo
   eg:
{
    "require": {
        "monolog/monolog": "1.0.*"
    }
}

4. git push and check the app


Actual results:
Can not found the command 'composer'

Expected results:
Deploy successfully.

Additional info:
Even if OPENSHIFT_PHP_PATH_ELEMENT is composed corectly, composer functionality still does not work, because the following block code is never called, this is similar to BZ#1170784
#vim /usr/libexec/openshift/cartridges/php/bin/upgrade
if [[ $curr == 0.0.17 ]]; then
    source ${OPENSHIFT_PHP_DIR}usr/lib/php_config
    rm -f ${OPENSHIFT_PHP_DIR}configuration/etc/php.d/*
    echo > ${OPENSHIFT_PHP_DIR}configuration/etc/php.d/openshift.ini
    chown $OPENSHIFT_GEAR_UUID:$OPENSHIFT_GEAR_UUID ${OPENSHIFT_PHP_DIR}configuration/etc/php.d/openshift.ini
    chcon -u unconfined_u ${OPENSHIFT_PHP_DIR}configuration/etc/php.d/openshift.ini
    update_configuration
    mkdir -p ${OPENSHIFT_HOMEDIR}.composer
    chown $OPENSHIFT_GEAR_UUID:$OPENSHIFT_GEAR_UUID ${OPENSHIFT_HOMEDIR}.composer
    chcon -u unconfined_u ${OPENSHIFT_HOMEDIR}.composer
fi
Comment 8 Ma xiaoqiang 2015-05-12 01:20:10 EDT
Check on puddle [2.2.6/2015-05-11.1]


1. Create some php apps(php-5.4,php-5.3), update the env 
2. Add use_composer marker , composer.json and replace the index.php file in repo
# touch .openshift/markers/use_composer
# cat composer.json 
{
    "require": {
        "pear-pear.php.net/Mail": "*",
        "pear-pear.php.net/xml_serializer": "*"
    },
    "repositories": [
        {
            "type": "pear",
            "url": "http://pear.php.net"
        }
    ]
}

3. deploy the app
remote: Installing dependencies (including require-dev)
remote:   - Installing pear-pear.php.net/mail (1.2.0)
remote:     Downloading
remote: Writing lock file
remote: Generating optimized autoload files
remote: Preparing build for deployment

Can download and install dependency.
Comment 10 errata-xmlrpc 2015-07-21 15:11:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1463.html

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