Kolab 16 on Centos 7 - installation issue



  • Re: No such file or directory

    Hi there, when installing Kolab 16 on fresh installation of Centos 7 (upgraded / updated), followed instructions, I am getting the following during installation.

    Installing : chwala-0.5-1.1.el7.kolab_16.noarch                       512/516
    ERROR: SQLSTATE[HY000] [2002] No such file or directoryError 500: Error connecting to database: SQLSTATE[HY000] [2002] No such file or directory
    
    Installing : kolab-16.0.1-4.3.el7.kolab_16.x86_64                     516/516
    ERROR: SQLSTATE[HY000] [2002] No such file or directoryError 500: Error connecting to database: SQLSTATE[HY000] [2002] No such file or directory
    

    The rest of the packages installs without issue, but these two give this error.

    I have tried to install mariadb and start the server before installing kolab but the I got this:

    Installing : chwala-0.5-1.1.el7.kolab_16.noarch                       475/479
    ERROR: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES)Error 500: Error connecting to database: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES)
    
    Installing : kolab-16.0.1-4.3.el7.kolab_16.x86_64                     479/479
    ERROR: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES)Error 500: Error connecting to database: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES)
    

    Anyone has an idea what can be done to prevent the errors to occur?

    Thanks in advance!



  • I did not give up finding how to install Kolab without the errors. It took quite some time but finally I know what is the root cause and how to workaround it.

    The issue seems to come from a few things:

    1. The MariaDB server is not started during the installation process

    2. There is a password specified in the config.inc.php in roundcubemail-core package

    Luckily I have managed to find steps to workaround both. Obviously there are no guaranties for any potential damages it can cause! ;)

    And here are the steps:

    1. Make sure you have wget installed yum install -y wget

    2. Follow the System preparation guide at https://docs.kolab.org/installation-guide/preparing-the-system.html

    3. Follow the Installation Guide at https://docs.kolab.org/installation-guide/centos-7.html ! BUT DO NOT EXECUTE yum install kolab !

    4. Install HTTP Server yum install -y httpd (this may not be needed but I was lazy to reinstall one more time just to test it)

    5. Change to your home directory cd /home/<yourhomedir>

    6. Install and configure MariaDB Server
      yum install -y mariadb-server
      systemctl enable mariadb
      systemctl start mariadb
      systemctl status mariadb
      mysql -u root -e "CREATE USER roundcube@localhost;"
      mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO roundcube@localhost WITH GRANT OPTION;"
      mysql -u roundcube -e "CREATE DATABASE roundcubemail;"
      wget https://raw.githubusercontent.com/roundcube/roundcubemail/master/SQL/mysql.initial.sql
      mysql roundcubemail < mysql.initial.sql

    7. Create "patched" configuration file for Roundcube
      mkdir /etc/roundcubemail
      cd /etc/roundcubemail
      wget -O config.inc.php https://raw.githubusercontent.com/roundcube/roundcubemail/master/config/config.inc.php.sample
      nano /etc/roundcubemail/config.inc.php

      On line 28 there is this syntax:
      $config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

      but it should be (note the missing password):
      $config['db_dsnw'] = 'mysql://roundcube@localhost/roundcubemail’;

    8. Prevent the file from being overwritten during installation chattr +i config.inc.php

    9. And now you can execute the Kolab installation yum install -y kolab!

      The installation runs smoothly, just gives a warning on the config.ini.php file

    Installing : roundcubemail-core-1.2.4-5.1.el7.kolab_16.noarch                                                                                                                                                 374/472
    warning: /etc/roundcubemail/config.inc.php created as /etc/roundcubemail/config.inc.php.rpmnew
    

    But then you are rewarded by this:

      Installing : chwala-0.5-1.1.el7.kolab_16.noarch                                                                                                                                                               468/472
    Updating database schema (2015110400)... [OK]
    Updating database schema (2016101700)... [OK]
      Installing : iRony-0.4-4.10.el7.kolab_16.noarch                                                                                                                                                               469/472
      Installing : kolab-freebusy-1.1-3.10.el7.kolab_16.noarch                                                                                                                                                      470/472
      Installing : kolab-webclient-16.0.1-4.3.el7.kolab_16.x86_64                                                                                                                                                   471/472
      Installing : kolab-16.0.1-4.3.el7.kolab_16.x86_64                                                                                                                                                             472/472
      Verifying  : libXext-1.3.3-3.el7.x86_64                                                                                                                                                                         1/472
    

    As you see the schema gets updated and the installation of kolab-16.0.1-4.3.el7.kolab_16.x86_64 gives no error either!

    1. Do not forget to remove the lock on the config.inc.php file chattr -i /etc/roundcubemail/config.inc.php, otherwise you will get an error when running setup-kolab.

    2. Now you should be able to run setup-kolab.

    Happy Kolabing!


  • Kolabian

    Strange. DB schema updates should be done only on upgrade not installation.



  • Hmm ... then I have no explanation for it.

    It was a fresh minimal Centos 7 installation and followed Prep and Installation Guides.



  • Hi, thanks tku, your explanations really helped me a lot!!

    I can confirm that issue and the solution provided. With a slight difference for the line to change in config.inc.php because:

    1. the database created by kolab is roundcube and not roundcubemail
    2. There is no way that I'm going to create a roundcube user and give him full right on all database. And no way that I'm letting a root user without password. So my approach is to create a roundcube user with a password

    Therefore:

    1. I'll make sure to have a password on the mysql root user (for instance by running the script mysql_secure_installation:
    #  mysql_secure_installation
    
    1. I create the roundcube user and database (thess commands will ask for the root password set above)
    # mysql -u root -p -e "CREATE DATABASE roundcube;"
    # mysql -u root -p -e "GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost  IDENTIFIED BY 'CHOOSE_A_ROUNDCUBE_PASS_HERE'";
    
    1. populate the roundcube database (again this will ask for the root password)
    mysql -u root -p roundcube < /root/mysql.initial.sql
    

    I replace the line in config.inc.php:

    # sed -i "s#\$config\['db_dsnw'\] = 'mysql\://roundcube\:pass\@localhost/roundcubemail'\;#\$config['db_dsnw'] = 'mysql://roundcube:PUT_THE_SAME_ROUNDCUBE_PASS_HERE@localhost/roundcube';#g" /etc/roundcubemail/config.inc.php
    
    1. when running setup-kolab, select the option for an existing database and enter the root and roundcube password according to the ones you picked earlier

Log in to reply