Ispmanager roundcube database error connection failed

Добрый день, установил roundcube (http://vir2oz.net/products/roundcube) DATABASE ERROR: CONNECTION FAILED! Unable to connect to the database! Please contact your server-administrator. Установил sqlite # php -m | grep sqlite
  1. 31.08.2012, 17:30


    #1

    lim вне форума


    Senior Member


    Регистрация
    26.02.2011
    Сообщений
    424

    По умолчанию roundcube

    Добрый день, установил roundcube (http://vir2oz.net/products/roundcube)

    DATABASE ERROR: CONNECTION FAILED!

    Unable to connect to the database!
    Please contact your server-administrator.

    Установил sqlite

    [root@vds /]# php -m | grep sqlite
    pdo_sqlite
    sqlite

    Но теперь вместо ошибки DATABASE ERROR , выходит пустая страница
    Прописано в /usr/local/ispmgr/addon/roundcube/config/db.inc.php

    Код:

    $rcmail_config['db_dsnw'] = 'sqlite:///usr/local/ispmgr/addon/roundcube/SQL/roundcube.db?mode=0646'

    логи в nginx

    Код:

    ip - - [31/Aug/2012:12:27:45 +0400] "GET /roundcube/ HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1" "-"
    ip - - [31/Aug/2012:12:27:46 +0400] "GET /favicon.ico HTTP/1.1" 404 286 "-" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.83 Safari/537.1" "-"


  2. 31.08.2012, 21:28


    #2

    Dobrolink вне форума


    Senior Member

    Аватар для Dobrolink


    Регистрация
    11.01.2012
    Сообщений
    122

    По умолчанию

    По идее должен стоять еще пакет libsqlite.
    Логи nginx ни о чем не скажут. Показывайте логи самого RC.

    Debian 6.0.5
    ISPmanager-Pro 4.4.8
    apache2-itk+nginx1.2.3
    postfix+dovecot
    ——————
    FreeBSD 9.0
    BILLmanager-Corporate 4.0.66


  3. 31.08.2012, 23:27


    #3

    ls вне форума


    ISPsystem team

    Аватар для ls


    Регистрация
    12.03.2007
    Сообщений
    10,471

    По умолчанию

    лог ошибок apache посмотрите, проверьте создался ли /usr/local/ispmgr/addon/roundcube/SQL/roundcube.db — скорее всего нет (нет прав у вебсервера на /usr/local/ispmgr/addon/roundcube/SQL


  4. 31.08.2012, 23:45


    #4

    lim вне форума


    Senior Member


    Регистрация
    26.02.2011
    Сообщений
    424

    По умолчанию

    Цитата Сообщение от ls
    Посмотреть сообщение

    лог ошибок apache посмотрите, проверьте создался ли /usr/local/ispmgr/addon/roundcube/SQL/roundcube.db — скорее всего нет (нет прав у вебсервера на /usr/local/ispmgr/addon/roundcube/SQL

    Файл существует, в логах апач нечего нет.
    Поменял владельца, страничка появилась и опять
    DATABASE ERROR: CONNECTION FAILED!


  5. 31.08.2012, 23:46


    #5

    lim вне форума


    Senior Member


    Регистрация
    26.02.2011
    Сообщений
    424

    По умолчанию

    Цитата Сообщение от Dobrolink
    Посмотреть сообщение

    По идее должен стоять еще пакет libsqlite.
    Логи nginx ни о чем не скажут. Показывайте логи самого RC.

    В centos как пакет называется?


Недавно, столкнулся с проблемой в roundcube «DATABASE ERROR: CONNECTION FAILED! «, начал гуглить, но толкового не было ничего. В общем, я нашел материал и сохраню ее для дальнейшего использования. В своей статье «DATABASE ERROR: CONNECTION FAILED! в roundcube» расскажу как исправить данную проблему.

Первый шагом, пробуем просто обновить roundcube из под скриптов Cpanel на самом сервере, а можно это сделать так:

# /usr/local/cpanel/bin/update-roundcube

Это принудительное обновление roundcube со скрипта cpanel.

Если простое обновление не помогло, то идем дальше и следующим действием, я переименую базу самого roundcube (дабы не удалять ее) и после чего выполню повторное обновление:

# mv /var/lib/mysql/roundcube /root/roundcube.bak

Снова выполняем обновление:

# /usr/local/cpanel/bin/update-roundcube --force

При попытки обновить roundcube, получил следующую ошибку:

Archiving current Roundcube data to /var/cpanel/roundcube/roundcube.backup.sql
mysqldump: Got error: 144: Table './roundcube/contacts' is marked as crashed and last (automatic?) repair failed when using 

LOCK TABLES
Failed to backup existing Roundcube DB. DB likely did not exist.Cleaning old Roundcube data archives

Ну что, теперь открываем логи. Roundcube хранит логи в определенном месте на серверах с CPanel, вы можете открыть их:

# tail -f /var/cpanel/roundcube/log/errors

Вы можете повторить этот процесс и посмотреть какая выводится ошибка.  В моем случае я нашел эту ошибку несколько раз:

DB Error: [144] Table './roundcube/contacts' is marked as crashed and last (automatic?) repair failed (SQL Query: SELECT * FROM contacts AS c WHERE c.del<>1 AND

Выход из журнала ошибок и точка прямо установщику, что вызывает проблемы с добавлением контакта в адресной книге. В любом случае, исправление легко и все, что нужно сделать, это восстановить базу данных.

Чтобы запустить восстановление таблицы «Contacts» в базе данных Roundcube, запустите эту команду:

$ cd /var/lib
$ sudo -u mysql myisamchk -r -v -f mysql/roundcube/contacts

Теперь, когда я отремонтировал БД, я попробую запустить обновление еще раз:

# /usr/local/cpanel/bin/update-roundcube --force

Вот и все, у меня все заработало.

Проверяем запущена ли сервер с базами данных:

# ps -aux | grep mysql

Если что, стартуем/перезапускаем его:

# service mysql stop
# service mysql start

или

# service mysql restart

Проверяем есть ли таблицы или сама БД roundcube:

# mysql -uroot -p
> show database;
> use roundcube;
> show tables;

Если пусто, то читаем мою статью:
Восстановить базу данных в Roundcube

А на этому все, тема «DATABASE ERROR: CONNECTION FAILED! в roundcube» завершена.

I just installed the RoundCube php mail client. I check the MySQL database and the new table was created, but through browser I’m getting the following error:

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.

I check the debian-db.php and the login parameters are correct, I also tried through terminal and I can connect to the db using this parameter

$dbuser='roundcube';
$dbpass='mypass';
$basepath='';
$dbname='roundcube';
$dbserver='';
$dbport='';
$dbtype='mysql';

asked Oct 11, 2011 at 15:15

Mokus's user avatar

6

I check the error log and there is the following error:DB Error:
unable to find package ‘MDB2_Driver_mysql’ file
‘MDB2/Driver/mysql.php’, How can I fix this?

apt-get install php-pear
pear install MDB2_Driver_mysql

answered Oct 11, 2011 at 16:45

quanta's user avatar

quantaquanta

50.9k19 gold badges157 silver badges217 bronze badges

1

It seemingly being an Ubuntu system you can also install the driver directly using apt-get.

$ sudo apt-get install php-mdb2-driver-mysql

(The package has been a part of Ubuntu since 10.04.)

answered Oct 11, 2011 at 17:27

andol's user avatar

andolandol

6,85828 silver badges43 bronze badges

1) Enable mysql logging and see whether it is generating any relavent info.

2) Make sure that sql safe mode is not enabled in php

3) Enable sql trace mode in php.ini and see whether it is generating any additional debug info which might be useful.

answered Oct 11, 2011 at 16:46

SparX's user avatar

SparXSparX

1,92412 silver badges10 bronze badges

I’ve just had this error and the change from localhost to 127.0.0.1 fixed it for me!

mysql://roundcube:mypass@127.0.0.1/roundcubemail is now working

answered Jan 24, 2013 at 3:08

Peter Russell's user avatar

Database connection errors happens when the followings happens:

  1. You don’t have proper database info set up in the configuration file (config/db.inc.php)
  2. Your system don’t have the requirements needed to run roundcube.

To solve the first problem, you need to configure the following parameter correctly

$rcmail_config['db_dsnw'] = '{db_provider}://{username}:{password}@{host}/{database}';
  • {db_provider} is database agent such as mysql, mysqli, sqlite etc
  • {username} is your username to the database
  • {password} is your password to the database
  • {host} is either localhost or some host parameter for the location of your database server
  • {database} is your database name, by default it is roundcubemail

Example:

$rcmail_config['db_dsnw'] = 'mysql://myuser:mypassword@localhost/roundcubemail';

To solve the second problem, you need to run the installer to verify your system. Please remove installer/folder once you have done the installation.

To run the test: go to {roundcube_domain}/installer/index.php.

And you will see all the requirements needed to run roundcube. Follow the instruction, you will be running roundcube in no time.

sebix's user avatar

sebix

4,2632 gold badges26 silver badges45 bronze badges

answered Feb 3, 2012 at 15:33

zhi's user avatar

Maybe set $dbserver=''; to $dbserver='localhost'; instead of leaving it blank.

jscott's user avatar

jscott

24.3k8 gold badges78 silver badges99 bronze badges

answered Oct 11, 2011 at 16:12

Matt's user avatar

MattMatt

834 bronze badges

1

I my case, it could not resolve localhost, hence simply changing it to 127.0.0.1 fixed the issue. (I am using Mountain Lion.)

HopelessN00b's user avatar

HopelessN00b

53.6k32 gold badges134 silver badges208 bronze badges

answered Sep 12, 2012 at 22:59

StartupGuy's user avatar

StartupGuyStartupGuy

2302 silver badges6 bronze badges

I had the same issue. This may help someone. Mine was installed using webmin

go to roundcube install location. usually it’s like

/home/domain/public_html/roundcube

open config.inc.php in /home/domain/public_html/roundcube/config

find the line like

$config['db_dsnw'] = 'mysql://mysqluser:password@localhost/database';

either change password here or change the password for user name mysqluser

Gerald Schneider's user avatar

answered May 22, 2022 at 23:03

Nuwinda's user avatar

godneyjeansus

Posts: 3
Joined: Wed Feb 11, 2015 2:57 pm

[SOLVED] RoundCube: DATABASE ERROR: CONNECTION FAILED!

Hello there. So it’s my first post here. I decided to make an account here cuz I cant find any solution out there regarding my problem.

My server runs Ubuntu 14.04. Btw, I use the free trial Amazon EC2.

I wanted to create an mail account: info@mydomain.com from the VESTA CP

After that I tried to open the webmail but then I saw this error message:

Code: Select all

DATABASE ERROR: CONNECTION FAILED!

Unable to connect to the database!
Please contact your server-administrator.

I then checked the error log:

Code: Select all


[11-Feb-2015 14:55:44 +0000]: DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /webmail/)
[11-Feb-2015 14:55:47 +0000]: DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) in /usr/share/roundcube/program/lib/Roundcube/rcube_db.php on line 155 (GET /webmail/)
[11-Feb-2015 14:55:47 +0000]: DB Error: SQLSTATE[28000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /webmail/)

