Author Topic: 500 Server Error for some users after working fine for a day.  (Read 13492 times)

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« on: December 02, 2009, 07:21:01 AM »
I am using RoundCube 0.3.1 as a client for Gmail on my Fedora 11 box w/ Apache 2.2.13, PHP 5.2.11 and Mysql 5.1.37.

It works great for most users but not for my personal account.

Essentially, some time (overnight) following the creation of me as a user on RoundCube I can no longer login and the connection times-out with the following message after I enter my user/pass:

500 Server Error
The following error occurred: [code=SERVER_RESPONSE_CLOSE] The server closed the connection while reading the response. Contact your system administrator.
Could not open error file

No errors appear in the Apache or RoundCube logs. But an entry in the Session table is successfully created.

If i edit the database entries for my user and then re-login (thereby creating another new user) it works fine until the next day when the problem repeats itself.

I can fix this, by making RoudCube treat me as a new user every day (in which case I can log in as usual immediately) but would prefer a real solution!

This happens with caching enabled or disabled.

Any help would be appreciated, happy to post config files if you think it would help (my PHP.ini execution timeout is currently 600s so its not that!).

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #1 on: December 02, 2009, 07:24:07 AM »
Is the RoundCube logs directory writable?

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #2 on: December 02, 2009, 07:48:16 AM »
Hi Skaero,

Yes the log files are writeable - they contains various unrelated entries. I was logging IMAP for a while but nothing seemed to be out of the ordinary, successful logins from Gimap e.t.c. but RoundCube would still timeout.

Forgot to mention, mysql is on local machine, IMAP is obviously remote. But given that ti works fine for other users, I can't think its a problem with connectivity or delayed connections.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #3 on: December 02, 2009, 07:55:06 AM »
It sound like this problem: http://www.roundcubeforum.net/pending-issues/5431-gmail-roundcube-dreamhost-internal-server-error.html
Try with that latest SVN and see if it works.

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #4 on: December 02, 2009, 08:00:55 AM »
Sounds about right, let me give it a go, I'll report back.

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #5 on: December 02, 2009, 08:18:44 AM »
Upgraded to Version 0.3-20090814 using UPGRADING instructions and same symptoms :(

The update.sh says "This instance of RoundCube is up-to-date." after I re-ran the installer.

Seems strange that when I am a new user it works fine for a day...

Is it worth me trying a fresh copy of the SVN (i.e. not upgrading?)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #6 on: December 02, 2009, 08:29:11 AM »
I'd try a fresh install of the SVN the version you where using 8-14-2009 is older that RoundCube 3.1 witch was released 10-31-2009

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #7 on: December 02, 2009, 08:31:10 AM »
That is the current version in the trunk according to the top of the index.php file:

> head /var/www/html/trunk/roundcubemail/index.php
/*
 +-------------------------------------------------------------------------+
 | RoundCube Webmail IMAP Client                                           |
 | Version 0.3-20090814                                                    |

I will try a fresh install but have a feeling it'll work to start with, and I'll be back tomorrow when it starts timing out again :)

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #8 on: December 02, 2009, 08:37:06 AM »
Ah sorry I forgot ticket 1484766 #1484766 (Version tag incorrect) ? Roundcube Webmail BTW how many emails do you have on the account that your trying to login to?

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #9 on: December 02, 2009, 08:45:18 AM »
ahah :)

17,919 emails in total... obviously split among several folders. But if it was the number of emails, surely it wouldn't work at all as opposed to working for a day then having a brain fart?

So far so good on the fresh SVN install and new database. I'll let you know if it starts timing out again tomorrow. Trying preview pane - nice feature.

Thanks for the help!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #10 on: December 02, 2009, 08:53:50 AM »
True, let me know if it starts timing out again.

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #11 on: December 03, 2009, 04:44:31 AM »
Bad news I'm afraid SKaero - its timing out again today...

Any ideas?

TIA

[edit] please feel free to move this to SVN forum (although the problem does exist in SVN and stable builds) [/edit]
« Last Edit: December 03, 2009, 07:57:04 AM by no1knows »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #12 on: December 03, 2009, 08:24:42 AM »
You said that when you delete the user in the database it goes away so its most likely something in the database. Does it work if you clear the session table?

Offline no1knows

  • Jr. Member
  • **
  • Posts: 23
500 Server Error for some users after working fine for a day.
« Reply #13 on: December 03, 2009, 08:54:22 AM »
clearing session table does not help. If I modify the old user's email address and then login (thereby creating a new username as none match the email address) it works fine for the day...

Do you think it might be a cron job amending the database or something? I'll keep trying to find out at what point it stops working.

Would there be anyway to get a log entry out of it as to what is causing the timeout?

[edit] just tried it on your server (http://mail.skaero.com/), no luck, get the same error (would you mind checking your logs?) [/edit]
« Last Edit: December 03, 2009, 09:43:16 AM by no1knows »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
500 Server Error for some users after working fine for a day.
« Reply #14 on: December 03, 2009, 09:57:24 AM »
I have logs! It looks to be a cache error, have you tried clearing the cache table?
Code: [Select]

[03-Dec-2009 08:45:13 -0600]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_66210accae1f73d927aef0aa41d895f58d102a120 FROM 'SELECT idx, uid\n       FROM messages\n       WHERE  user_id=?\n       AND    cache_key=?\n       ORDER BY `idx` ASC']
[Native code: 2006]
[Native message: MySQL server has gone away]
 in /home/skaeroco/mail.skaero.com/program/include/rcube_mdb2.php on line 269 (GET /?_task=mail)
[03-Dec-2009 08:45:13] MDB2 Error: unknown error (-1): _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_7048eb189dd6d6bc46074370ecc06884b70285e92 FROM 'SELECT cache_id\n         FROM cache\n         WHERE  user_id=?\n         AND    cache_key=?']
[Native code: 2006]
[Native message: MySQL server has gone away]

[03-Dec-2009 08:45:13 -0600]: DB Error: _doQuery: [Error message: Could not execute statement]
[Last executed query: PREPARE mdb2_statement_mysql_7048eb189dd6d6bc46074370ecc06884b70285e92 FROM 'SELECT cache_id\n         FROM cache\n         WHERE  user_id=?\n         AND    cache_key=?']
[Native code: 2006]
[Native message: MySQL server has gone away]
 in /home/skaeroco/mail.skaero.com/program/include/rcube_mdb2.php on line 269 (GET /?_task=mail)
[03-Dec-2009 08:45:13] MDB2 Error: unknown error (-1): connect: [Error message: Could not select the database: skaeroco_mail]
[Last executed query: PREPARE mdb2_statement_mysql_7048eb189dd6d6bc46074370ecc06884b70285e92 FROM 'SELECT cache_id\n         FROM cache\n         WHERE  user_id=?\n         AND    cache_key=?']
[Native code: 2006]
[Native message: MySQL server has gone away]

[03-Dec-2009 08:45:13 -0600]: DB Error: connect: [Error message: Could not select the database: skaeroco_mail]
[Last executed query: PREPARE mdb2_statement_mysql_7048eb189dd6d6bc46074370ecc06884b70285e92 FROM 'SELECT cache_id\n         FROM cache\n         WHERE  user_id=?\n         AND    cache_key=?']
[Native code: 2006]
[Native message: MySQL server has gone away]
 in /home/skaeroco/mail.skaero.com/program/include/rcube_mdb2.php on line 269 (GET /?_task=mail)