Bug 1018387 - Drupal quickstart is broken
Summary: Drupal quickstart is broken
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Andy Goldstein
QA Contact: libra bugs
URL:
Whiteboard:
: 1026411 (view as bug list)
Depends On: 1018969
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-11 20:27 UTC by Hiro Asari
Modified: 2015-05-14 23:30 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 03:23:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Hiro Asari 2013-10-11 20:27:32 UTC
Description of problem:
Drupal quickstart at https://github.com/openshift/drupal-quickstart/ does not work.


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


How reproducible:
always

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

Actual results:
$ bx bin/rhc app create drupal2 cron php-5.3 -k mysql-5 --from-code=https://github.com/openshift/drupal-quickstart.git
Using cron-1.4 (Cron 1.4) for 'cron'
Using mysql-5.1 (MySQL 5.1) for 'mysql-5'

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

Creating application 'drupal2' ... 
Syntax error on line 2 of /var/lib/openshift/5258591949b8aee3e6000001/php/configuration/etc/conf.d/openshift.conf:
DocumentRoot must be a directory

Expected results:
Application created.

Additional info:
The quickstart works on production. PHP cartridge itself works on devenv; e.g., rhc app create drupal2 cron php-5.3

Comment 1 Hiro Asari 2013-10-11 20:31:33 UTC
Line 2 of the config should be:

DocumentRoot "<%= "#{ENV['OPENSHIFT_REPO_DIR']}/php" %>"

which no longer exists on the quickstart.

Comment 2 Hiro Asari 2013-10-11 20:33:50 UTC
Actually, the build hook should do that. Hmmm.

https://github.com/openshift/drupal-quickstart/blob/master/.openshift/action_hooks/build

Comment 3 Wei Sun 2013-10-14 07:52:00 UTC
Tested on devenv_3893,could reproduce this bug.

Result:
[openshift@dhcp-10-143 test]$ rhc app create drupal php-5 mysql-5 cron --from-code=git://github.com/openshift/drupal-quickstart.git
Using php-5.3 (PHP 5.3) for 'php-5'
Using mysql-5.1 (MySQL 5.1) for 'mysql-5'
Using cron-1.4 (Cron 1.4) for 'cron'

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

Creating application 'drupal' ... 
Syntax error on line 2 of /var/lib/openshift/525ba193d618d6b5c5000284/php/configuration/etc/conf.d/openshift.conf:
DocumentRoot must be a directory

Comment 5 Yujie Zhang 2013-10-15 02:58:56 UTC
This issue can not be reproduced on STG(devenv-stage_498), so will not block release of sprint34, thanks.

Comment 6 Andy Goldstein 2013-10-17 16:02:50 UTC
https://github.com/openshift/origin-server/pull/3913

Comment 7 openshift-github-bot 2013-10-18 00:33:46 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/fbb17b410955975faf43d0ae02142165a28e22c9
Add dependency dirs to managed_files.yml

Add dependency_dirs and build_dependency_dirs to managed_files.yml so
the platform can create
these dependency directories and symlinks when configuring the
cartridge and for clean builds.

Remove per-cartridge creation of dependency directories and symlinks in
each install script.

Remove per-cartridge force_clean_build logic wherever possible (some
cartridges may still need some, however)

Bug 1018387
Bug 1018969

Comment 8 chunchen 2013-10-21 02:30:09 UTC
Checked on devenv_3921, it's still failed to create drupal quickstart, meet "Unable to link the PHP directory, as the current Drupal instance is not a valid directory" errors, please refer to the following results:

# rhc app create drupal2 cron php-5.3 -k mysql-5 --from-code=https://github.com/openshift/drupal-quickstart.git --no-git
Using cron-1.4 (Cron 1.4) for 'cron'
Using mysql-5.1 (MySQL 5.1) for 'mysql-5'

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