I don’t know how to solve this problem. Please help me.

Last edited by godneyjeansus on Thu Feb 12, 2015 5:20 pm, edited 1 time in total.


skurudo

VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:

Re: RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by skurudo » Thu Feb 12, 2015 10:27 am

I know man ;-)
You need to check password for user roundcube or change it.


skurudo

VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:

Re: RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by skurudo » Thu Feb 12, 2015 10:29 am

Here:
/etc/roundcube/debian-db.php
$dbpass= …

And there:
/var/lib/roundcube/config/db.inc.php
$rcmail_config[‘db_dsnw’] = …


godneyjeansus

Posts: 3
Joined: Wed Feb 11, 2015 2:57 pm

Re: RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by godneyjeansus » Thu Feb 12, 2015 2:31 pm

skurudo wrote:Here:
/etc/roundcube/debian-db.php
$dbpass= …

And there:
/var/lib/roundcube/config/db.inc.php
$rcmail_config[‘db_dsnw’] = …

HI there, thanks for the reply. Unfortunately I don’t know the password of the user roundcube. Do you know how can I get the password from user roundcube?

By the way, because I don’t know the password of this user roundcube. I decided to make a new user named admin_roundcube and also a new database named admin_roundcube

Then I changed /var/lib/roundcube/config/db.inc.php and /etc/roundcube/debian-db.php with new user and database.
But it doesnt solve my problem. Later I got this message:

