Hi,

Just trying to get my head around how the install works, what needs doing and the best way to set it up.

I grabbed the install file from :

http://drupalcode.org/viewvc/drupal/contributions/profiles/hostmaster/in...

As directed from here :

http://drupalcode.org/viewvc/drupal/contributions/profiles/hostmaster/IN...

The insall failed as I haven't changed the WEB_GROUP to the user I'm running the aegir set up as, changed that and then :

Do you want to proceed with the install? [Y/n] Y
==> Creating basic directory structure
==> Drush found in /home/tadmin/drush/drush.php, good
==> Drush seems to be functionning properly
==> Drush make already seems to be installed
==> Provision already seems to be installed
sed: can't read /home/tadmin/hostmaster-6.x-0.4-alpha2/profiles/hostmaster/apache2.conf.txt: No such file or directory

And it's installed hostmaster-6.x-0.4-alpha2 into the home dir opposed to the web root, or even the hostmaster/ folder I set up for it and ran install.sh from.

Comments

Anonymous’s picture

Category: bug » support
And it's installed hostmaster-6.x-0.4-alpha2 into the home dir opposed to the web root, or even the hostmaster/ folder I set up for it and ran install.sh from.

It installs it into the location defined by HOSTMASTER_DIR in the script, not from where you run the install.sh.

What I'm confused about is that the version you're saying has been installed is 6.x-0.4-alpha2 - did you set this in the install.sh as the AEGIR_VERSION? Out of the box, it will currently install HEAD.

The sed error means that the dir or the file isn't actually there, so perhaps something else went wrong during the install.

You may need to just remove stuff from /home/tadmin (all hostmaster dirs, drush, and .drush) and rerun the install script. I would recommend leaving the AEGIR_VERSION as HEAD at the moment as opposed to 6.x-0.4-alpha2, as all the drush_make logic that the install script uses, is newer than that of 0.4-alpha2.

JerryH’s picture

Category: support » bug

Have updated install so these are correct now :

AEGIR_DOMAIN=hostmaster.mysite.com
AEGIR_VERSION=HEAD
AEGIR_HOME=/home/tadmin/www/hostmaster
WEB_GROUP=tadmin
HOSTMASTER_DIR=/home/tadmin/www/hostmaster/hostmaster-HEAD
DRUSH=/home/tadmin/www/hostmaster/drush/drush.php
DRUSH_VERSION=All-Versions-2.1

Running again.

JerryH’s picture

Yup, seems to be looking for a non-exsistant file :

Do you want to proceed with the install? [Y/n] Y
==> Creating basic directory structure
==> Installing drush in /home/tadmin/www/hostmaster
--2009-11-16 16:32:28--  http://ftp.drupal.org/files/projects/drush-All-Versions-2.1.tar.gz
Resolving ftp.drupal.org... 140.211.166.134
Connecting to ftp.drupal.org|140.211.166.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 80209 (78K) [application/x-gzip]
Saving to: `drush-All-Versions-2.1.tar.gz'

100%[=====================================================================================>] 80,209       279K/s   in 0.3s

2009-11-16 16:32:28 (279 KB/s) - `drush-All-Versions-2.1.tar.gz' saved [80209/80209]

==> Drush seems to be functionning properly
==> Drush make already seems to be installed
==> Provision already seems to be installed
==> Deploying hostmaster application
Project information for drupal retrieved.                            [ok]
drupal downloaded from                                               [ok]
http://ftp.drupal.org/files/projects/drupal-6.14.tar.gz.
hostmaster export from contributions/profiles/hostmaster.            [ok]
sed: can't read /home/tadmin/www/hostmaster/hostmaster-HEAD/profiles/hostmaster/apache2.conf.txt: No such file or directory

I'll carry on and see how it did.

No profile

tadmin [~/www/hostmaster/hostmaster-HEAD]# tree profiles/
profiles/
`-- default
    `-- default.profile

1 directory, 1 file

Same in sites/all/modules, no hostmaster modules or set up etc.

Anonymous’s picture

Category: bug » support
Status: Active » Fixed

