Description of problem: When adding mysql to a scalable app, mysql's listening port will not be default "3306" port, that will lead to mediawiki quickstart can not work with a scalable app. If apply the two patches to quick-start, it works well with scalable app. $ cat deploy.patch --- .openshift/action_hooks/deploy.bak 2013-07-30 11:53:27.274877828 +0800 +++ .openshift/action_hooks/deploy 2013-07-30 14:26:54.553892132 +0800 @@ -17,13 +17,13 @@ fi # Confirm database exists, if not create it -if ! /usr/bin/mysql -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" -e "show tables;" openshift_mediawiki > /dev/null 2>&1 +if ! /usr/bin/mysql -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" -P "$OPENSHIFT_MYSQL_DB_PORT" -e "show tables;" openshift_mediawiki > /dev/null 2>&1 then echo echo "Database not found! Creating and importing" echo - /usr/bin/mysqladmin -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" create "openshift_mediawiki" - /usr/bin/mysql -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" openshift_mediawiki < "$OPENSHIFT_REPO_DIR/.openshift/action_hooks/openshift.sql" + /usr/bin/mysqladmin -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" -P "$OPENSHIFT_MYSQL_DB_PORT" create "openshift_mediawiki" + /usr/bin/mysql -u "$OPENSHIFT_MYSQL_DB_USERNAME" --password="$OPENSHIFT_MYSQL_DB_PASSWORD" -h "$OPENSHIFT_MYSQL_DB_HOST" -P "$OPENSHIFT_MYSQL_DB_PORT" openshift_mediawiki < "$OPENSHIFT_REPO_DIR/.openshift/action_hooks/openshift.sql" echo echo "done." echo "==================================================" $ cat LocalSettings.php.patch --- php/LocalSettings.php.bak 2013-07-30 14:32:38.535183474 +0800 +++ php/LocalSettings.php 2013-07-30 14:32:58.967021369 +0800 @@ -51,7 +51,7 @@ ## Database settings $wgDBtype = "mysql"; -$wgDBserver = $_ENV['OPENSHIFT_MYSQL_DB_HOST']; +$wgDBserver = $_ENV['OPENSHIFT_MYSQL_DB_HOST'].":".$_ENV['OPENSHIFT_MYSQL_DB_PORT']; $wgDBname = "openshift_mediawiki"; $wgDBuser = $_ENV['OPENSHIFT_MYSQL_DB_USERNAME']; $wgDBpassword = $_ENV['OPENSHIFT_MYSQL_DB_PASSWORD']; Version-Release number of selected component (if applicable): devenv_3580 How reproducible: Always Steps to Reproduce: 1. Create a php-5.3 application and attach mysql to it: $ rhc app create -a mediawiki -t php-5.3 -s $ rhc cartridge add -a mediawiki -c mysql-5.1 2. Add this upstream mediawiki repo $ cd mediawiki $ git remote add upstream -m master git://github.com/openshift/mediawiki-example.git $ git pull -s recursive -X theirs upstream master 3. Then push the repo upstream $ git push Actual results: $ git push remote: Waiting for stop to finish remote: CLIENT_MESSAGE: HAProxy instance is stopped remote: Starting application mediawiki2 remote: CLIENT_MESSAGE: HAProxy instance is started remote: remote: Database not found! Creating and importing remote: remote: /usr/bin/mysqladmin: connect to server at '51f736a9b83f4c0a64000012-jialiu.dev.rhcloud.com' failed remote: error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 111' remote: An error occurred executing 'gear postreceive' (exit code: 1) remote: Error message: Failed to execute action hook 'deploy' for 1197d6baf8ca11e291ad22000aa50424 application mediawiki2 remote: remote: For more details about the problem, try running the command again with the '--trace' option. To ssh://1197d6baf8ca11e291ad22000aa50424.rhcloud.com/~/git/mediawiki2.git/ 1407ee2..640e505 master -> master Expected results: deploy script should be executed successfully. Additional info:
Hi Jianlin, Do you want to submit a pull request with these changes? -Dan
(In reply to Dan McPherson from comment #1) > Hi Jianlin, > > Do you want to submit a pull request with these changes? > > > -Dan I already sent a pull request, this is my first pull request, maybe I miss something, need your review, if it is ok for you, need your merge operation, am I right?
Perfect thx!
Verify this bug with latest mediawiki quick-start, and PASS.