Page 1 of 1

java.net.SocketException: Too many open files

Posted: Wed Feb 21, 2007 9:31 am
by pharoh
as the subject states we are getting this error in our catalina.out log, here is the actual log snippet:

Code: Select all

 java.net.SocketException: Too many open files
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(Unknown Source)
        at java.net.ServerSocket.implAccept(Unknown Source)
        at java.net.ServerSocket.accept(Unknown Source)
        at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:293)
        at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:647)
        at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:857)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Unknown Source)
Feb 21, 2007 7:30:36 AM org.apache.catalina.core.ApplicationContext log
INFO: ip: 10.1.1.44; username: email@domain.tld; message: <SOAP-ENV:Fault><faultcode>SOAP-ENV:CLIENT.ProblemConnectingToImap</faultcode><faultstring>There was a problem connecting to the mail server. Please try again later.</faultstring><detail><e:ProblemConnectingToImap xmlns:e="http://scalix.com/errors"><message>There was a problem connecting to the mail server. Please try again later.</message><debug>user: email@domain.tld
request method(s): login
XML:
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"&gt;&lt;SOAP-ENV:Header&gt;&lt;credentials xmlns="http://scalix.com/schemas/gofish" SOAP-ENV:mustUnderstand="1"&gt;&lt;username&gt;email@domain.tld&lt;/username&gt;&lt;emailDomain&gt;domain.tld&lt;/emailDomain&gt;&lt;fugu&gt;Ox4a327d2e71377d227e303430232a2922262d2909&lt;/fugu&gt;&lt;ts&gt;0&lt;/ts&gt;&lt;/credentials&gt;&lt;/SOAP-ENV:Header&gt;&lt;SOAP-ENV:Body&gt;&lt;m:login xmlns:m="http://scalix.com/methods"/&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;</debug></e:ProblemConnectingToImap></detail></SOAP-ENV:Fault>
Feb 21, 2007 7:30:39 AM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Too many open files
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(Unknown Source)
        at java.net.ServerSocket.implAccept(Unknown Source)
        at java.net.ServerSocket.accept(Unknown Source)
        at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:293)
        at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:647)
        at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:857)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Unknown Source)



any help would be appreciated.

we have 3 users 1 in outlook and two through webmail, and ~3gb of email.

If I restart tomcat it works for most of the day or until overnight then starts failing again.

Posted: Wed Feb 21, 2007 10:05 am
by pharoh
we have added 2 lines to /etc/security/limits.conf

Code: Select all

scalix          hard    nofile          32767
root            hard    nofile          32767


and we will see if this helps I beleive that we are running into the max number of files open per-proccess for the jvm and this setting should set that much higher, the default was 1024.

Posted: Wed Feb 21, 2007 4:58 pm
by pharoh
this seems to have stopped the problem. It was happening about every 2-3 hours after a tomcat restart but now it's running great and the interface is noticeably faster (we also bumped the memory for the java engine to 384 from the default of 125 but that was done while we were still having problems).

Posted: Thu May 17, 2007 9:40 pm
by deyjvu
This could be the issue in bug http://bugzilla.scalix.com/show_bug.cgi?id=13143

Also a precurser to this problem in my case was that users were seeing an error when they tried to logon "There was a problem connecting to the mail server. Please try again later". When looking for the cause of this error I found the "Too many open files" error mentioned in the java log files. This site is on 11.0.2 and had their open files set to 1024.

Posted: Thu Jun 14, 2007 10:50 am
by mnauta
pharoh wrote:we have added 2 lines to /etc/security/limits.conf

Code: Select all

scalix          hard    nofile          32767
root            hard    nofile          32767


and we will see if this helps I beleive that we are running into the max number of files open per-proccess for the jvm and this setting should set that much higher, the default was 1024.


yesterday I had two issue, one a message that server to busy can't log in to SWA and another where you could logon to SWA but the next page (inbox etc) would stay totally blank. Each time I restated tomcat it fixed it.

Might this be the same? How can I make changes to the limits.conf file effective, what do I need to restart or reload?

Thanks
manuel

Posted: Mon Mar 31, 2008 8:22 am
by mxc
I have edited /etc/security/limits.conf and /etc/opt/scalix-tomcat/scalix-tomcat.conf to increase the open file limit but i still get this error.

Posted: Mon Mar 31, 2008 10:19 am
by mxc
Should I also increase /proc/sys/fs/file-max? This is proving to be a real pain and the client is considering replacing Scalix with Zimbra.

Posted: Tue Apr 01, 2008 5:57 am
by deyjvu
Did you check the bug that was pointed to, it indicates that there have been changes made by Scalix in later versions so check if you haven't already got the change in your scalix-tomcat already. If you haven't then try the change but make sure you have rebooted the appropriate services for the change to take affect.

Posted: Tue Apr 01, 2008 12:11 pm
by mxc
i have edited the scalix-tomcat.conf file as directed and still no luck. The client has decided to abandon scalix.

Posted: Wed Apr 02, 2008 11:37 am
by ls-al
mxc wrote:i have edited the scalix-tomcat.conf file as directed and still no luck. The client has decided to abandon scalix.


Hopefully the client is not replacing one Tomcat issue with another...

BTW: You never mentioned essential informations, just reanimated an old thread and pointed to a bug that *is* solved. But it seems that further discussion on this is wasted time.

Posted: Fri Apr 04, 2008 7:24 am
by aebir
Hi ,

i have the same problem, I documented this in the thread viewtopic.php?t=10301
but i got no answer


Regards

Rolf

Posted: Fri Apr 04, 2008 10:50 am
by ls-al
thread viewtopic.php?t=10301 updated :)