for some reason provision didn't install correctly. Also trying su - aegir doesn't switch me into the aegir user. If I su -s /bin/sh aegir, there's a $ only instead of the usual aegir@server:.

CommentFileSizeAuthor
#4 Screenshot.png31.21 KBjamiet

Comments

Anonymous’s picture

Status: Active » Postponed (maintainer needs more info)

for some reason provision didn't install correctly

You haven't given us much to go on have you? :) So, what happened, and what was the outcome?

Also trying su - aegir doesn't switch me into the aegir user.

Correct, that's as expected, see below

If I su -s /bin/sh aegir, there's a $ only instead of the usual aegir@server:.

You're likely using dash shell, default in Ubuntu, which represents the shell prompt with a '$', or some similar shell type other than bash. This is not a bug. By running su -s /bin/sh aegir, you're now running as the aegir user, and that's why we give that command.

The reason is that the aegir user is created with the --system flag, which gives it /bin/false as its shell (and hence the su command above), and has no password. This is by design.

If you don't like the default shell that your OS has decided to map to '/bin/sh', you could edit the aegir user's account to use /bin/bash if you have it, however it is by design and for security reasons that the aegir user's shell is /bin/false by default.

qbnflaco’s picture

You haven't given us much to go on have you? :) So, what happened, and what was the outcome?

after running the drush.php hosting setup command, the next screen gives this...

...
Task starts processing
Running: php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Initialized Drupal 6.14 root directory at /var/aegir/drupal-6.14
Could not find a Drupal settings.php file at ./sites/default/settings.php.
The command 'drush.php provision verify' could not be found.
Removing task from hosting queue
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete

When I go into the shell and run drush by itself, the drush provision options aren't listed with the other commands in the help text.

Following this screen with "Configuring roles, blocks and theme screen", I get these warnings...

* warning: array_map() [function.array-map]: Argument #2 should be an array in /var/aegir/drupal-6.14/modules/system/system.module on line 1015.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/aegir/drupal-6.14/modules/system/system.module on line 1053.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/aegir/drupal-6.14/modules/system/system.module on line 1030.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/aegir/drupal-6.14/modules/system/system.module on line 1053.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/aegir/drupal-6.14/modules/system/system.module on line 1030.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/aegir/drupal-6.14/modules/system/system.module on line 1053.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/aegir/drupal-6.14/modules/system/system.module on line 1030.

I cleared all cache and the errors went away. Not sure if it's related, but I thought I might as well include.

Thanks for the info about the shell. It was just a pain trying to do things as aegir without the tab folder autocomplete.

Anonymous’s picture

Have you checked that all the required components are installed?

The command 'drush.php provision verify' could not be found.

This error suggests that the Provision component could not be found

Please provide the output of

ls -al /var/aegir/.drush/

ls -al /var/aegir/.drush/provision/

And because I have a theory, run this and let me know if there's any output

find /var/aegir/ -type d -name *.tmp

Thanks!

jamiet’s picture

StatusFileSize
new31.21 KB

I had exactly the same issue as above including the issues with su. I copied the settings file from default.settings.php but now I get the error "Could not select the mysql database." If I run drush from the command line I also do not get hosting or provision commands available. I have attached the website screen shot for the verify task. If I run the php command sudo -u aegir php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --backend from the terminal I get the following output:

