Author Topic: Trouble installing Roundcube 1.6.0  (Read 458 times)

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Trouble installing Roundcube 1.6.0
« on: October 25, 2022, 01:16:11 AM »
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.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #1 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"?

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Re: Trouble installing Roundcube 1.6.0
« Reply #2 on: October 26, 2022, 10:09:35 AM »
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:

Code: [Select]
psql -h 127.0.0.1 -d roundcube -U roundcubeuser -W -f /var/www/roundcube/SQL/postgres.initial.sql

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #3 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.

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Re: Trouble installing Roundcube 1.6.0
« Reply #4 on: October 26, 2022, 12:55:12 PM »
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.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #5 on: October 27, 2022, 11:31:52 AM »
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.

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Re: Trouble installing Roundcube 1.6.0
« Reply #6 on: October 27, 2022, 03:11:01 PM »
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?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #7 on: October 27, 2022, 05:28:48 PM »
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?
Code: [Select]
die(RCUBE_CONFIG_DIR);

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Re: Trouble installing Roundcube 1.6.0
« Reply #8 on: October 28, 2022, 12:17:25 AM »
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:

Code: [Select]
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.
« Last Edit: October 28, 2022, 12:22:48 AM by arpringle »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #9 on: October 28, 2022, 12:11:47 PM »
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:
Code: [Select]
require INSTALL_PATH . 'program/include/iniset.php';

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Re: Trouble installing Roundcube 1.6.0
« Reply #10 on: October 28, 2022, 01:43:15 PM »
Adding that line there throws the same error as adding it into the other file.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #11 on: October 28, 2022, 06:16:45 PM »
OK, let try this one fine time, can you try adding the following line:
Code: [Select]
die(getenv('ROUNDCUBE_CONFIG_DIR') ?: 'default');
After the following line in the <RC root>/installer/index.php file:
Code: [Select]
define('INSTALL_PATH', realpath(__DIR__ . '/../').'/');

Offline arpringle

  • Newbie
  • *
  • Posts: 7
Re: Trouble installing Roundcube 1.6.0
« Reply #12 on: October 29, 2022, 12:06:51 PM »
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?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,783
    • SKaero - Custom Roundcube development
Re: Trouble installing Roundcube 1.6.0
« Reply #13 on: October 29, 2022, 02:42:02 PM »
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?