Creating application 'drupal2' ... 
The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 52648e9b20dcc7e805000038 -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c0,c1001' /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/52648e9b20dcc7e805000038/php/configuration/etc/conf.d/openshift.conf:
DocumentRoot must be a directory
httpd (no pid file) not running
Stopping MySQL cartridge
Building git ref 'master', commit bcc1761
Building PHP cartridge
Checking pear: pear.drush.org/drush

Attempting to discover channel "pear.drush.org"...
downloading channel.xml ...
Starting to download channel.xml (804 bytes)
....done: 804 bytes
Auto-discovered channel "pear.drush.org", alias "drush", adding to registry
downloading drush-6.1.0.0.tgz ...
Starting to download drush-6.1.0.0.tgz (504,788 bytes)
...done: 504,788 bytes
install ok: channel://pear.drush.org/drush-6.1.0.0

Download and install the latest stable version of Drupal

Project drupal (7.23) downloaded to                                    [success]
/var/lib/openshift/52648e9b20dcc7e805000038/app-root/data/downloads/drupal-7.23.
Project drupal contains:                                               [success]
 - 3 profiles: standard, minimal, testing
 - 4 themes: bartik, seven, stark, garland
 - 47 modules: drupal_system_listing_compatible_test,
drupal_system_listing_incompatible_test, update, toolbar, filter,
poll, system, translation, contact, profile, shortcut, contextual,
image, statistics, php, file, path, tracker, blog, trigger,
aggregator, simpletest, menu, locale, user, field_ui, color, book,
node, comment, openid, overlay, help, dblog, rdf, taxonomy, forum,
dashboard, syslog, list, number, field_sql_storage, text, options,
field, block, search

Drupal installed to /var/lib/openshift/52648e9b20dcc7e805000038/app-root/data/downloads/drupal-7.23

ERROR: Unable to link the PHP directory, as the current Drupal instance is not a valid directory.
An error occurred executing 'gear postreceive' (exit code: 8)
Error message: Failed to execute action hook 'build' for 52648e9b20dcc7e805000038 application drupal2

For more details about the problem, try running the command again with the '--trace' option.

Comment 9 Hiro Asari 2013-10-22 15:07:25 UTC
The problem appears to be with the quickstart itself. See https://github.com/openshift/drupal-quickstart/blob/7adb3cab2a548040f78160ef08ced3f14c82bc54/.openshift/action_hooks/build#L85-L90

During the build, ${OPENSHIFT_REPO_DIR} points to something like /var/lib/openshift/52668f8571d27045560001a8/app-deployments/2013-10-22_10-45-58.892/repo, and so the symlink ../../data/downloads/current points to /var/lib/openshift/52668f8571d27045560001a8/app-deployments/data/downloads/current, which is nonexistent.

