Roundcube Community Forum

 

Oops... something went wrong! (edited)

Started by chewiesw, March 11, 2025, 10:33:21 AM

Previous topic - Next topic

chewiesw

Hi,

I have just re-installed Roundecube on a new server and I am getting this error. Oops... something went wrong!
An internal error has occurred. Your request cannot be processed at this time.

From The Roundecube error log


11-Mar-2025 13:50:10 UTC] PHP Deprecated:  session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in /var/www/roundcube/program/lib/Roundcube/rcube_session.php on line 119
[11-Mar-2025 13:50:10 UTC] PHP Fatal error:  Uncaught Error: Undefined constant PDO::MYSQL_ATTR_FOUND_ROWS in /var/www/roundcube/program/lib/Roundcube/db/mysql.php:129
Stack trace:
#0 /var/www/roundcube/program/lib/Roundcube/rcube_db.php(168): rcube_db_mysql->dsn_options()
#1 /var/www/roundcube/program/lib/Roundcube/rcube_db.php(154): rcube_db->conn_create()
#2 /var/www/roundcube/program/lib/Roundcube/rcube_db.php(259): rcube_db->dsn_connect()
#3 /var/www/roundcube/program/lib/Roundcube/rcube_db.php(450): rcube_db->db_connect()
#4 /var/www/roundcube/program/lib/Roundcube/rcube_db.php(418): rcube_db->_query()
#5 /var/www/roundcube/program/lib/Roundcube/session/db.php(113): rcube_db->query()
#6 [internal function]: rcube_session_db->read()
#7 /var/www/roundcube/program/lib/Roundcube/rcube_session.php(141): session_start()
#8 /var/www/roundcube/program/lib/Roundcube/rcube.php(495): rcube_session->start()
#9 /var/www/roundcube/program/include/rcmail.php(649): rcube->session_init()
#10 /var/www/roundcube/program/include/rcmail.php(118): rcmail->session_init()
#11 /var/www/roundcube/program/include/rcmail.php(93): rcmail->startup()
#12 /var/www/roundcube/index.php(43): rcmail::get_instance()
#13 {main}
  thrown in /var/www/roundcube/program/lib/Roundcube/db/mysql.php on line 129

I also see this
2025/03/11 15:27:02 [error] 1512#1512: *1 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected variable "$config" in /var/www/roundcube/config/config.inc.php on line 28" while reading response header from upstream, client: , server: mail.com, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.4-fpm.sock:", host: "mail.com"

Line 28 is the location of mysql

$config['db_dsnw'] = 'mysql://roundcube_user:mypassword@localhost/roundcube';

All the other log files look fine to my eye.

SKaero

Going though the errors 1 by one:
PHP Deprecated:  session_set_save_handler()This is an issue for PHP 8.4, its fixed in master but isn't in a mainline releace yet. https://github.com/roundcube/roundcubemail/issues/9060

PHP Fatal error:  Uncaught Error: Undefined constant PDO::MYSQL_ATTR_FOUND_ROWSSomething is wrong with with your PHP Mysql PDO installation, this is what would be causing Roundcube to be broken but its not a Roundcube problem.

1 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected variable "$config"The real problem is likely above that line, can you post a full version of your config file?

chewiesw

My config file
<?php

/*
 +-----------------------------------------------------------------------+
 | Local configuration for the Roundcube Webmail installation.           |
 |                                                                       |
 | This is a sample configuration file only containing the minimum       |
 | setup required for a functional installation. Copy more options       |
 | from defaults.inc.php to this file to override the defaults.          |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) The Roundcube Dev Team                                  |
 |                                                                       |
 | Licensed under the GNU General Public License version 3 or            |
 | any later version with exceptions for skins & plugins.                |
 | See the README file for a full license statement.                     |
 +-----------------------------------------------------------------------+
*/

$config = [];
$config['enable_installer'] = true
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// NOTE: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
//       or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
$config['db_dsnw'] = 'mysql://roundcube_user:sp7WrAma@localhost/roundcube';

// IMAP host chosen to perform the log-in.
// See defaults.inc.php for the option description.
$config['imap_host'] = 'tls://mail.com:143';

// SMTP server host (for sending mails).
// See defaults.inc.php for the option description.
$config['smtp_host'] = 'tls://mail.com:25';

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';

// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';

// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';

// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = 'rcmail-!24ByteDESkey*Str';

// List of active plugins (in plugins/ directory)
$config['plugins'] = [
    
'archive',
    
'zipdownload',
];

// skin name: folder from skins/
$config['skin'] = 'elastic';

SKaero

The line:
$config['enable_installer'] = trueis missing a semicolon at the end. It should be:
$config['enable_installer'] = true;
That will resolve the config syntax error.

chewiesw

#4
Making Progress sort of...

I added the semicolon and installed php-sql.

Now I get
[12-Mar-2025 11:17:30 UTC] PHP Deprecated:  session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in /var/www/roundcube/program/lib/Roundcube/rcube_session.php on line 119
[12-Mar-2025 11:17:30 +0000]: <llkc7lsv> DB Error: [1146] Table 'roundcube.session' doesn't exist (SQL Query: SELECT `vars`, `ip`, `changed`, now() AS ts, CASE WHEN `changed` < now() - INTERVAL 600 SECOND THEN 1 ELSE 0 END AS expired FROM `session` WHERE `se>
[12-Mar-2025 11:17:30 +0000]: <llkc7lsv> DB Error: [1146] Table 'roundcube.session' doesn't exist (SQL Query: INSERT INTO `session` (`sess_id`, `vars`, `ip`, `changed`) VALUES ('llkc7lsvj2kcludnkr1k0sfu6r', 'dGVtcHxiOjE7bGFuZ3VhZ2V8czo1OiJlbl9HQiI7dGFza3xzOj>

I have managed to log into the roundecube db but there are no tables in it.

SKaero

If the database is empty either run the Roundcube installer or load the <RC root>/SQL/mysql.initial.sql file into the database.

chewiesw

Great thanks , one step further.

I can now log on but I don't see any email. I can't browse to server settings either. I also can't seem to send an email from the installer.

[13-Mar-2025 12:17:23 UTC] PHP Fatal error:  Uncaught Error: Class "Mail_mime" not found in /var/www/roundcube/installer/test.php:363
Stack trace:
#0 /var/www/roundcube/installer/index.php(163): include()
#1 {main}
  thrown in /var/www/roundcube/installer/test.php on line 363



SKaero

That error sounds like you are installing Roundcube from the "Dependent" package rather then the "Complete" package. When using the dependent package you need to install the dependencies:  https://github.com/roundcube/roundcubemail/wiki/Installation#install-dependencies

chewiesw

I re-install the complete package and everything is working perfectly. Thank you SKaero.