Bug 996616 - Magento quickstart - not able to create scalable app
Summary: Magento quickstart - not able to create scalable app
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Templates
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Dan McPherson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-13 14:29 UTC by david.collen
Modified: 2014-04-09 15:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-09 15:17:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description david.collen 2013-08-13 14:29:39 UTC
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 20:59:21 UTC
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 21:18:48 UTC
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 20:48:27 UTC
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-14 02:45:54 UTC
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.