Bug 996616 - Magento quickstart - not able to create scalable app
Magento quickstart - not able to create scalable app
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Templates (Show other bugs)
1.x
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Dan McPherson
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-13 10:29 EDT by david.collen
Modified: 2014-04-09 11:17 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-09 11:17:32 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)

  None (edit)
Description david.collen 2013-08-13 10:29:39 EDT
Description of problem:

Creating a magento app from the quickstart works fine, but once scaling is enabled it fails.

How reproducible:


Steps to Reproduce:
1. rhc app create MYAPP php-5.3 mysql-5.1 --from-code=https://github.com/openshift/magento-example -s

Actual results:

The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 520a3c694382ec17c5000595 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c4,c972' /bin/sh -c \"gear
postreceive >> /tmp/initial-build.log 2>&1\""' returned an error. rc=255

.Last 10 kB of build output:
httpd (no pid file) not running
Starting application essence
Extracting sample data
Poulating database
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '' (111)
An error occurred executing 'gear postreceive' (exit code: 1)
Error message: Failed to execute action hook 'deploy' for 520a3c694382ec17c5000595 application MYAPP


Expected results:

Creating a scalable magento app

Additional info:
Comment 1 david.collen 2013-08-13 16:59:21 EDT
It seems that this Quickstart needs OPENSHIFT_MYSQL_DB_SOCKET to be set, but this appears to be unset in a scaled app
Comment 2 Nam Duong 2013-08-13 17:18:48 EDT
Thanks @David!  I attempted to modify the quickstart to deploy on a single-gear scalable app by updating a couple of lines:  
1) Update: 
mysql --socket=${OPENSHIFT_MYSQL_DB_SOCKET} -u${OPENSHIFT_MYSQL_DB_USERNAME} -p${OPENSHIFT_MYSQL_DB_PASSWORD} ${OPENSHIFT_APP_NAME} < ${OPENSHIFT_TMP_DIR}magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql
To:
mysql -u${OPENSHIFT_MYSQL_DB_USERNAME} -p${OPENSHIFT_MYSQL_DB_PASSWORD} -h${OPENSHIFT_MYSQL_DB_HOST} -P${OPENSHIFT_MYSQL_DB_PORT} ${OPENSHIFT_APP_NAME} < ${OPENSHIFT_TMP_DIR}magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql


2) Update:
    --db_host "$OPENSHIFT_MYSQL_DB_HOST" \
To:
    --db_host "$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT" \  

That got the quickstart to deploy, but on scale-up, it errors out due to the deploy hook being triggered.  The quickstart needs to be revisited for scalable apps.
Comment 3 Dan McPherson 2014-03-13 16:48:27 EDT
I've fixed it so you can at least create a scalable app now so if you want your db on a separate gear.  As far as actually scaling, I have made it work if you git push before you scale up and anything you change in media is oh the head gear.

So if you:

create app
change whatever you want in app-root/data/media or app-root/data/local.xml
git push
then scale up

It will be synced to all the gears.  You can scale up all you want after that but in order to change anything in media you would have to git push again.

So basically scaling up is still for experts/limited use cases.
Comment 4 Wei Sun 2014-03-13 22:45:54 EDT
Verified on devenv_4509
Now could create a scalable magento app successfully.

 Change something in app-root/data/local.xml and git push,then scale up.Could scale up successfully.

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