2

I'm trying to set up openatrium to run on continuous integration with Jenkins, and part of this involves building it from scratch using a drush command.

I'm having some trouble here though:

Here's the command I'm running, in debug and verbose mode:

drush site-install openatrium --db-url=mysql://web_dir_1:web_dir@localhost/web_dir_1 -v -d

Here's the output from the command. I'm setting this to run as verbosely as possible, to make it easier to see what's going on:

Bootstrap to phase 0. [0.02 sec, 3.29 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.02 sec, 3.55 MB] [bootstrap]
Bootstrap to phase 1. [0.05 sec, 8.3 MB]                                                                                                                                                 [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.06 sec, 8.31 MB]                                                                                                               [bootstrap]
Initialized Drupal 6.20 root directory at /Users/chrisadams/employer-code/perky.dev/web_dir [0.07 sec, 9.36 MB]                                                                                [notice]
Found command: site-install (commandfile=core) [0.07 sec, 9.36 MB]                                                                                                                       [bootstrap]
Initializing drush commandfile: drush_make [0.07 sec, 9.36 MB]                                                                                                                           [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.07 sec, 9.37 MB]                                                                                                                       [bootstrap]
Initializing drush commandfile: user [0.07 sec, 9.37 MB]                                                                                                                                 [bootstrap]
You are about to create a sites/default/files directory and create a sites/default/settings.php file and DROP your 'web_dir_1' database and then CREATE a new one. Do you want to continue? (y/n): y
Sites directory sites/default already exists - proceeding. [1.16 sec, 9.38 MB]                                                                                                              [notice]
Calling copy(sites/default/default.settings.php, sites/default/settings.php)
Calling mkdir(sites/default/files)
Drush bootstrap phase : _drush_bootstrap_drupal_site() [1.17 sec, 9.4 MB]                                                                                                                [bootstrap]
Initialized Drupal site default at sites/default [1.17 sec, 9.41 MB]                                                                                                                        [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [1.18 sec, 9.41 MB]                                                                                                      [bootstrap]

Calling system(mysql --database=information_schema --host=localhost --user=root --password=  < /private/var/folders/eO/eO9NhXKBFrSOhZaCBGs2EE+++TI/-Tmp-/phplVq9zQ);

The stuff above sets up the empty databases, and as far as I can tell the following commands fake a web browser, stuffing the local and install profile to use, into the $_GET array:

Executing: php -r 'error_reporting(E_ERROR);$_GET=array("profile"=>"openatrium", "locale"=>"en", "id"=>"1"); $_REQUEST=&$_GET;define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;$_SERVER["SCRIPT_NAME"] = "/install.php";$_SERVER["HTTP_HOST"] = "default";$_SERVER["REMOTE_ADDR"] = "127.0.0.1";function _cli_cookie_print(){print(serialize(array(session_name()=>session_id())));}
register_shutdown_function("_cli_cookie_print"); include("/Users/chrisadams/employer-code/perky.dev/web_dir/install.php");'
  a:1:{s:36:"SESSc21f969b5f03d33d43e04f8f136e7682";s:26:"5cbv02bvq4npfbo6vds3tq3he1";}

This pages looks like the pages being generated for thw web ui, as if you were setting up using web browser:

Executing: php -r '$_GET=array("profile"=>"openatrium", "locale"=>"en", "id"=>"1"); $_REQUEST=&$_GET;define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;$_SERVER["SCRIPT_NAME"] = "/install.php";$_SERVER["HTTP_HOST"] = "default";$_SERVER["REMOTE_ADDR"] = "127.0.0.1";$_COOKIE=unserialize("a:1:{s:36:\"SESSc21f969b5f03d33d43e04f8f136e7682\";s:26:\"5cbv02bvq4npfbo6vds3tq3he1\";}"); $_GET["op"]="start"; include("/Users/chrisadams/employer-code/perky.dev/web_dir/install.php");'
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Refresh" content="0; URL=http://default/install.php?locale=en&profile=openatrium&id=1&op=do_nojs">
  <link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />
      <title>Installing Open Atrium | Drupal</title>
      <link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/system/maintenance.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/style.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/minnelli/minnelli.css?0" />
  <link type="text/css" rel="stylesheet" media="print" href="/themes/garland/print.css?0" />
          <!--[if lt IE 7]>
        <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/fix-ie.css" />    <![endif]-->
    </head>
    <body class="sidebar-left">

  <!-- Layout -->
    <div id="header-region" class="clear-block"></div>

      <div id="wrapper">
      <div id="container" class="clear-block">

        <div id="header">
          <div id="logo-floater">
          <h1><a href="/" title="Drupal"><img src="/themes/garland/minnelli/logo.png" alt="Drupal" id="logo" /><span>Drupal</span></a></h1>        </div>

        </div> <!-- /header -->

                <div id="sidebar-left" class="sidebar">
                      <ol class="task-list"><li class="done">Choose profile</li><li class="done">Choose language</li><li class="done">Verify requirements</li><li class="done">Set up database</li><li class="active">Install profile</li><li class="">Configure site</li><li class="">Install Open Atrium modules</li><li class="">Configure Open Atrium</li><li class="">Finished</li></ol>        </div>

        <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
            <h2>Installing Open Atrium</h2>                              <div class="clear-block">
              <div id="progress" class="progress"><div class="bar"><div class="filled" style="width: 0%"></div></div><div class="percentage">0%</div><div class="message">Initializing.<br/>&nbsp;</div></div>          </div>
            <div id="footer"></div>
        </div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->


      </div> <!-- /container -->
    </div>
  <!-- /layout -->

    </body>
  </html>

Again, more loading for a web browser to see:

Executing: php -r '$_GET=array("profile"=>"openatrium", "locale"=>"en", "id"=>"1"); $_REQUEST=&$_GET;define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;$_SERVER["SCRIPT_NAME"] = "/install.php";$_SERVER["HTTP_HOST"] = "default";$_SERVER["REMOTE_ADDR"] = "127.0.0.1";$_COOKIE=unserialize("a:1:{s:36:\"SESSc21f969b5f03d33d43e04f8f136e7682\";s:26:\"5cbv02bvq4npfbo6vds3tq3he1\";}"); $_GET["op"]="do_nojs"; include("/Users/chrisadams/employer-code/perky.dev/web_dir/install.php");'
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />
  <meta http-equiv="Refresh" content="0; URL=http://default/install.php?locale=en&profile=openatrium&id=1&op=do_nojs">
  <link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />
      <title>Installing Open Atrium | Drupal</title>
      <link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/modules/system/maintenance.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/style.css?0" />
  <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/minnelli/minnelli.css?0" />
  <link type="text/css" rel="stylesheet" media="print" href="/themes/garland/print.css?0" />
          <!--[if lt IE 7]>
        <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/fix-ie.css" />    <![endif]-->
    </head>
    <body class="sidebar-left">

  <!-- Layout -->
    <div id="header-region" class="clear-block"></div>

      <div id="wrapper">
      <div id="container" class="clear-block">

        <div id="header">
          <div id="logo-floater">
          <h1><a href="/" title="Drupal"><img src="/themes/garland/minnelli/logo.png" alt="Drupal" id="logo" /><span>Drupal</span></a></h1>        </div>

        </div> <!-- /header -->

                <div id="sidebar-left" class="sidebar">
                      <ol class="task-list"><li class="done">Choose profile</li><li class="done">Choose language</li><li class="done">Verify requirements</li><li class="done">Set up database</li><li class="active">Install profile</li><li class="">Configure site</li><li class="">Install Open Atrium modules</li><li class="">Configure Open Atrium</li><li class="">Finished</li></ol>        </div>

        <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner">
            <h2>Installing Open Atrium</h2>                              <div class="clear-block">
              <div id="progress" class="progress"><div class="bar"><div class="filled" style="width: 28%"></div></div><div class="percentage">28%</div><div class="message">Remaining 33 of 46.<br/>Installed <em>Search</em> module.</div></div>          </div>
            <div id="footer"></div>
        </div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center -->


      </div> <!-- /container -->
    </div>
  <!-- /layout -->

    </body>
  </html>

And now, it looks like it's finished (check for the GET['op']="finished"):

Executing: php -r '$_GET=array("profile"=>"openatrium", "locale"=>"en", "id"=>"1"); $_REQUEST=&$_GET;define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;$_SERVER["SCRIPT_NAME"] = "/install.php";$_SERVER["HTTP_HOST"] = "default";$_SERVER["REMOTE_ADDR"] = "127.0.0.1";$_COOKIE=unserialize("a:1:{s:36:\"SESSc21f969b5f03d33d43e04f8f136e7682\";s:26:\"5cbv02bvq4npfbo6vds3tq3he1\";}"); $_GET["op"]="finished"; include("/Users/chrisadams/employer-code/perky.dev/web_dir/install.php");'

This final step is setting admin settings so get into the site with:

Executing: php -r '$_GET=array("profile"=>"openatrium", "locale"=>"en", "id"=>"1"); $_REQUEST=&$_GET;define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;$_SERVER["SCRIPT_NAME"] = "/install.php";$_SERVER["HTTP_HOST"] = "default";$_SERVER["REMOTE_ADDR"] = "127.0.0.1";$_COOKIE=unserialize("a:1:{s:36:\"SESSc21f969b5f03d33d43e04f8f136e7682\";s:26:\"5cbv02bvq4npfbo6vds3tq3he1\";}");
  $_POST = array (
    "site_name" => "Site-Install", 
    "site_mail" => "admin@example.com", 
    "account" => array (
      "name" => "admin",
      "mail" => "admin@example.com",
      "pass" => array (
        "pass1" => "admin",
        "pass2" => "admin"
      )
    ),
    "date_default_timezone"=>"0", 
    "clean_url"=>1,
    "form_id"=>"install_configure_form", 
    "update_status_module" => array("1"=>"1")
  );


  include("/Users/chrisadams/employer-code/perky.dev/web_dir/install.php");'
Command dispatch complete [13.75 sec, 9.43 MB]                                                                                                                                              [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   12.578     1      12578.01   

Peak memory usage was 9.56 MB [13.76 sec, 9.43 MB]                                                                                                                                          

 All looks good, right?

This is the screen I see at the end - the same old garland theme at we get by default (I don't yet have enough points to post images on this site)

https://community.openatrium.com/sites/community.openatrium.com/files/obvious_not_open_atrium.png

The install profile has worked, but for Garland, not OA, and none of the modules you would see in OA are there

Here's the output of drush st:

Drupal version         :  6.20                                           
 Site URI               :  http://default                                 
 Database driver        :  mysql                                          
 Database hostname      :  localhost                                      
 Database username      :  root                                           
 Database name          :  rbu_1                                          
 Database               :  Connected                                      
 Drupal bootstrap       :  Successful                                     
 Drupal user            :  Anonymous                                      
 Default theme          :  garland                                        
 Administration theme   :  garland                                        
 PHP configuration      :  /private/etc/php.ini                           
 Drush version          :  4.4                                            
 Drush configuration    :                                                 
 Drush alias files      :                                                 
 Drupal root            :  /Users/chrisadams/headshift-code/perky.dev/rbu 
 Site path              :  sites/default                                  
 File directory path    :  sites/default/files                            

When I run through these installation steps through the web browser when I call drush st, here's what I see:

Here's the output of drush st:

Drupal version         :  6.20                                           
 Site URI               :  http://default                                 
 Database driver        :  mysqli                                         
 Database hostname      :  localhost                                      
 Database username      :  rbu_1                                          
 Database name          :  rbu_1                                          
 Database               :  Connected                                      
 Drupal bootstrap       :  Successful                                     
 Drupal user            :  Anonymous                                      
 Default theme          :  ginkgo                                         
 Administration theme   :  ginkgo                                         
 PHP configuration      :  /private/etc/php.ini                           
 Drush version          :  4.4                                            
 Drush configuration    :                                                 
 Drush alias files      :                                                 
 Drupal root            :  /Users/chrisadams/headshift-code/perky.dev/rbu 
 Site path              :  sites/default                                  
 File directory path    :  sites/default/files                            

This uses a different database driver, and has the correct themes set, and uses a different db username, and makes me wonder if this is the issue, but I'm not quite sure what might be the cause beyond this here.

The only changes I made here, in this were using a different database user, rbu_1, and a different password rbu instead of root and '' for the password (I know it's bad practice, to use root like this - I switched to it when I was trying to eliminate permissions problems when debugging this issue earlier).

Any idea Open Atrium would behave differently under these two conditions?

I can do this process through the web browser, and this installs fine, but this won't be enough to setup CI for a project I'm working on.

I don't know what I'm doing wrong here, and I'd really appreciate some pointers. Any ideas, other than using curl and wget or mechanize?

3

site-install can sort of handle complex install profiles in Drupal 7 (especially the upcoming Drush5) but such profiles are virtually impossible to support in Drupal 6. The Drupal 6 installer is just not built for non-web use. Sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.