Webmail Error (Oops… something went wrong!)

Hello good morning friends.
I just used the Hestia CP, I managed the installation without problems.
My server is AMD 4 cores 64bits, 8GB Memory and 160GB disk, Ubuntu 20 system.
But when running Roundcube webmail, I got the same message from the image
https://forum.hestiacp.com/uploads/default/original/2X/2/225f83cbaea22fd177482a4d1cf5bb95a06cb925.png
I have done the steps of the topics:

then this

but as it continued the problem indicated that an installation of php 8 must be carried out

But everything remains the same
The same mistake:
Oops… something went wrong! An internal error has occurred.
Your request cannot be processed at this tim roundcube.

The penultimate step I did was for this topic:
Use the steps https://forum.hestiacp.com/uploads/default/original/2X/e/eac2cec19c349f988dcd3a4e83b674a99e0ea1fa.png
and it continued the same.

Then perform this step, where the installation Roundcube is forced from

/usr/local/hestia/install/upgrade/manual

with migrate_roundcube.sh file
here I got this:

root@cp:/usr/local/hestia/install/upgrade/manual# sh migrate_roundcube.sh
migrate_roundcube.sh:9:source:not found
migrate_roundcube.sh:11:source:not found
migrate_roundcube.sh:12:source:not found
To remove Roundcube you will need to use the root password. Password can be found in /usr/local/hestia/conf/mysql.conf
migrate_roundcube.sh:28:read:Illegal option -n