I suspect that directories are moved (i.e., $OPENSHIFT_HOMEDIR/app-deployments/*/repo to $OPENSHIFT_HOMEDIR/app-root/repo), and relative symlink via ../../ may prove problematic. Setting the symlink via absolute path (https://github.com/openshift/drupal-quickstart/pull/15) makes this test in question go, but if one is to make this Drupal quickstart scalable (which currently is not the case), it might be problematic.

Comment 10 Andy Goldstein 2013-10-23 12:18:19 UTC
https://github.com/openshift/origin-server/pull/3955

Comment 11 Wei Sun 2013-10-24 00:19:32 UTC
Verified on devenv_3937

Result:
[wsun@dhcp-8-229 test]$ rhc app create drupal php-5.3  mysql-5 cron --from-code=git://github.com/openshift/drupal-quickstart.git
Using mysql-5.1 (MySQL 5.1) for 'mysql-5'
Using cron-1.4 (Cron 1.4) for 'cron'

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

Creating application 'drupal' ... done

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

       Root User: admin4W2rvN7
   Root Password: cRHw3nKughIr
   Database Name: drupal

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
Cloning into 'drupal'...

Your application 'drupal' is now available.

  URL:        http://drupal-wsundev3937.dev.rhcloud.com/
  SSH to:     526866acec1063a772000069.rhcloud.com
  Git remote: ssh://526866acec1063a772000069.rhcloud.com/~/git/drupal.git/
  Cloned to:  /home/wsun/test/dev/test/drupal

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

Comment 13 Lei Zhang 2013-11-04 06:01:32 UTC
This issue still can be reproduced on STG(devenv-stage_549)

[rayzhang@ray Work]$ rhc app create drupal php-5.3 mysql-5.1 cron --from-code=git://github.com/openshift/drupal-quickstart.git
Using cron-1.4 (Cron 1.4) for 'cron'

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

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

.Last 10 kB of build output:
Stopping MySQL cartridge
Stopping Cron cartridge
Stopping PHP cartridge
Syntax error on line 2 of /var/lib/openshift/52773536dbd93c1cc40003bd/php/configuration/etc/conf.d/openshift.conf:
DocumentRoot must be a directory
httpd (no pid file) not running
Building git ref 'master', commit 8d24734
Building PHP cartridge
Checking pear: pear.drush.org/drush

Attempting to discover channel "pear.drush.org"...
downloading channel.xml ...
Starting to download channel.xml (804 bytes)
....done: 804 bytes
Auto-discovered channel "pear.drush.org", alias "drush", adding to registry
downloading drush-6.1.0.0.tgz ...
Starting to download drush-6.1.0.0.tgz (504,788 bytes)
...done: 504,788 bytes
install ok: channel://pear.drush.org/drush-6.1.0.0

Download and install the latest stable version of Drupal

copy(/tmp/drush_tmp_1383544173_5277356d76f4f/drupal): failed to open   [warning]
stream: No such file or directory filesystem.inc:257
Project drupal (7.23) could not be downloaded to                         [error]
/var/lib/openshift/52773536dbd93c1cc40003bd/app-root/data/downloads/drupal.
ERROR: Unable download and install Drupal.
An error occurred executing 'gear postreceive' (exit code: 7)
Error message: Failed to execute action hook 'build' for 52773536dbd93c1cc40003bd application drupal

For more details about the problem, try running the command again with the '--trace' option.

Comment 14 Wei Sun 2013-11-04 06:17:30 UTC
This bug could be reproduced in devenv-stage_549

Comment 15 Andy Goldstein 2013-11-04 13:35:45 UTC
This is not an OpenShift bug. There is an issue with Drupal/Drush. Please see:

https://github.com/drush-ops/drush/issues/234
https://drupal.org/node/2126123

Comment 16 Dan McPherson 2013-11-04 17:27:48 UTC
*** Bug 1026411 has been marked as a duplicate of this bug. ***

Comment 17 Andy Goldstein 2013-11-04 18:31:45 UTC
I have just committed a workaround for the Drupal/Drush update.xml issue referenced above. We'll want to undo this workaround once update.xml is fixed.

https://github.com/openshift/drupal-quickstart/pull/17

Comment 18 chunchen 2013-11-05 06:30:33 UTC
It's fixed, verified on devenv_3986, devenv_stage_552, STG(devenv_stage_552), please refer to the following results:

[chunchen @ test]$ rhc app create drupal php-5.3 mysql-5.1 cron --from-code=git://github.com/openshift/drupal-quickstart.git --no-git --server stg.openshift.redhat.com -l chunchen+1
Using cron-1.4 (Cron 1.4) for 'cron'
Please sign in to start a new session to stg.openshift.redhat.com.
Password: *******

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

Creating application 'drupal' ... done

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

       Root User: adminLFDRhVx
   Root Password: FqdIAgSM6Qw-
   Database Name: drupal

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

Your application 'drupal' is now available.

  URL:        http://drupal-ok.stg.rhcloud.com/
  SSH to:     52788e8a2587c8c9f8000106.rhcloud.com
  Git remote: ssh://52788e8a2587c8c9f8000106.rhcloud.com/~/git/drupal.git/

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


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