Roundcube install script fails with "Database connection failed"

6 posts / 0 new
Last post
#1 Tue, 01/24/2017 - 10:45
DeejaySane

Roundcube install script fails with "Database connection failed"

Hello,

I hope I post this in the right forum. I'm using Virtualmin 5.05 on CentOS Linux 7.3.1611.

I am having trouble installing Roundcube on a subdomain. I am using install scripts. The script fails with the following error: "Database connection failed: DBI connect failed : Access denied for user 'xxx'@'localhost' (using password: YES) 1427."

The user xxx is actually the Administration user of the main domain. Passwords are stored encrypted.

What have I tried to fix this?

1) google, google, google, to no avail, I only found one message here in the forum from several years ago from someone having the same problem (but the solution given there did not work)

2) while running the install script, I have both tried to use the MySQL database of the subdomain (it is called webmail) as well as the newly generated one (called webmail_roundcube)

3) I have made sure that the user xxx has rights in the webmail database, by going to Webmin > Servers > MySQL Database Server > User Permissions as well as Database Permissions:

  • the user has nearly-everything privileges in this database, on both localhost as % (any)
  • the user has read-only-privileges in all other databases, just to be sure, on both localhost as % (any)

4) While testing, I removed the user, the database, and recreated them, through mysql (while being logged in as root), using the same password as I used creating the virtual host

5) I verified that I can log in in MySQL Workbench on my laptop with these credentials and made sure that the privileges are set just right

6) I verified that the encrypted password which is stored in mysql is the same that is stored in the domain-file in /etc/webmin/virtual-server/domains/ (and it is)

7) I examined the perl script /etc/webmin/virtual-server/latest-scripts/roundcube.pl to see what variables are used there. My knowledge of Perl does not go very far, but I am able to view the variables being used and it sure looks like $dbpass is empty

So, maybe what causes this:

1) the install script does not use the password??

2) the install script cannot use an encrypted password??

3) or is there something completely different going on?

I've been working on this for five or six hours now and I cannot figure this out, I hope this makes sense to someone and that someone has the clue :)

Wed, 01/25/2017 - 04:31
DeejaySane

Okay, today I tried two more things:

1) I altered the roundcube.pl script to not use the password from the domain information, I substituted $dbpass with the encrypted password (did not work)

2) I did the same but now with the normal password (this did the trick!!)

So, conclusion, it looks like the roundcube.pl script cannot work with encrypted passwords (which, in my opinion, is the only way you should store passwords on your server, but that's another story)

Thu, 11/16/2017 - 15:00
dzintars
dzintars's picture

It is true. RoundCube script will not work IF your domain (virtual server) use encrypted password storing. If this is fresh setup, then delete virtual server and edit Server Template files. Create new virtual server.

This is simple to install RoundCube manually. Create sub-server.... for example mail.domain.com Download RC complete package from RC official website. Upload all content of downloaded ZIP/TAR to sub-servers public_html directory. Open browser Be sure all required OK's are green. Fill the required fields to setup RC Delete installation directory from public_html. It was working for me.

Dzintars

Thu, 11/23/2017 - 04:31
Jfro

Please look also here and make a howto if possible for Forumusers? https://www.virtualmin.com/comment/782338#comment-782338

I don't use roundcube..

Fri, 07/20/2018 - 11:02
glivanis

Finally i got it! My first attempt to install roundcube was unsuccessful, leaving behind an empty database by the name account-name_roundcube. All you have to do is click on Virtualmin / Edit databases / select the roundcube database / Manage Database / Execute SQL. Then execute:

GRANT ALL PRIVILEGES ON account-name_roundcube.* TO adminuser@localhost IDENTIFIED BY 'password';

OF COURSE, first you have to edit script with your real account name, user and password! Then, run the install script once again and surprise! Roundcube installed!

Sun, 07/21/2019 - 20:03
victorbelgrano@...

Greetings. I have had the same problems installing the roundcube script for virtualmin but I have already solved it.

After installing the scriptover some virtual host, a database is created correctly and installed correctly, but the message appears: "... Error establishing connection database ..." The file "public_html / roundcube / conf / conf.inc.php" contains the connection configuration to the roundcube database.

(Note: "roundcube" is the directory where I suppose you installed the script.)

I have detected that some passwords are not properly inserted in the script (they just do not work when they have special characters).

To solve this problem, simply modify the password of the "conf.inc.php" file with a simpler password. You must also access the "database user's permissions" to change the same password from the Virtualmin panel.

With this, the "database connection error ..." error disappears.

I hope it helps and is modified for the next updates of Virtualmin. A greeting.

Topic locked