Code: Select all


[12-Feb-2015 14:27:56 +0000]: DB Error: [1146] Table 'admin_roundcube.session' doesn't exist (SQL Query: SELECT vars, ip, changed FROM session WHERE sess_id = 'ae8dkd4rs70ld5mm2irebu1v41') in /usr/share/roundcube/program/lib/Roundcube/rcube_db.php on line 417 (GET /webmail/)
[12-Feb-2015 14:27:56 +0000]: DB Error: [1146] Table 'admin_roundcube.session' doesn't exist (GET /webmail/)
[12-Feb-2015 14:27:56 +0000]: DB Error: [1146] Table 'admin_roundcube.session' doesn't exist (SQL Query: INSERT INTO session (sess_id, vars, ip, created, changed) VALUES ('ae8dkd4rs70ld5mm2irebu1v41', 'dGVtcHxiOjE7bGFuZ3VhZ2V8czo1OiJlbl9VUyI7dGFza3xzOjU6ImxvZ2luIjs=', '172.31.44.1', '2015-02-12 14:27:56', '2015-02-12 14:27:56')) in /usr/share/roundcube/program/lib/Roundcube/rcube_db.php on line 417 (GET /webmail/)


godneyjeansus

Posts: 3
Joined: Wed Feb 11, 2015 2:57 pm

Re: RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by godneyjeansus » Thu Feb 12, 2015 5:20 pm

Hi, guys. I finally solved it. Here are the steps that I’ve done