migrate_roundcube.sh:30:[[:not found

Oh, I don’t know what else to do.
My DNS are correct and verified.
The Domains website part does work correctly.
What I do see is that there is none in my BD, that could be the problem, but I don’t know how to solve it, there it asks for a password that is in the BD but if there isn’t where do I put it?

I don’t know what steps to do anymore.
I hope for your support.
Thank you

Hi @jrpr,

Changing the perms inside /etc/roundcube/ should be enough to solve the issue but seems you messed it up installing roundcube via apt.

Edit the script /usr/local/hestia/install/upgrade/manual/migrate_roundcube.sh and add this line:

source /etc/hestiacp/hestia.conf

Like this:

#!/bin/bash
# info: Disconnect Roundcube from APT and solving issues with Roundcube accidental updates from ATP

#----------------------------------------------------------#
#                    Variable&Function                     #
#----------------------------------------------------------#

source /etc/hestiacp/hestia.conf
# Includes
source $HESTIA/func/main.sh
# get current Roundcube version
source $HESTIA/install/upgrade/upgrade.conf
source $HESTIA/conf/hestia.conf

#----------------------------------------------------------#
#                    Verifications                         #
#----------------------------------------------------------#
[...]

Once the line is added, save the file and execute it again.

If it works as expected, once installed execute these commands:

chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/
1 Like

Hi @sahsanu, sorry for the delay in responding. I had to see the migration of the web pages.
Make the change that you indicated to me in the migrate_roundcube.sh file:


Then when I executed I got this message:
root@cp:/usr/local/hestia/install/upgrade/manual# sudo sh migrate_roundcube.sh
migrate_roundcube.sh:8:source:not found
migrate_roundcube.sh:10:source:not found
migrate_roundcube.sh:12:source:not found
migrate_roundcube.sh:13:source:not found
To remove Roundcube you will need to use the root password. Password can be found in /usr/local/hestia/conf/mysql.conf
migrate_roundcube.sh:29:read:Illegal option -n

This is my list of files in the “manual” folder
jrpr@cp:/usr/local/hestia/install/upgrade/manual$ ll
total 84
drwxr-xr-x 2 root root 4096 Jan 25 10:18 ./
drwxr-xr-x 5 root root 4096 Jan 15 14:58 …/
-rwxr-xr-x 1 root root 2661 Nov 28 00:40 configure-server-smtp.sh*
-rwxr-xr-x 1 root root 534 Nov 28 00:40 disable-non-tls-auth.sh*
-rwxr-xr-x 1 root root 1801 Nov 28 00:40 install_awstats_geoip2.sh*
-rwxr-xr-x 1 root root 1733 Nov 28 00:40 install_awstats_geoip.sh*
-rwxr-xr-x 1 root root 6356 Nov 28 00:40 install_sieve.sh*
-rwxr-xr-x 1 root root 3041 Nov 28 00:40 migrate_apache.sh*
-rwxr-xr-x 1 root root 2742 Nov 28 00:40 migrate_mpm_event.sh*
-rwxr-xr-x 1 root root 6243 Nov 28 00:40 migrate_multiphp.sh*
-rwxr-xr-x 1 root root 2248 Nov 28 00:40 migrate_ngnix_apache_nginx-php-fpm.sh*
-rwxr-xr-x 1 root root 7484 Nov 28 00:40 migrate_phpmyadmin.sh*
-rwxrwxr -x 1 root root 2212 Jan 25 10:18 migrate_roundcube.sh*
-rwxr-xr-x 1 root root 1822 Nov 28 00:40 remove-mail-stack.sh*
-rwxr-xr-x 1 root root 1007 Nov 28 00:40 secure_php.sh*
-rwxr-xr-x 1 root root 2199 Nov 28 00:40 upgrade_mariadb.sh*
-rwxr-xr-x 1 root root 901 Nov 28 00:40 upgrade_multi_php.sh*
-rwxr-xr-x 1 root root 2615 Nov 28 00:40 upgrade_php.sh*

I run it as the jrpr user and also as root, and I get the same response.
What could I be doing wrong?
Thank you for your kind response and guidance.
Best regards
@jrpr

its a bash script and you trigger it with sh. also as root, you dont need to run sudo. So just run the script with ./migrate-roundcube.sh

Hello @Raphael.
Thanks for your response, execute as you indicated:

and I had this answer


this is the list of files in the “manual” folder

What could be happening?
Thank you for your kind response and guidance.
Best regards
@jrpr

That you are not executing the right script, you are using ./migrate-roundcube.sh instead of ./migrate_roundcube.sh

sudo su -
/usr/local/hestia/install/upgrade/manual/migrate_roundcube.sh

Hi @sahsanu
I already managed to execute and I got this message:

It’s okay to continue with the commands:
chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname “*php” -exec chmod 640 {} ;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/

Or do I have to do something else?

Best regards
@jrpr

Yes, seems it can’t connect to db so remove it manually and reinstall roundcube using these commands:

mysql -uroot -e 'DROP DATABASE IF EXISTS roundcube'
mysql -uroot -e 'DROP USER 'roundcube'@'localhost''
rm /var/lib/roundcube/index.php

Now install roundcube again:

v-add-sys-roundcube

Change perms:

chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/
2 Likes

Dear @sahsanu, good day.
I have carried out all the steps that you indicated and now I was able to install and use the roundcube correctly.
Thank you for guiding me and helping me solve these problems.
Best regards,
@jrpr

1 Like

I had the “same” problem. In fact, in my case, i think that after upgrade ubuntu i run on terminal this command:

sudo apt autoremove

and it removed some PHP libraries! I always thought that this above command only remove “not needed” libraries on server, so i usually run it after a “successful upgrade” of the server.

I didn’t take note about the PHP libraries removed that day, but i remember that were a few related with PHP.

So when i couldn’t run Roundcube (getting the same “Oops… something went wrong! An internal error has occurred.” error message on web browser) i thought that maybe there was a problem related to those PHP removed libraries!

So i searched on apache error log file (probably you also need to do it too), in my case:

sudo tail /var/log/apache2/error.log

And i saw this:

PHP Fatal error:  Uncaught Error: Undefined constant PDO::MYSQL_ATTR_FOUND_ROWS in /var/lib/roundcube/program/lib/Roundcube/db/mysql.php:132

Stack trace:\n
#0 /var/lib/roundcube/program/lib/Roundcube/rcube_db.php(168): rcube_db_mysql->dsn_options()\n
#1 /var/lib/roundcube/program/lib/Roundcube/rcube_db.php(154): rcube_db->conn_create()\n
#2 /var/lib/roundcube/program/lib/Roundcube/rcube_db.php(259): rcube_db->dsn_connect()\n
#3 /var/lib/roundcube/program/lib/Roundcube/rcube_db.php(450): rcube_db->db_connect()\n
#4 /var/lib/roundcube/program/lib/Roundcube/rcube_db.php(418): rcube_db->_query()\n#5 /var/lib/roundcube/program/lib/Roundcube/session/db.php(114): rcube_db->query()\n
#6 [internal function]: rcube_session_db->read()\n#7 /var/lib/roundcube/program/lib/Roundcube/rcube_session.php(141): session_start()\n
#8 /var/lib/roundcube/program/lib/Roundcube/rcube.php(495): rcube_session->start()\n
#9 /var/lib/roundcube/program/include/rcmail.php(649): rcube->session_init()\n#10 /var/lib/roundcube/program/include/rcmail.php(118): rcmail->session_init()\n
#11 /var/lib/roundcube/program/include/rcmail.php(93): rcmail->startup()\n
#12 /var/lib/roundcube/index.php(43): rcmail::get_instance()\n#13 {main}\n  thrown in /var/lib/roundcube/program/lib/Roundcube/db/mysql.php on line 132

Well, the important part is the first part:

Error: Undefined constant PDO::MYSQL_ATTR_FOUND_ROWS

indicating that there was a problem with Mysql PDO.

Solution
Install the PHP MySQl PDO and restart apache service. In fact i need to repeat this twice because it was missing also another library:

sudo apt install php8.0-mysql
sudo apt install php8.0-intl
sudo service apache2 restart

I knew about the missing php8.0-intl because after install php8.0-mysql i continue getting error on Roundcube, so looking at the apache error log it said:

PHP Fatal error:  Uncaught Error: 
Undefined constant "INTL_IDNA_VARIANT_UTS46"

PHP version running Roundube

In fact, before that i had to find which is the PHP version running Roundcube, because it’s not the same that for your websites.

For this i modified this file:

nano /var/lib/roundcube/index.php

and put as first command inside:

echo 'PHP version: '.phpversion(); die();

which returned on browser:

PHP version: 8.0.30

I hope this help other people. I tried all the mentioned above by @jrpr and @sahsanu , but it didn’t work for me, due to obvious reasons :sweat_smile: