Virtualmin - installing Roundcube gives "Access denied for user"

Tried several times to install Roundcube from Vmin but doesnt work, even on fresh Vmin installation:

Now installing RoundCube version 1.1.5 ..
Failed to run database setup script : ERROR 1045 (28000): Access denied for user 'vsadminuser'@'localhost' (using password: YES) .
More information on using this script can be found at http://www.roundcube.net/.

But over SSH username and password works without any problem:

[root@jenkins ~]# mysql -u vsadminuser -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 83
Server version: 5.5.47-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

I try to change the password in Vmin and over SSH but didnt help, same error pop out every time during Roundcube installation. Still over SSH works without any problem and i can log with that user.

Status: 
Active

Comments

Diabolico's picture
Submitted by Diabolico on Mon, 06/20/2016 - 01:58

Title: Virtualmin - installing Roudcube gives "Access denied for user" » Virtualmin - installing Roundcube gives "Access denied for user"
Body: View changes

Howdy -- it sounds like the MySQL password Virtualmin is trying to use is out of sync with what the actual database password is for that user.

You may want to try changing that user's MySQL password from within Virtualmin, and then try the installation again.

Diabolico's picture
Submitted by Diabolico on Mon, 06/20/2016 - 09:43

I just said in my first post that this solution i tried but didnt work. It happened on 2 fresh Vmin installations so its not something random.

You mentioned changing the password -- just be super sure you're changing the database password for that user, and not just the system password (they aren't necessarily the same thing, depending on the settings being used).

So far I haven't been able to reproduce an issue like that, and we haven't had other reports of that happening, but we'll do some additional testing to see if we can figure out why that could occur.

Diabolico's picture
Submitted by Diabolico on Mon, 06/20/2016 - 10:27

I know, i have separate password for VS admin and VS MySQL. For me it happened 2 times with fresh Vmin install. After i saw it first time i tried everything to solve this problem but i didnt get anywhere so i tried again with fresh Vmin install and same thing happened.

Super, thanks for clarifying. I'm looking into that issue.

shame this issue is still there unaddressed.

Unfortunately we haven't been able to reproduce this, it doesn't seem to occur all the time or for all Virtualmin users.

There's two things we've seen that can cause this. One, is that if the Virtual Server owner has a .my.cnf in their homedir, that can cause database login problems.

And the other is that is if database password being used by the domain gets out of sync with what Virtualmin thinks it should be.

If you try making a new Virtual Server, even just a test one with a non-real domain (I use test.com a lot when testing), and then go to add RoundCube -- does that work? Or do you see the same issue?

And then what about another script such as WordPress -- does it install properly, or do you experience the same issue there?

I saw this today on a domain that was restored from a backup... it didn't work until the database password was reset.

Is that the case for any of you guys here -- was RoundCube being installed into a domain that was recently restored? Or was this a newly created domain?

Well, in my case its parent domain was restored recently and sub-domains always get the parents' usernames and passwords, so probably your guess is right. However anyway this should be resolved on *-min level to save users from confusion.

To get this done I had to download RoundCube source and use its own installation script. Next time of course I'll try to change the parents password and then try to install Rouncube on its subdomain.

Ok, so is the problem triggered if you restore a domain under a new owner which means it gets a new database login? That's tough for Virtualmin to fix, as it would need to know all the config files and formats for that store the database details for each script.

The username and database were the same.

dzintars's picture
Submitted by dzintars on Sat, 06/24/2017 - 18:06

The same issue there. Spend all day to find solution. So.. system user and pass is the same as user and pass for database. I can connect from outside to database via Workbench like software and SSH. I am able to simply install Wordpress But i cant install RoundCube script as i got the same error all the time. I tried everything i was able to imagine. I deleted a subdomain, created new and so on. Nothing helps. I will try to login in Webmin as ROOT no a normal administrator.

Mine https://virtualmin.com/node/40478 was created before, however since this one got ore attention I am posting all the same issue, that is for some magical reasons not reproducable to Virtuamin team here again.

It is in fact easily reproducible and there are tons of reports like, for example:

This is the solution: 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, you have to edit script with your real Account name, user and password! Then run the install script once again. I used the RoundCube stable version 1.2.9