1. Log in to PhpMyAdmin
2. Create database named roundcube and user named roundcube MANUALLY
3. Go to localhost —> roundcube (database) —> SQL
4. and pasted this code: http://trac.roundcube.net/browser/githu … a833535cd4 and run it
5. edit /etc/roundcube/db.inc.php, debian-db.php and /var/lib/roundcube/config/db.inc.php with new password (I also replaced localhost with 127.0.0.1
6. Create an email account. Eg. info@maindomain.com
7. Open webmail. Log in. DONE


skurudo

VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:

Re: [SOLVED] RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by skurudo » Thu Feb 12, 2015 5:23 pm

So long way. But you made it! Good.

You needed only change password for user roundcube, if you don’t have it and then change configs above.


mehargags

Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Os: Debian 8x
Web: apache + nginx
Re: [SOLVED] RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by mehargags » Wed Apr 01, 2015 10:02 am

Well, I noticed the same bug on Debian and Today on Ubuntu 14.04 fresh install.

Infact, Roundcube Databse doesn’t even exist after my VestaCP install.

on CentOS the Vesta installer install everything fine, but not on Ubuntu and Debian


zorrobyte

Posts: 7
Joined: Sun Apr 26, 2015 2:34 pm

Re: [SOLVED] RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by zorrobyte » Sun May 24, 2015 1:39 pm

Same, no Roundcube database on fresh install 14.04


skurudo

VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:

Re: [SOLVED] RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by skurudo » Sun May 24, 2015 5:41 pm

mehargags wrote:
on CentOS the Vesta installer install everything fine, but not on Ubuntu and Debian

I make many installation on Debian and don’t see a problem, I think it’s repository based problem, guys.


KeiroD

Posts: 61
Joined: Fri Oct 11, 2013 8:35 pm

Re: [SOLVED] RoundCube: DATABASE ERROR: CONNECTION FAILED!

Post

by KeiroD » Mon Jun 08, 2015 7:51 pm

skurudo wrote:

mehargags wrote:
on CentOS the Vesta installer install everything fine, but not on Ubuntu and Debian

I make many installation on Debian and don’t see a problem, I think it’s repository based problem, guys.

The problem exists on Ubuntu as well. Methinks something somewhere is not working properly because I can consistently reproduce this issue.



Sometimes, we experience different errors while logging into an email account. One of such error message is ‘Database Error: CONNECTION FAILED‘ in Roundcube.

This error is mainly based on the database trouble in the server. Also, it mainly shows while trying to log in to Roundcube. Any updates made in the DirectAdmin can also end up with these errors.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix Roundcube related errors.

In this context, we shall look into the main causes and fixes to Database error in Roundcube DirectAdmin.

Causes of Database Error: CONNECTION FAILED in RoundCube and how we fix it?

Roundcube is a popularly used webmail client that is written in PHP. And all the data of Roundcube is stored in a database.

Basically, the database plays a major role in Roundcube’s functionality. It is very necessary for the database to be up and running well.

Here, we will see different methods to fix the error related to RoundCube in DirectAdmin.

1. Empty database

Recently, one of our customers approached us with a Roundcube error.  He received the below error message while logging into Roundcube:

DATABASE ERROR: CONNECTION FAILED!
Unable to connect to the database!
Please contact your server-administrator.

Our Support Experts started to troubleshoot the error by checking the database. The database was available in the account. But there were no tables within it. So, we deleted the database using the command:

drop database database_name

Then, we ran the below command for the re-working of the RoundCube  webmail client:

./build roundcube

Finally, this fixed the error message.

2. Database doesn’t exist

Sometimes, the database itself goes missing in some accounts which don’t allow the RoundCube to work.

Here is an example where our customer experienced the same error message:

DATABASE ERROR: CONNECTION FAILED!

We investigated this error and found that the database was not existing in the account.

Also, the database was not present in /var/lib/mysql path. So we ran the build script provided below to fix this error.

./build roundcube

3. MySQL functions missing in php.ini

RoundCube is open-source software written in PHP. There can be cases where few functions in the php.ini file will not be set by default.

So, the error will resolve if we set those PHP functions properly. One of our customers was experiencing the same error.

Our Support Experts found that pdo_mysql.default_socket was not set in the php.ini file.

We, enabled pdo_mysql.default_socket by pointing it to /tmp/mysql.sock. Then, we restarted the php-fpm and this solved the problem.

[Need urgent assistance with RoundCube errors in DirectAdmin? – We’ll help you. ]

Понравилась статья? Поделить с друзьями:
  • Ispconfig internal server error
  • Isp service error
  • Isp blocking ошибка 202 на телевизоре самсунг
  • Isofast c35e a коды ошибок
  • Iso ошибка проверки подписи драйвера