Closed (works as designed)
Project:
Provision
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 May 2011 at 01:56 UTC
Updated:
19 Aug 2012 at 14:02 UTC
none of the following worked
drush hostmaster-install
drush hostmaster-install --aegir_db_user=root --aegir_db_pass=password
drush hostmaster-install --aegir_db_user=aegir --aegir_db_pass=password
with similar message to
SQLSTATE[28000] [1045] Access denied for user 'aegir'@'localhost' (using password: NO) [error]
Unable to connect to database server. [error]
*_NOTE_* that whether i state the user is root or aegir the script always fails with aegir@localhost as mentioned in #1134526
my OS is centos 5.6
the steps i did to reach that stage are:
cat /etc/redhat-release| grep CentOS > /dev/null
if [ $? -eq 0 ]
then
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/i386/epel-release-1-1.ius.el5.noarch.rpm http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/i386/ius-release-1.0-6.ius.el5.noarch.rpm
yum -y install yum-plugin-replace
yum -y replace php --replace-with php53
yum -y install httpd postfix sudo unzip mysql-server php53u-pdo php53u-process php53u-mysql
else
yum -y install httpd postfix sudo unzip mysql-server php php-mysql php-process
fi
sed -i 's/^memory_limit = .*$/memory_limit = 192M/g' /etc/php.ini
service httpd restart
service mysqld restart
/usr/bin/mysql_secure_installation
export WEBHOME=/var/www/html/aegir
echo " INFO: User creation"
useradd --home-dir $WEBHOME aegir
gpasswd -a aegir apache
chmod -R 755 $WEBHOME
! [ -d $WEBHOME ] || mkdir $WEBHOME
chown aegir.apache $WEBHOME
grep aegir /etc/sudoers > /dev/null
if ! [ $? -eq 0 ]
then
echo "aegir ALL=NOPASSWD: /usr/sbin/apachectl" >> /etc/sudoers
fi
echo " INFO: Creating MySQL user: $AEGIR_DB_USER"
mysql -uroot -ppassword -e "CREATE USER aegir@localhost IDENTIFIED BY 'password';"
mysql -uroot -ppassword -e "CREATE USER aegir@'`hostname`' IDENTIFIED BY 'password';"
mysql -uroot -ppassword -e "GRANT ALL ON *.* TO aegir@'`hostname`'"
mysql -uroot -ppassword -e "GRANT ALL ON *.* TO aegir@localhost"
su -c -l aegir '
export DRUSH_VERSION=7.x-4.4
export WEBHOME=/var/www/html/aegir
export HOME=$WEBHOME
export drush="$WEBHOME/bin/drush/drush"
export DRUPAL_VER=6.x
export AEGIR_DB_USER=aegir
export AEGIR_DB_PASS=password
mkdir ~/bin/
cd $HOME/bin
wget http://ftp.drupal.org/files/projects/drush-$DRUSH_VERSION.tar.gz
gunzip -c drush-$DRUSH_VERSION.tar.gz | tar -xf -
rm -rf drush-$DRUSH_VERSION.tar.gz
alias drush="$HOME/bin/drush/drush" >> $HOME/.bashrc
. $HOME/.bashrc
cd $HOME
$drush -y self-update
$drush --destination=$HOME dl drupal-$DRUPAL_VER
echo Installing drupal module : provision
$drush dl --destination=$HOME/.drush provision-6.x
echo Running hostmaster install
echo ---
echo $drush hostmaster-install --aegir_db_user=$AEGIR_DB_USER --aegir_db_pass=$AEGIR_DB_PASS
echo ---
$drush hostmaster-install
'
Comments
Comment #1
anarcat commentedThere's an error in your procedure:
that user will have access only to one database. the user you pass to hostmaster-install should have root access.
unless you are trying to write a script or package for this platform, please follow the documented way to install and upgrade your platform (more specifically this).
where does this procedure come from?
Comment #2
anarcat commentedComment #3
marafa commentedanarcat
i cant see where the mistake is? could you point it out to me?
thanks
Comment #4
anarcat commentedAs I said:
Which means that the mysql user you are creating is wrong - you need to give it more (ie. root) privileges.
You should really follow the right install instructions.
Comment #5
marafa commentedThe only specific references to the mysql user that i can find are belo:
- "Aegir will create database users and will require the use of the MySQL 'root' user."
- "The installer will prompt you for your MySQL root user password. The root user will be used to make administrative tasks such as creating new databases, and granting and revoking access to those databases for sites."
so it does not say aegir requires root priveledges. but no matter because even when i say it
it fails too
pls advise as to what i am missing also, if you could give me the command to give the aegir user root priveledges i would appreciate it.
thanks
Comment #6
anarcat commentedCan you show us how it fails when you call it with db_user=root?
Comment #7
marafa commentedyes
http://community.aegirproject.org/discuss/hostmaster-11-refuses-install
Comment #8
marafa commentedanother attempt:
Comment #9
anarcat commentedSorry for the delay. Please look in the ~/.drush/server_master.alias.php file if the password is properly stored there. Normally it should be passed down from hostmaster-install by provision-save.
Comment #10
marafa commentedapparently the directory /var/aegir has been hard coded into the script and that is why it kept failing with me. it worked when i used that directory instead of /var/www/html
in the redhat world web apps and data go into /var/www/html and i do believe this is an lsb standard but then again i am not a lawyer.
note that phpmyadmin goes into /usr/share/phpMyAdmin via /etc/httpd/conf.d/phpMyAdmin.conf file however it is an app and does not have data.
as to why when this directory was used it rejected all passwords is unknown as i am not a programmer.
Comment #11
socialnicheguru commented#9 and anarcat. This should be placed in troubleshooting on community.aegirproject.org.
OK. I was having this on problem on Aegir 1.6.
In fact if you have a special character in your password it does NOT escape it correctly.
Edit. I think the file, /var/aegir/.drush/server_localhost.alias.drushrc.php, takes it's value from the database.
in phpmyadmin do a search for your database
The result should be something like:
1 match(es) inside table hosting_db_server
change it here. I believe that the above .drush file gets it's value from the database
Comment #12
steven jones commentedNeed to step through the code in a debugger and see what light that sheds...
This is a good candidate for getting some tests.
Comment #13
anarcat commented@SocialNicheGuru - feel free to add to the troubleshooting section, it's a wiki.
@steven - i suspect the bug is higher up in the stack, probably in hostmaster-install, as we do have proper escape routines when writing, if i remember correctly.
Comment #14
chriszz commentedSame thing happened to me. Password with Special Characters was not saved correctly in the AEGIR Database. I was doing a debian apt-get install from 1.6. Changing the password in the database as recommended by #11 was the remedy.
thanks and best regards
Christian
Comment #15
vadym.kononenko commentedHi all.
I've found workaround for this error.
1. I've tried to set correct password through SQL Query in my 'Mysql Query Browser', but special char '[' was replaced to '%5B' in updated record too.
2. In '/var/lib/aegir/.drush/server_localhost.alias.drushrc.php' I've replace '%55B' chars to '%5B' and made file unchangable thorough 'chattr +i /var/lib/aegir/.drush/server_localhost.alias.drushrc.php'
3. After this manipulations aegir verification procedule for 'localhost' server went to successfull state with such warnings:
Could not change permissions of /var/lib/aegir/.drush/server_localhost.alias.drushrc.php to 640 (chmod to 640 failed on /var/lib/aegir/.drush/server_localhost.alias.drushrc.php)
file_put_contents(/var/lib/aegir/.drush/server_localhost.alias.drushrc.php): failed to open stream: Permission denied provision.file.inc:430
Could not generate Drush configuration file
My configuration: dpkg -l | grep aegir
ii aegir 1.7 mass Drupal hosting system
ii aegir-cluster-slave 1.7 web frontend for the Aegir hosting system
ii aegir-hostmaster 1.7 mass Drupal hosting system - frontend
ii aegir-provision 1.7 mass Drupal hosting system - backend
Comment #16
steven jones commentedJust tried this again, and I really do think that we fixed it in recent releases of Aegir. If you can give me an example of a password that Aegir doesn't install with, please re-open.