DRUSH_BACKEND_OUTPUT_START>>>{"output":"","error_status":1,"log":[{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drush()","timestamp":1255900884.57,"error":null},{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_root()","timestamp":1255900884.62,"error":null},{"type":"notice","message":"Initialized Drupal 6.14 root directory at \/var\/aegir\/drupal-6.14","timestamp":1255900884.66,"error":null},{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_site()","timestamp":1255900884.67,"error":null},{"type":"notice","message":"Initialized Drupal site default at sites\/default","timestamp":1255900884.67,"error":null},{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_configuration()","timestamp":1255900884.68,"error":null},{"type":"notice","message":"Undefined index: driver","timestamp":1255900884.69,"error":null},{"type":"notice","message":"Undefined index: driver","timestamp":1255900884.69,"error":null},{"type":"bootstrap","message":"PDO support available, but the driver has not been installed. Assuming success.","timestamp":1255900884.69,"error":null},{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_database()","timestamp":1255900884.69,"error":null},{"type":"bootstrap","message":"Successfully connected to the Drupal database.","timestamp":1255900884.69,"error":null},{"type":"error","message":"Drush command could not be completed.","timestamp":1255900884.71,"error":"DRUSH_NOT_COMPLETED"}],"error_log":{"DRUSH_NOT_COMPLETED":["Drush command could not be completed."]},"context":{"root":"\/var\/aegir\/drupal-6.14","backend":true}}<<

I used the install.sh from head (as linked from the install instructions) on a ubuntu NBR 9.04 - provision is in /var/aegir/.drush and there does not seem to be any permissions issue. Is there any more info I can provide.

TIA,

JamieT

Anonymous’s picture

'Could not select the mysql database' is likely just incorrect database credentials, Provision couldn't connect to the 'mysql' database but was able to establish some sort of connection to the server. The comment in #4 is not the same issue qbnflaco is experiencing, please open a separate support request.

Also from the commandline, it is easier to substitute --backend for --debug to get a clearer output.

andeme’s picture

I can confirm both of the problems discussed in this thread.

Adding to the op, when I "su -s /bin/sh aegir, there's a $ only instead of the usual aegir@server" and if I run whoami it does not come back with "aegir". So it's not clear how to run the drush command at the end of the install as the aegir user.

Commenting on jamiet's additional issue (even though it's off topic) I was also thrown off because the wizard had defaulted the aegir super mysql user with "aegir" and I think I should have changed it to "aegir_root".

Anonymous’s picture

Adding to the op, when I "su -s /bin/sh aegir, there's a $ only instead of the usual aegir@server" and if I run whoami it does not come back with "aegir". So it's not clear how to run the drush command at the end of the install as the aegir user.

Again, that sounds like Ubuntu and its use of Dash as the default shell.

Commenting on jamiet's additional issue (even though it's off topic) I was also thrown off because the wizard had defaulted the aegir super mysql user with "aegir" and I think I should have changed it to "aegir_root".

The default value that is put in there has been reported previously but I'm unsure what we can do about it. So yeah, hence the explicit instructions in bold text on that page.

Will try and see if we can hide the default value, however that form is used elsewhere in the system and not just in the installer, so modifying it has ramifications, which is why it hasn't been done.

qbnflaco’s picture

Alot of browsers try to repeat values from a field that has been previously filled out. If the field has a different ID it shouldnt try to prepopulate it.

jamiet’s picture

Apologies if my comment seemed off topic but I was experiencing the exact issue the op had at first (except for the cache issue). When I noticed the error relating to not finding ./site/default/settings.php I referred to the manual instructions and it had a couple of commands as follows:

touch /var/aegir/drupal-6./sites/default/settings.php
chmod 0777 /var/aegir/drupal-6./sites/default/settings.php

I did this and then got the mysql errors so I assumed it was all related and did not want to fill up the issue queue unnecessarily. I will post a separate issue relating to this and keep an eye on this one in case they are related.

With the above aside I still believe I am suffering with the same issue (on top of the above) as OP as I when I run drush (either drush or /var/aegir/drush/drush.php) I do not have any of the hosting or provision commands listed. My provision folder is in /var/aegir/.drush/provision and the owner/group is aegir etc. If there is more info I can provide / dig into let me know.

TIA,

JamieT

Anonymous’s picture

It is definitely not instructed nor recommended to create a /sites/default/ site. The Aegir site is a site in its own right in the main drupal core platform per the documentation:

It is recommended that you create the aegir site as a real site in the
sites/ directory. The following commands will create this site directory
and create the settings.php and files directory with the appropriate
permissions to proceed through the installer.

Run these commands as the aegir user.

Shell commands::

mkdir sites/$AEGIR_DOMAIN
cp sites/default/default.settings.php sites/$AEGIR_DOMAIN/settings.php
chmod g+w sites/$AEGIR_DOMAIN/settings.php
mkdir sites/$AEGIR_DOMAIN/files
chmod 2770 sites/$AEGIR_DOMAIN/files
chgrp www-data sites/$AEGIR_DOMAIN/settings.php
chgrp www-data sites/$AEGIR_DOMAIN/files

http://cvs.drupal.org/viewvc.py/drupal/contributions/profiles/hostmaster...

jamiet’s picture

Thanks for the prompt response mig5. I was able to login to the aegir host environment and install the hostmaster profile so I assume the install.sh script set these files up correctly. Checking ls-al I noticed that the files directory and settings.php were still in the aegir group so I issued your commands just to be on the safe side.

The reference to ./default/settings.php was based on the fact that when trying to verify the platform post install I get the error could not find sites/default/settings.php and when checking the manual installation instructions (wiki page http://groups.drupal.org/node/25485) under the "Configure Apache" section I found the instructions to touch a settings.php file in sites/default/". I did this and the error changed to cannot select mysql database (separate issue which I will raise).

If I issue the platform verify command on the command line as follows:
sudo -u aegir php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --debug

I get the following output:
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.107 sec] [bootstrap]
Initialized Drupal 6.14 root directory at /var/aegir/drupal-6.14 [notice]
[0.157 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.17 sec] [bootstrap]
Initialized Drupal site default at sites/default [0.172 sec] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [bootstrap]
[0.187 sec]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.214 [bootstrap]
sec]
Successfully connected to the Drupal database. [0.214 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.247 sec] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [1.021 sec] [bootstrap]
The command 'drush.php provision verify' could not be found. [1.038 [error]
sec]