Per IRC conversations. The issue (there were in fact several) here was that the AEGIR_HOME parameter had been set to something other than ~, so .drush and drush_make/provision were getting put into an erroneous dir that in turn caused $DRUSH make hostmaster make to fail.

JerryH’s picture

Testing now to see that it is the requirement that aegir be in the doc root and can't be installed in a sub dir to be part of a larger set up, that it has to be stand alone.

JerryH’s picture

Status: Fixed » Active

So I sed up a whole new VPS just to ensure it's own doc root as advised and now it just fails in another way.

aegir@aegir.example.com [~]# sh install.sh                               
==> Aegir automated install script                                    
==> This script makes the following assumptions:                      
 * you have read INSTALL.txt and prepared the platform accordingly    
 * you are running as your "aegir" user                               
 * the following settings are correct:                                
AEGIR_DOMAIN=aegir.example.com                                           
AEGIR_VERSION=HEAD                                                    
AEGIR_HOME=/home/aegir                                                
WEB_GROUP=                                                            
HOSTMASTER_DIR=/home/aegir/hostmaster-HEAD                            
DRUSH=/home/aegir/drush/drush.php                                     
DRUSH_VERSION=All-Versions-2.1                                        

Some of those settings can be changed on the commandline, see:

 install.sh -h

for more information.
Do you want to proceed with the install? [Y/n] Y
==> Creating basic directory structure
==> Installing drush in /home/aegir
--2009-11-17 08:12:55--  http://ftp.drupal.org/files/projects/drush-All-Versions-2.1.tar.gz
Resolving ftp.drupal.org... 140.211.166.142, 140.211.166.134
Connecting to ftp.drupal.org|140.211.166.142|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 80209 (78K) [application/x-gzip]
Saving to: `drush-All-Versions-2.1.tar.gz'

100%[=================================================================================================>] 80,209       279K/s   in 0.3s

2009-11-17 08:12:55 (279 KB/s) - `drush-All-Versions-2.1.tar.gz' saved [80209/80209]

==> Drush seems to be functionning properly
==> Installing drush make in /home/aegir/.drush
Project drush_make (6.x-2.0-beta2) downloaded to /home/aegir/.drush/.[success]
==> Installing provision backend in /home/aegir/.drush
cvs [checkout aborted]: connect to [cvs.drupal.org]:2401 failed: Connection timed out
==> Deploying hostmaster application
A Drupal installation directory could not be found                   [error]
The command 'drush.php hostmaster make /home/aegir/hostmaster-HEAD'  [error]
could not be found.
aegir@aegir.example.com [~]#
Anonymous’s picture

cvs [checkout aborted]: connect to [cvs.drupal.org]:2401 failed:
Connection timed out 

This is clearly either a) an issue with your network/firewall on your VPS or b) network/firewall issues at cvs.drupal.org

Drush_make depends on a working network to be able to retrieve packages from various locations (in this case cvs)

Anonymous’s picture

Also note that you didn't modify the aegir domain name in the install.sh:

AEGIR_DOMAIN=aegir.example.com            

You'll have to do a bit of editing later to sort this out if you don't change it here! Or are you modifying them here for the sake of the ticket.

WEB_GROUP=                                                           

Why is this blank?

JerryH’s picture

I did edit example.com to what it is, I suppose I should quote with mysite.com....... I just don't fancy sharing the TLD atm.

I've updated WEB_GROUP=aegir, not sure why I missed that.

Anonymous’s picture

No worries.

WEB_GROUP should be www-data. And you will have added aegir to the www-data group per the instructions you first followed in INSTALL.txt :)

JerryH’s picture

Even if the group www-data doesn't exist I take it ? opposed to the group aeigr that does exist and which the context for the webserver and set up is running as.

Maybe I have to set that up, reconfigure apache and the group systems on the whole server, given the way this is set up I'd think it would be easier to release a ISO with a server build image ;) !

I'm going to give it a go with the group aeigr.

Anonymous’s picture

It isn't that the www-data group needs to exist: whatever OS you are running with Apache, you have an Apache group of some sort (sometimes called www-data, sometimes apache, etc). Aegir user needs to be a member of this group.

