Unable to login to Roundcube: PHP Error: Failed to create a user record.

in roundcube •  6 years ago 

Error found in error logs:

[28-Nov-2018 14:14:25 +0200]: <4d284o3h> DB Error: [1364] Field 'alias' doesn't have a default value (SQL Query: INSERT INTO users (created, last_login, username, mail_host, language) VALUES (now(), now(), '[email protected]', 'localhost', 'en_US')) in /var/www/html/roundcubemail-1.0.3/program/lib/Roundcube/rcube_db.php on line 543 (POST /?_task=login&_action=login)
[28-Nov-2018 14:14:25 +0200]: <4d284o3h> PHP Error: Failed to create new user in /var/www/html/roundcubemail-1.0.3/program/lib/Roundcube/rcube_user.php on line 686 (POST /?_task=login&_action=login)
[28-Nov-2018 14:14:25 +0200]: <4d284o3h> PHP Error: Failed to create a user record. Maybe aborted by a plugin? in /var/www/html/roundcubemail-1.0.3/program/include/rcmail.php on line 650 (POST /?_task=login&_action=login)

List from useres table in roundcube database.
MariaDB [roundcube]> describe users;
+----------------------+------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+------------------+------+-----+---------------------+----------------+
| user_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| username | varchar(128) | NO | MUL | NULL | |
| mail_host | varchar(128) | NO | | NULL | |
| alias | varchar(128) | NO | MUL | NULL | |
| created | datetime | NO | | 1000-01-01 00:00:00 | |
| last_login | datetime | YES | | NULL | |
| language | varchar(5) | YES | | NULL | |
| preferences | text | YES | | NULL | |
| failed_login | datetime | YES | | NULL | |
| failed_login_counter | int(10) unsigned | YES | | NULL | |
+----------------------+------------------+------+-----+---------------------+----------------+

Solutions: Remove alias column from users table.

Connect database:
mysql -u root -p

Use database you need to make change:
MariaDB [(none)]> use roundcube;

Alter table users;
ALTER TABLE roundcube.users DROP COLUMN roundcube.users.alias;

Now problem solved !


Posted from my blog with SteemPress : http://blog.rhce.ro/unable-to-login-to-roundcube-php-error-failed-to-create-a-user-record/

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!