Bug 1008609

Summary: Adding cron breaks the drupal-quickstart build on devenv-stage_472
Product: OpenShift Online Reporter: Vojtech Vitek <vvitek>
Component: PodAssignee: Dan McPherson <dmcphers>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.xCC: dmcphers, hripps, mfojtik, twiest, vvitek, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: devenv-stage_477 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-19 16:51:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vojtech Vitek 2013-09-16 16:55:16 UTC
Description of problem:
Creating drupal-quickstart application with cron using one-liner rhc command fails with error on devenv-stage_472.
> rhc app create d1 php-5.3 -k mysql-5 cron --from-code=https://github.com/openshift/drupal-quickstart.git

However, if we omit adding the cron at once, the drupal-quickstart deploys successfully.
> rhc app create d2 php-5.3 -k mysql-5 --from-code=https://github.com/openshift/drupal-quickstart.git

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

How reproducible:
always

Steps to Reproduce:
1. launch devenv-stage_472
2. rhc app create d1 php-5.3 -k mysql-5 cron --from-code=https://github.com/openshift/drupal-quickstart.git

Actual results:
> Creating application 'd1' ... 
> The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 52373572b4e898149300009c -c "exec /usr/bin/runcon
> 'unconfined_u:system_r:openshift_t:s0:c0,c1002' /bin/sh -c \"gear postreceive >> /tmp/initial-build.log 2>&1\""' returned an error. rc=255
> 
> .Last 10 kB of build output:
> Stopping Cron cartridge
> Stopping PHP cartridge
> Syntax error on line 2 of /var/lib/openshift/52373572b4e898149300009c/php/configuration/etc/conf.d/openshift.conf:
> DocumentRoot must be a directory
> httpd (no pid file) not running
> Stopping MySQL cartridge
> 
> ln: creating symbolic link `./drush': Permission denied
> An error occurred executing 'gear postreceive' (exit code: 1)
> Error message: Failed to execute action hook 'build' for 52373572b4e898149300009c application d1

Expected results:
success

Comment 1 Vojtech Vitek 2013-09-16 16:58:19 UTC
Seems like adding the cron results in omitting the PHP cartridge control build stage. This results in missing drush PEAR binary that is needed by the drupal-quickstart and thus we can see the
> ln: creating symbolic link `./drush': Permission denied
error.

Comment 2 Vojtech Vitek 2013-09-16 17:11:49 UTC
Testing commit https://github.com/VojtechVitek/drupal-quickstart/commit/09da0c4b15594d26eadaf13157ea53ad9167c666 proves that the PHP `./bin/control build' is not run while cron is added together with php and mysql cartridges using the rhc one-liner.

The following branch with the above commit on top of drupal-quicstart master builds successfully:
> rhc app create d1 php-5.3 -k mysql-5 cron --from-code=https://github.com/VojtechVitek/drupal-quickstart.git#test_build_order

Comment 3 Dan McPherson 2013-09-17 03:48:53 UTC
https://github.com/openshift/origin-server/pull/3652

Comment 4 Yan Du 2013-09-17 07:36:39 UTC
test on devenv-stage_477, drupal app can be created successfully. move bug to verified.

[root@Daphne test]# rhc app create d1 php-5.3 -k mysql-5 cron --from-code=https://github.com/openshift/drupal-quickstart.git
Using mysql-5.1 (MySQL Database 5.1) for 'mysql-5'
Using cron-1.4 (Cron 1.4) for 'cron'

Application Options
-------------------
  Namespace:   111
  Cartridges:  php-5.3, mysql-5.1, cron-1.4
  Source Code: https://github.com/openshift/drupal-quickstart.git
  Gear Size:   default
  Scaling:     no

Creating application 'd1' ... done

  MySQL 5.1 database added.  Please make note of these credentials:

       Root User: adminwXYk8Ql
   Root Password: JplzTqCAKx41
   Database Name: d1

Connection URL: mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/

You can manage your new MySQL database by also embedding phpmyadmin.
The phpmyadmin username and password will be the same as the MySQL credentials above.

To schedule your scripts to run on a periodic basis, add the scripts to 
your application's .openshift/cron/{minutely,hourly,daily,weekly,monthly}/
directories (and commit and redeploy your application).

Example: A script .openshift/cron/hourly/crony added to your application
         will be executed once every hour.
         Similarly, a script .openshift/cron/weekly/chronograph added
         to your application will be executed once every week.

Waiting for your DNS name to be available ... done

Initialized empty Git repository in /home/test/d1/.git/
The authenticity of host 'd1-111.dev.rhcloud.com (54.234.45.151)' can't be established.
RSA key fingerprint is d4:a3:34:33:d9:5f:99:c1:59:e4:66:d7:46:a0:fc:8f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'd1-111.dev.rhcloud.com,54.234.45.151' (RSA) to the list of known hosts.

Your application 'd1' is now available.

  URL:        http://d1-111.dev.rhcloud.com/
  SSH to:     52380532c727ff640a000096.rhcloud.com
  Git remote: ssh://52380532c727ff640a000096.rhcloud.com/~/git/d1.git/
  Cloned to:  /home/test/d1

Run 'rhc show-app d1' for more details about your app.