I don't know if it would be easier to release an ISO. I don't want to maintain a full Linux distribution with Aegir on top, that is something already sort of being achieved by the guys at Chapter Three with their Aegir AMI. This install should only take minutes :)

JerryH’s picture

OK massively closer now I think ............

I used aegir for the group as it's all the same in this VPS (which I set up just for this) and that seems fine.

All the way down to :

OK> Choose profile
OK> Choose language
OK> Verify requirements
OK> Set up database
OK> Install profile
OK> Configure site
OK> Getting started
OK> Web server
OK> Filesystem
OK> Database server
OK> Features
Here > Initialize system
13. Verify settings
14. Import sites
15. Finalize
16. Finished

And tripped up on the permissions, just getting the correct user perms set up to run :

php /home/aegir/drush/drush.php --uri=http://aegir.mysite.com hosting setup

Though from the error it gave me (where I spotted that I needed to sort out the permissions) :

Table 'aegir_aegir.node' doesn't exist                [error]
query: SELECT COUNT(t.vid) FROM aegir_hosting_task t INNER JOIN node
n ON t.vid = n.vid WHERE t.task_status = 0 in
/home/aegir/hostmaster-HEAD/profiles/hostmaster/modules/hosting/task/hosting_task.module
on line 344.
Command hosting setup needs a higher bootstrap level to run - you    [error]
will need invoke drush from a more functional Drupal environment to
run this command.
The command 'drush.php hosting setup' could not be executed.         [error]

It appears that it's not using the table prefix, which is aegir_ so it should be : aegir_aegir.aegir_node ( yes the dB is called aegir_aegir !).

Is there a {node} or prefix add missing some where ?

I'm going to have to check out the script for "hosting setup" as well before I run that as root on the server, I want/need to know exactly what it does.

JerryH’s picture

Any clues as where to look for what :

drush.php hosting setup

Will do ?

Before I run things like that I want to know what it's going to do.

Anonymous’s picture

hosting_setup() in hosting.module

It runs the initial dispatch to verify the first platform / import the main aegir site. It then adds the dispatch command to the aegir user's crontab, which does the job of polling the queue to execute any pending tasks created via the frontend.

Anonymous’s picture

I'm going to have to check out the script for "hosting setup" as well before I run that as root on the server, I want/need to know exactly what it does.

The instructions state that you must *not* run this command as the root user. It must be run as the aegir user, and executed while your pwd is /var/aegir/(platform) .

JerryH’s picture

Which when I do I get this :

Command hosting setup needs a higher bootstrap level to run - you    [error]
will need invoke drush from a more functional Drupal environment to
run this command.

I typically don't accept "Oh just run it" instructions either, hence why I'm dredging though the code to try and find it, so I can see what it's going to do.

Anonymous’s picture

Yes that is a clear error that shouldn't occur and needs investigating. I also don't give 'just run it' instructions so we're a good match :) .

The first thing that comes to mind is that you haven't run the command whilst cd'd into the /var/aegir/(your platform) directory. That's what that rather concise error usually means - the inability to *find* Drupal.

JerryH’s picture

Well the installer itself says to run it and I'm not 100% sure what it does, and I get that error from the dir I ran install.sh in, so I'm looking for an explanation of what it does before I do figure out how to get it, running and then do so.

Back at home now opposed to work, so it can wait for Monday and now is beer o'clock !

Anonymous’s picture

I gave you the explanation in #15 on what the command does.

The installer says to run it as the aegir user, from inside the directory of the main aegir platform (i.e /var/aegir/hostmaster-0.4-alpha3 or somesuch) .

If you get the error from running it from where you ran the install.sh, and the install.sh is not in the directory of your main aegir platform, then yes, you will get an error.. if you instead run it per the instructions, you'll likely not get an error. :)

Good luck!

JerryH’s picture

Well irrespective of the RTFM .......... ;)

The error is the same.

The instructions :

If you are not logged in as aegir user, log in with command :

    su -s /bin/sh aegir

Now execute the following commands :

    cd /home/aegir/public_html
    php /home/aegir/drush/drush.php --uri=http://aegir.mysite.com hosting setup