This implies that the

I use the sudo -u aegir as if I try and su -s /bin/sh aegir I get placed into a shell which seems to behave strangely (I know this is a ubuntu issue). Would using sudo -u switch be causing problems?

Hope I can resolve this issue as once Aegir is running it seems pretty utopic to me ;).

TIA,

JamieT

adrinux’s picture

If I su -s /bin/sh aegir, there's a $ only instead of the usual aegir@server

I experienced that too. This command is specifically requesting the use of /bin/sh the very basic shell on all unices - which is (as pointed out above) actually /bin/dash on ubuntu - end result is the same though, a very basic shell.

I got annoyed by the lack of tab completion and the fact that my delete keys stopped working and started using this instead:

su -s /bin/bash aegir

Well, I actually do this:

sudo su -s /bin/bash aegir

but you get the point.

It seems to me that deliberately dropping people into a poorly featured shell is causing problems. Perhaps specifying a more fully featured shell would help?

jamiet’s picture

OK using sudo su -s /bin/bash aegir and then issuing the provision verify command gets me the following output:

php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --debug
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.165 sec] [bootstrap]
Initialized Drupal 6.14 root directory at /var/aegir/drupal-6.14 [notice]
[0.213 sec]
Found command: provision verify [0.23 sec] [bootstrap]
Initializing drush commandfile: provision_apache [0.231 sec] [bootstrap]
Undefined index: base_url [0.236 sec] [notice]
Initializing drush commandfile: provision_drupal [0.238 sec] [bootstrap]
Initializing drush commandfile: provision_mysql [0.238 sec] [bootstrap]
Undefined index: db_url [0.239 sec] [notice]
Undefined index: user [0.24 sec] [notice]
Undefined index: pass [0.241 sec] [notice]
Undefined index: host [0.242 sec] [notice]
Undefined index: host [0.242 sec] [notice]
Undefined index: scheme [0.243 sec] [notice]
Undefined index: scheme [0.244 sec] [notice]
Including /var/aegir/.drush/provision/web_server/verify.provision.inc [bootstrap]
[0.245 sec]
Including /var/aegir/.drush/provision/platform/verify.provision.inc [bootstrap]
[0.249 sec]
Including /var/aegir/.drush/provision/db_server/verify.provision.inc [bootstrap]
[0.253 sec]
Including /var/aegir/.drush/provision/ssl/verify.provision.inc [0.258 [bootstrap]
sec]
Could not connect to the master database. [0.275 sec] [error]
An error occurred at function : [error]
drush_provision_mysql_provision_verify_validate [0.276 sec]
Command dispatch complete [0.276 sec] [notice]

