Author Topic: Internal Server Errors  (Read 4789 times)

Offline Ezz

  • Jr. Member
  • **
  • Posts: 19
Internal Server Errors
« on: May 10, 2010, 12:15:57 PM »
Hello,
i will try to ask in english (sorry, my english is bad!)

I already have asked in german forum (http://www.roundcubeforum.net/43-language-specific-support/44-deutsch/6695-session-error.html) but i think its better to ask here!

My Problem:
Nearly every 2 - 3 Minutes i became an Error witch says "Internal Server Error" - then my Session is killed. (I cant access on my Mails / can't write new emails and so on...)

I have looked in logs/errors and saw this error-codes:

Quote
[10-May-2010 17:49:45] PHP Fatal error: Out of memory (allocated 28573696) (tried to allocate 35 bytes) in /homepages/32/d4********06/htdocs/**/webmailer/core/program/include/rcube_session.php on line 108
[10-May-2010 17:49:45] PHP Fatal error: Call to a member function get() on a non-object in Unknown on line 0


Someone with an idea, what i can do?

phpinfo() says there are a memory_limit of 64M  -> 28573696 bytes aren't 64M - so i have no idea what the problem is!

Thanks for help!!!

Offline Ezz

  • Jr. Member
  • **
  • Posts: 19
Internal Server Errors
« Reply #1 on: May 11, 2010, 12:26:02 PM »
nobody with an idea? :(

Offline norb

  • Newbie
  • *
  • Posts: 3
Internal Server Errors
« Reply #2 on: May 28, 2010, 08:52:56 AM »
I got exactly the same problem.

However it doesn't happen with every user, and does not happen from the start when you restart apache for example everything is fine for a while

I suppose it has something todo with the size of the users session, or what preferences are in the session. I am still debugging this.

I even increased the memory_limit to 1024MB per script and still get the same errors, such as:

[Fri May 28 14:50:20 2010] [error] [client 10.10.10.238] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 35 bytes) in /home/webmail/roundcubemail-0.4-beta/program/include/rcube_session.php on line 108, referer: http://ea.intern/r/?_task=mail&_id=820515944bffb921b9e48&_action=compose
[Fri May 28 14:50:21 2010] [error] [client 10.10.10.238] PHP Fatal error:  Call to a member function get() on a non-object in Unknown on line 0, referer: http://ea.intern/r/?_task=mail&_id=820515944bffb921b9e48&_action=compose


maybe something worth to add:
roundcube is running on debian 5.0.4 as vmware guest on vmware esx 3.5u3

Offline norb

  • Newbie
  • *
  • Posts: 3
Internal Server Errors
« Reply #3 on: May 28, 2010, 09:08:34 AM »
yes it definitely is the session length:

the session of a test user right when the error messages started to come up.

i reproduced this with memory_limit 1024. the b's just count up alot more then. now i need to find out where the b's come from ...
Code: [Select]

0|b:0;language|s:5:"de_DE";auth_time|i:1275045381;imap_root|s:5:"INBOX";imap_delimiter|s:1:".";user_id|s:2:"19";username|s:42:"test.test@ea.intern";imap_host|s:9:"localhost";imap_port|i:993;imap_ssl|s:3:"ssl";password|s:24:"l/AA+M5/uNWiz+sOwDD8xg==";login_time|i:1275045382;timezone|d:2;task|s:8:"settings";request_tokens|a:2:{s:4:"mail";s:32:"dde007eae9c68e91f82d8aa6cf79c637";s:8:"settings";s:32:"da2e0b3aeb321354ab9c62f715134341";}mbox|s:5:"INBOX";sort_col|s:0:"";sort_order|s:4:"DESC";maxuid|a:1:{s:5:"INBOX";s:1:"2";}list_columns|a:6:{i:0;s:7:"subject";i:1;s:4:"from";i:2;s:4:"date";i:3;s:4:"size";i:4;s:4:"flag";i:5;s:10:"attachment";}list_attrib|a:16:{s:4:"name";s:8:"messages";s:2:"id";s:11:"messagelist";s:11:"cellspacing";s:1:"0";s:7:"columns";s:0:"";s:7:"summary";s:12:"Message list";s:11:"messageicon";s:21:"/images/icons/dot.png";s:10:"unreadicon";s:24:"/images/icons/unread.png";s:11:"deletedicon";s:25:"/images/icons/deleted.png";s:11:"repliedicon";s:25:"/images/icons/replied.png";s:13:"forwardedicon";s:27:"/images/icons/forwarded.png";s:20:"forwardedrepliedicon";s:35:"/images/icons/forwarded_replied.png";s:14:"attachmenticon";s:28:"/images/icons/attachment.png";s:11:"flaggedicon";s:25:"/images/icons/flagged.png";s:13:"unflaggedicon";s:23:"/images/icons/blank.gif";s:18:"unreadchildrenicon";s:0:"";s:15:"optionsmenuicon";s:30:"/images/icons/columnpicker.gif";}skin_path|s:13:"skins/default";quota_display|s:5:"image";unseen_count|N;1|b:0;2|b:0;3|b:0;4|b:0;5|b:0;6|b:0;7|b:0;8|b:0;9|b:0;10|b:0;11|b:0;12|b:0;13|b:0;14|b:0;15|b:0;16|b:0;17|b:0;18|b:0;19|b:0;20|b:0;21|b:0;22|b:0;23|b:0;24|b:0;25|b:0;26|b:0;27|b:0;28|b:0;29|b:0;30|b:0;31|b:0;32|b:0;33|b:0;34|b:0;35|b:0;36|b:0;37|b:0;38|b:0;39|b:0;40|b:0;41|b:0;42|b:0;43|b:0;44|b:0;45|b:0;46|b:0;47|b:0;48|b:0;49|b:0;50|b:0;51|b:0;52|b:0;53|b:0;54|b:0;55|b:0;56|b:0;57|b:0;58|b:0;59|b:0;60|b:0;61|b:0;62|b:0;63|b:0;64|b:0;65|b:0;66|b:0;67|b:0;68|b:0;69|b:0;70|b:0;71|b:0;72|b:0;73|b:0;74|b:0;75|b:0;76|b:0;77|b:0;78|b:0;79|b:0;80|b:0;81|b:0;82|b:0;83|b:0;84|b:0;85|b:0;86|b:0;87|b:0;88|b:0;89|b:0;90|b:0;91|b:0;92|b:0;93|b:0;94|b:0;95|b:0;96|b:0;97|b:0;98|b:0;99|b:0;100|b:0;101|b:0;102|b:0;103|b:0;104|b:0;105|b:0;106|b:0;107|b:0;108|b:0;109|b:0;110|b:0;111|b:0;112|b:0;113|b:0;114|b:0;115|b:0;116|b:0;117|b:0;118|b:0;119|b:0;120|b:0;121|b:0;122|b:0;123|b:0;124|b:0;125|b:0;126|b:0;127|b:0;128|b:0;129|b:0;130|b:0;131|b:0;132|b:0;133|b:0;134|b:0;135|b:0;136|b:0;137|b:0;138|b:0;139|b:0;140|b:0;141|b:0;142|b:0;143|b:0;144|b:0;145|b:0;146|b:0;147|b:0;148|b:0;149|b:0;150|b:0;151|b:0;152|b:0;153|b:0;154|b:0;155|b:0;156|b:0;157|b:0;158|b:0;159|b:0;160|b:0;161|b:0;162|b:0;163|b:0;164|b:0;165|b:0;166|b:0;167|b:0;168|b:0;169|b:0;170|b:0;171|b:0;172|b:0;173|b:0;174|b:0;175|b:0;176|b:0;177|b:0;178|b:0;179|b:0;180|b:0;181|b:0;182|b:0;183|b:0;184|b:0;185|b:0;186|b:0;187|b:0;188|b:0;189|b:0;190|b:0;191|b:0;192|b:0;193|b:0;194|b:0;195|b:0;196|b:0;197|b:0;198|b:0;199|b:0;200|b:0;201|b:0;202|b:0;203|b:0;204|b:0;205|b:0;206|b:0;207|b:0;208|b:0;209|b:0;210|b:0;211|b:0;212|b:0;213|b:0;214|b:0;215|b:0;216|b:0;217|b:0;218|b:0;219|b:0;220|b:0;221|b:0;222|b:0;223|b:0;224|b:0;225|b:0;226|b:0;227|b:0;228|b:0;229|b:0;230|b:0;231|b:0;232|b:0;233|b:0;234|b:0;235|b:0;236|b:0;237|b:0;238|b:0;239|b:0;240|b:0;241|b:0;242|b:0;243|b:0;244|b:0;245|b:0;246|b:0;247|b:0;248|b:0;249|b:0;250|b:0;251|b:0;252|b:0;253|b:0;254|b:0;255|b:0;

Offline norb

  • Newbie
  • *
  • Posts: 3
Internal Server Errors
« Reply #4 on: June 01, 2010, 08:32:04 AM »
hmm i thought some developer would at least look at this issue ...

but anyway, today i had some time to debug this ..

as stated before it comes down to rcube_session.php
but the culprit is actually the used array_merge.

php manual says for array_merge: http://uk.php.net/array_merge
Quote
If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. If, however, the arrays contain numeric keys, the later value will not  overwrite the original value, but will be appended.

If all of the arrays contain only numeric keys, the resulting array is given incrementing keys starting from zero.

for some reason rcube creates empty array items (such as array(1=>,2=>,3=>);) in the session when the user accesses lists. (that's what it seems like at least) and array_merge duplicates these empty array items until there is no memory left :)

my easy solution was to replace the following:
./program/include/rcube_session.php
around line 108:
replace
Code: [Select]
     $newvars = $this->serialize(array_merge(
        (array)$a_oldvars, (array)$this->unserialize($vars)));
with
Code: [Select]
$newvars = $this->serialize( (array)((array)$a_oldvars+(array)$this->unserialize($vars)) );

no more duplication in the session spares the memory and the user can actually use the webmail.
« Last Edit: June 01, 2010, 08:41:01 AM by norb »