Are followed to the letter, and result it :

aegir@aegir.mysite.com [~/public_html]#php /home/aegir/drush/drush.php --uri=http://aegir.mysite.com hosting setup
Table 'aegir_aegir.node' doesn't exist                [error]
query: SELECT COUNT(t.vid) FROM aegir_hosting_task t INNER JOIN node
n ON t.vid = n.vid WHERE t.task_status = 0 in
/home/aegir/hostmaster-HEAD/profiles/hostmaster/modules/hosting/task/hosting_task.module
on line 344.
Command hosting setup needs a higher bootstrap level to run - you    [error]
will need invoke drush from a more functional Drupal environment to
run this command.
The command 'drush.php hosting setup' could not be executed.         [error]
aegir@aegir.mysite.com [~/public_html]# pwd
/home/aegir/public_html
aegir@aegir.mysite.com [~/public_html]#

That line is :

/**
 * Return the amount of items still in the queue
 */
function hosting_task_count() {
  return db_result(db_query("SELECT COUNT(t.vid) FROM {hosting_task} t INNER JOIN node n ON t.vid = n.vid WHERE t.task_status = %d", HOSTING_TASK_QUEUED));
}

Elsewhere {node} is correctly used it seems, so I suspect that someone is developing on a site with no table prefix (tsk tsk ;) ), or table prefixes not allowed in Aegir ?

And the function above for that matter :

/**
 * Determine whether there is an outstanding task of a specific type.
 *
 * This is used to ensure that there are not multiple tasks of the same type queued.
 */
function hosting_task_outstanding($nid, $type) {
  $return = db_result(db_query("
      SELECT t.nid FROM {hosting_task} t
        INNER JOIN node n ON t.vid = n.vid
      WHERE
        t.rid = %d
        AND t.task_status = %d
        AND t.task_type = '%s'
        ORDER BY t.vid DESC
        LIMIT 1", $nid, HOSTING_TASK_QUEUED, $type));
  return $return;
}
JerryH’s picture

Well opposed to "run it per the instructions" as I was, fixing those errors in coding seemed to do the trick ;)

aegir@aegir.mysite.com [~/public_html]#  php /home/aegir/drush/drush.php --uri=http://aegir.mysite.com hosting setup
This command will replace your crontab for this user. continue? (y/n): y
php '/home/aegir/drush/drush.php' hosting dispatch --root='/home/aegir/public_html' --uri='http://aegir.mysite.com'
Dispatch command was run successfully                                [success]
aegir@aegir.mysite.com [~/public_html]# Password:

Not sure what the "Password:" echo is about, investigating now.

JerryH’s picture

So the only 3 things on the next page were :

Web server could not be restarted. Changes might not be available until this has been done.
An error occurred at function : drush_provision_apache_provision_verify
An error occurred at function : drush_hosting_hosting_task

Apache I know about and can deal with that, that's just adding the user to the group that is allowed to run 'apachectl graceful'.

I have no sites to import at the moment, so am now playing in what looks like a set up Aegir with a very sexy theme !

Now ................. just have to figure out how to use it to create sites :)

Anonymous’s picture

And the user not having sudo rights to restart apache without a password was the cause of the Password: prompt.

The references to the node table are indeed missing their curly brackets here, I will fix that up, thanks for bringing that to our attention.

Anonymous’s picture

JerryH’s picture

Status: Active » Closed (fixed)

Yippie I helped out :) !!!

  • Commit 0960447 on 599758_edit_main_site, 640952_client_preview, dev-dns, dev-features, dev-headless_install, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newsiteform, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-relationships, dev-restore, dev-server_nodetype, dev-services, dev-site_rename, dev-ssl, dev_dns, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x authored by mig5:
    #634608 - add missing brackets on tables in a few queries
    
    

  • Commit 0960447 on 599758_edit_main_site, 640952_client_preview, dev-dns, dev-features, dev-headless_install, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newsiteform, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-relationships, dev-restore, dev-server_nodetype, dev-services, dev-site_rename, dev-ssl, dev_dns, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x authored by mig5:
    #634608 - add missing brackets on tables in a few queries