Upgraded to 11.30.0, now roundcube saying "session expired or is invalid"

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
As above, I tried clearing my cookies, new browser, bouncing Exim but nothing helps.

I get as far as the cpanel webmail login, then enter my credentials and it dumps me at a roundcube login with the session expired or is invalid message.

Any ideas? Thanks in advance.

Jim
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
Hello Jim :)

Could you check the Roundcube error log to determine if any specific error messages are logged when this problem occurs? It can be found at:

Code:
/var/cpanel/roundcube/log/errors
Thank you.
 

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
Just to confirm this is not a user issue, I have tried several users on several different domains on this server. Nobody can login to webmail.

I have also gone to the office now to check if I can login from there. No luck.

Any ideas guys, my customers will be trying to login around now so my phone is going to run hot pretty soon.

Correction: error is "session is invalid or has expired"
 
Last edited:

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
Just in case anyone else has this problem, support sorted it out for me. The short version is they increased the "session_lifetime" of roundcube. Apparently this wouldn't have happened if roundcube was using SQLite (it is now).

If anyone needs the details please let me know, or raise a support call. I'm no expert on these things so I don't want to give wrong advice on here. Maybe a cPanel tech might like to clarify the solution :D
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
After getting this problem on a number of cPanel servers running 11.30, I attempted to take the suggestion of upgrading to SQLite, however the conversion script (/scripts/convert_roundcube_mysql2sqlite) fails with:

Code:
File does not exist: /home/user/tmp/roundcube_convert/[email protected]/rcube.contactgroupmembers.xml at /scripts/convert_roundcube_mysql2sqlite line 362
Going to submit a ticket and see where that goes. It's looking like this will be my third 11.30 bug report of the day. :)
 

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
Garretp, that was exactly the same error I got and they populated the contactgroup table and that fixed it. I guess you could log into the webmail and add a contact group that way and it should have the same effect? Bit concerning I thought but the tech assures me it's nothing to worry about.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Specifically, this was performed to correct the issue on the prior ticket:

Code:
vi /usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php
Then changing:

Code:
$rcmail_config['session_lifetime'] = 10;
To something along the lines of 30 or 50. The value cannot be higher than 60 due to this setting:

Code:
// Minimal value of user's 'keep_alive' setting (in seconds)
// Must be less than 'session_lifetime'
$rcmail_config['min_keep_alive'] = 60;
Also, when opening up a ticket based on a forum thread, it is great if the forum thread can be referenced in the ticket. I just got the new ticket (1562010) and had to find this forum thread accidentally while reading the forums at the same time.
 

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
That fix was for the original issue, not the failure of the conversion script that was just reported.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
The fix is the one that most people would use rather than converting to SQLite. The way to fix the conversion script was already also reported in this thread in your reply, while the steps I noted specifically were not. This is in reply to the ticket (1562010) that was opened specifically about the issue, since this thread never provided the exact steps on what line to fix in which specific file for the session_lifetime for Roundcube users running MySQL

Of note, I wouldn't suggest mass updating to SQLite for all users for Roundcube as the best course of action. This should only be performed if necessary. The default for Roundcube is currently MySQL rather than SQLite.
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
Tristan,

No such luck; I hit you back on the ticket.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello garrettp,

The issue actually tracked down to MySQL reporting the incorrect system time versus the server's system time. I simply restarted MySQL and the time issue resolved. Here was how I obtained the system time versus MySQL time:

Code:
[email protected] [/]# date
Wed Jun  1 16:58:06 PDT 2011