This seems to be a mysql credentials issue so will move this over to the other issue I have just created (http://drupal.org/node/608386). I guess the sudo -u aegir does not provide the command line with the full aegir user profile so it doesn't seem to work.

As an interesting aside now that I am using aegir 'proper' in the command shell issuing a drush command lists all of the hosting and provision commands.

HTH,

JamieT

Anonymous’s picture

Thanks for pointing out http://drupal.org/node/608386 , that was wrong advice, so I've fixed it.

So you're saying that the use of bash instead of dash is actually making things operate properly? That's interesting, and potentially a bug in Drush if other bash environments can't detect / include the .drush folder.

jamiet’s picture

I think I have resolved my issues and hope the following helps qbnflaco and adrinux. In ubuntu sudo su -s /bin/sh aegir takes you to a basic (dash according to others) shell which does not seem to play nicely with drush. As a result adrinux suggested using the /bin/bash shell. So this is what I did to fix the issues:


sudo -s /bin/bash
cd /var/aegir/drupal-6.14
php /var/drush/drush.php --uri=http://aegir.loc --root='/var/aegir/drupal-6.14' hosting setup --debug
php /var/drush/drush.php --uri=http://aegir.loc --root='/var/aegir/drupal-6.14' provision verify --debug

This time I got no errors and when I go to the platform verify task on the web front end it is shown as successful. I think my specific issue revolved around issuing the hosting setup command using sudo -u aegir instead of su -s to a proper aegir user environment.

Hope this helps the rest of you having problems. Let me know if I can help or provide more info at all.

JamieT

qbnflaco’s picture

ls -al /var/aegir/.drush/

total 12
drwxr-xr-x 3 aegir aegir 4096 Oct 18 06:53 .
drwxr-xr-x 8 aegir aegir 4096 Oct 18 17:35 ..
drwxr-xr-x 8 aegir aegir 4096 Oct 18 07:06 provision

ls -al /var/aegir/.drush/provision/

total 92
drwxr-xr-x 8 aegir aegir 4096 Oct 18 07:06 .
drwxr-xr-x 3 aegir aegir 4096 Oct 18 06:53 ..
drwxr-xr-x 2 aegir aegir 4096 Oct 18 06:53 CVS
-rw-r--r-- 1 aegir aegir 364 Oct 7 22:19 aegir.make
drwxr-xr-x 3 aegir aegir 4096 Oct 18 06:53 db_server
-rw-r--r-- 1 aegir aegir 1692 Nov 27 2008 example.drushrc.php
-rw-r--r-- 1 aegir aegir 244 Sep 11 20:30 example.sudoers
-rw-r--r-- 1 aegir aegir 1616 Oct 6 06:52 migrate.hostmaster.inc
drwxr-xr-x 4 aegir aegir 4096 Oct 18 06:53 platform
-rw-r--r-- 1 aegir aegir 8879 Oct 6 17:28 provision.drush.inc
-rw-r--r-- 1 aegir aegir 8957 Sep 21 10:07 provision.inc
-rw-r--r-- 1 aegir aegir 168 Oct 21 2008 provision.info
-rw-r--r-- 1 aegir aegir 12933 Oct 1 20:41 provision.path.inc
drwxr-xr-x 7 aegir aegir 4096 Oct 18 07:06 provision.tmp
drwxr-xr-x 3 aegir aegir 4096 Oct 18 06:53 ssl
drwxr-xr-x 3 aegir aegir 4096 Oct 18 06:53 web_server

find /var/aegir/ -type d -name *.tmp

/var/aegir/drush/drush.tmp
/var/aegir/.drush/provision/provision.tmp

PS I also tried changing the shell to bash but it still doesn't verify. Here's what I get in the aegir task...

Task starts processing
Running: php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Initialized Drupal 6.14 root directory at /var/aegir/drupal-6.14
Could not find a Drupal settings.php file at ./sites/default/settings.php.
The command 'drush.php provision verify' could not be found.
Removing task from hosting queue
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete

Anonymous’s picture

Delete the folders that have .tmp

Ie

rm -rf /var/aegir/drush/drush.tmp
rm -rf /var/aegir/.drush/provision/provision.tmp

They are the root of the problem, and are a symptom of running the install.sh twice (or cancelling midway through the first time and re-running)

Anonymous’s picture

Category: bug » support
qbnflaco’s picture

yes I did run it twice, but I did it because I was running into issues the first time around. I removed the files and rerane and it failed again. Here's what it says...

Task starts processing
Running: php /var/aegir/drush/drush.php --root='/var/aegir/drupal-6.14' 'provision' 'verify' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Initialized Drupal 6.14 root directory at /var/aegir/drupal-6.14
Could not find a Drupal settings.php file at ./sites/default/settings.php.
The command 'drush.php provision verify' could not be found.
Removing task from hosting queue
An error occurred at function : drush_hosting_hosting_task
Changes for drush_hosting_hosting_task module have been rolled back.
Command dispatch complete

jamiet’s picture

Hi - not meaning to sound pushy but did you try to enter each of the commands I entered in post 15 above. I found initially entering sudo su -s /bin/bash aegir did not resolve the verify issue because I had not run the "hosting setup" command as user aegir using the bash shell. Hosting setup seems to do a number of tasks (as well as crontab) and one of those tasks meant that drush could 'see' the hosting and provision commands.

If you enter the drush command with no options you get the command list do you see any hosting / provision commands? If not that is why the verify does not work.

If you haven't re-issued hosting setup try doing this as user aegir using the bash shell (as per comment above) then retry the task (or submit it on the command line as aegir using bash shell). I found doing the above fixed the problems I was having.

HTH,

JamieT

qbnflaco’s picture

Awesome! I ran them and it seems to be working! Thanks for all the help!

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.