Roundcube Community Forum

 

Trouble installing Roundcube 1.6.0

Started by arpringle, October 25, 2022, 01:16:11 AM

Previous topic - Next topic

arpringle

Hello,

I have recently been following Xiao Guoan's excellent tutorial series on creating a mail server from scratch. It can be found over on linuxbabe.com. The only section where I've really run into trouble is installing Roundcube. The steps I followed for installation can be found here: https://www.linuxbabe.com/ubuntu/install-roundcube-webmail-ubuntu-postgresql. During my instalI process, I did everything the same as in this tutorial, with the exception of installing newer 8.1 PHP packages and downloading 1.6.0 instead of 1.5.2. However, whenever I go to the web site, instead of seeing the web-based installer, I get the "Oops, something went wrong. An internal error has occurred. Your request cannot be processed at this time."

Checking /var/www/roundcube/logs/errors.log, the error file, doesn't clear much of anything up. It throws SQL error 2002, saying that there is "no such file or directory" and the error can be found in /var/www/roundcube/program/lib/Roundcube/rcube_db.php , at line 200.

Line 200 itself is just the line of code that throws the error. Taking a look at the preceding lines of code appears that perhaps Roundcube is having a difficult time opening the imported Postgres database?

Another hint might be that this problem has persisted even after I deleted the entire Roundcube directory, dropped the Roundcube pgsql database and associated user, and restarted from the top of the Roundcube tutorial. So potentially this could be related to a configuration parameter outside of Roundcube, for instance, in Apache?

I'm not very knowledgeable about PHP or SQL, so I don't exactly have the tools to troubleshoot this. Any help on this matter would be greatly appreciated.

SKaero

When you configure the database connect in Roundcube are you setting the database host to "localhost" or "127.0.0.1"?

arpringle

Quote from: SKaero on October 25, 2022, 06:04:26 PM
When you configure the database connect in Roundcube are you setting the database host to "localhost" or "127.0.0.1"?

127.0.0.1 I believe. The command that the tutorial tells me to issue to connect the database is this one:

psql -h 127.0.0.1 -d roundcube -U roundcubeuser -W -f /var/www/roundcube/SQL/postgres.initial.sql

SKaero

I'm referring to what you enter at step Step 7: Finish the Installation in Web Browser for the Database server.

arpringle

Quote from: SKaero on October 26, 2022, 11:24:39 AM
I'm referring to what you enter at step Step 7: Finish the Installation in Web Browser for the Database server.

Oh, I haven't gotten there. I can't even open the web-based install.

SKaero

So the error happens when you try and open the installer page? It seems odd that it would be a database error at that point since there isn't a attempt to connect to the database at that point.

arpringle

Yes, that is correct. Bizarre, I know. I think potentially I got the setup page to open once, but I am sure I didn't complete the process. I must have screwed something up? But it's strange, even when I delete the Roundcube directory over at /var/www/roundcube/ entirely, as well as telling Postgres to drop the user and the database and  I make new ones, the problem still persists. Does Roundcube store any config or program files outside of the /var/www/roundcube/ directory such that they would persist?

I also have since attempted to install all the dependencies of Roundcube as listed on Debian's package list to see if that would fix anything, with no results.

Also, is the program maybe somehow trying to use MySQL instead of Postgres?

SKaero

The code there should only run if there is a Roundcube config file located in <RC root>/config/config.inc.php. That said I know the Roundcube Debian package of pulls the config out of the Roundcube directory so that maybe something that is causing problems. If the <RC root>/config/config.inc.php file doesn't exist can you edit the <RC root>/installer/test.php file and after first first <?php on line 1 add the following and report that output?
die(RCUBE_CONFIG_DIR);

arpringle

#8
I get a new error if I add that line of code. Instead of error 2002, with no such file or directory, it now throws:

DB Error: SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: NO) in var/www/roundcube/program/lib/Roundcube/rcube_db.php on line 200 (GET /)

Same file and line as before, new error. Also, maybe I'm misinterpreting this, but I don't see why password would be "NO." I set a password in Postgres before importing the initial tables to Roundcube. How bizarre.

SKaero

Hmm, that means the error is coming from someplace else. Can you try adding the same line in the <RC root>/installer/index.php after the following line:
require INSTALL_PATH . 'program/include/iniset.php';

arpringle

Adding that line there throws the same error as adding it into the other file.

SKaero

OK, let try this one fine time, can you try adding the following line:

die(getenv('ROUNDCUBE_CONFIG_DIR') ?: 'default');

After the following line in the <RC root>/installer/index.php file:

define('INSTALL_PATH', realpath(__DIR__ . '/../').'/');

arpringle

Same error as before, 1045. Of note, perhaps, is that the error has now permanently changed to 1045 instead of 2002. Even when I remove all the lines you told me to add, the error didn't go back to the old error. I'm beginning to think I may have manually created a config file by mistake at some point? It seems like all signs point to that, because the DB is trying to be accessed which shouldn't happen if the setup hasn't been finished yet, right?

SKaero

At that point there is no code that could be running to try and connect to the database so I can't really offer any other suggestions. Is it possible for me to connect to the server so I can take a look at what is going on?