[email protected] [/]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 141245
Server version: 5.0.92-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2011-06-01 19:58:14 | 
+---------------------+
1 row in set (0.00 sec)
After restarting MySQL, the "select now();" command in MySQL command line worked to show the right time. At that point, Roundcube began working.
 

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
Of note, I wouldn't suggest mass updating to SQLite for all users for Roundcube as the best course of action. This should only be performed if necessary. The default for Roundcube is currently MySQL rather than SQLite.
I would not have done it if it wasn't recommended to me in the ticket. What are the down-sides to doing it (too late now, but good to know what problems I could be facing). Also, if I migrate someone off cpanel where roundcube is on MySQL and put them on my server, would that cause a problem?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
The biggest downside to changing to SQLite is that there is no longer a shared MySQL database that can be managed using PhpMyAdmin or MySQL command line. We do not have any client to manage SQLite in a GUI interface and each user's SQLite file is separate from every other users. This does help, on the other hand, to keep all user data from corrupting due to one user's Roundcube database files being corrupted. It is just far harder to correct issues that do crop up upon the conversion due to the limit of a good utility to manage SQLite. A pro for SQLite is that it has lower usage for memory than MySQL for Roundcube, so the load is reduced on a server with a lot of accounts using Roundcube.

If you migrate someone from a MySQL-based Roundcube to your server with SQLite Roundcube, then the account should convert to SQLite automatically on the transfer.
 

sp3ctre69

Well-Known Member
Aug 14, 2006
107
5
168
The biggest downside to changing to SQLite is that there is no longer a shared MySQL database that can be managed using PhpMyAdmin or MySQL command line. We do not have any client to manage SQLite in a GUI interface and each user's SQLite file is separate from every other users. This does help, on the other hand, to keep all user data from corrupting due to one user's Roundcube database files being corrupted. It is just far harder to correct issues that do crop up upon the conversion due to the limit of a good utility to manage SQLite. A pro for SQLite is that it has lower usage for memory than MySQL for Roundcube, so the load is reduced on a server with a lot of accounts using Roundcube.

If you migrate someone from a MySQL-based Roundcube to your server with SQLite Roundcube, then the account should convert to SQLite automatically on the transfer.
Thanks for clearing that up. I know there are SQLite GUI's but I'm not sure how you would use them to connect remotely. Sounds like in hindsight I shouldn't have done the conversion but at least I know what I am dealing with now should I ever run into trouble.

Thanks again,

Jim
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
Thanks for that.

Not as big of an issue, but it would seem the the script to convert Roundcube from MySQL to SQLite still has the problem mentioned previously.
 

shenzy

Well-Known Member
Apr 27, 2008
83
29
68
Chile
cPanel Access Level
Root Administrator
Thanks!, this solution work fine for me.

Hello garrettp,

The issue actually tracked down to MySQL reporting the incorrect system time versus the server's system time. I simply restarted MySQL and the time issue resolved. Here was how I obtained the system time versus MySQL time:

Code:
[email protected] [/]# date
Wed Jun  1 16:58:06 PDT 2011

[email protected] [/]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 141245
Server version: 5.0.92-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2011-06-01 19:58:14 | 
+---------------------+
1 row in set (0.00 sec)
After restarting MySQL, the "select now();" command in MySQL command line worked to show the right time. At that point, Roundcube began working.
 

thurmma

Member
Nov 3, 2003
11
0
151
Hello garrettp,

The issue actually tracked down to MySQL reporting the incorrect system time versus the server's system time. I simply restarted MySQL and the time issue resolved. Here was how I obtained the system time versus MySQL time:

Code:
[email protected] [/]# date
Wed Jun  1 16:58:06 PDT 2011

[email protected] [/]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 141245
Server version: 5.0.92-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2011-06-01 19:58:14 | 
+---------------------+
1 row in set (0.00 sec)
After restarting MySQL, the "select now();" command in MySQL command line worked to show the right time. At that point, Roundcube began working.
Thank you very much for this tip! Resolved all of my issues with Roundcube.
 

asuservice

Well-Known Member
Oct 24, 2001
83
0
306
Re: Upgraded to 11.30.0, now roundcube saying "session expired or is invali

I know this is an older thread but thought I'd comment that I had the same issue and just restarting MySQL took care of it.