0
Not a bug

Error forcing server restart

Elouan 8 years ago updated by Tom 8 years ago 10

At the bottom are the error messages I get.

This is what I believe happens:

  • I open Ubooquity on my ipad (using defaut ios navigator, can't remember the name of it)
  • I get all the icons, and arrow in the wrong order
  • I refresh the page a couple of times, click on a couple of arrow, until finally, one page appears to be fine
  • The server stops responding [this is the message I get in the navigator -Safari]
  • I have to restart ubooquity from CLI to get it back on its feet again

I believe this is because the way safari handles the parallel connection: it overloads the server because it's requesting to many pages in parallel, the server can't handle it, and this crashes Ubooquity

Would be nice it we could diagnose this problem => we could launch a restart job when this kind of error appears



20160121 23:17:21 [pool-1-thread-2] ERROR com.ubooquity.f.d - Could not list files in folder:
java.nio.file.FileSystemException: /volume1/comics/Calypso: Too many open files
   at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.8.0_65]
   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_65]
   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_65]
   at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407) ~[na:1.8.0_65]
   at java.nio.file.Files.newDirectoryStream(Files.java:457) ~[na:1.8.0_65]
   at com.ubooquity.f.d.a(SourceFile:49) ~[Ubooquity.jar:1.8.2]
   at com.ubooquity.provider.comic.b.a(SourceFile:166) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c.a(SourceFile:318) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c.a(SourceFile:57) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c$1.a(SourceFile:129) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e.a(SourceFile:287) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e$f.a(SourceFile:830) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e$1$1.run(SourceFile:210) [Ubooquity.jar:1.8.2]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65]
   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
20160121 23:17:21 [pool-1-thread-9] ERROR com.ubooquity.f.d - Could not list files in folder:
java.nio.file.FileSystemException: /volume1/comics/Chat (Le): Too many open files
   at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.8.0_65]
   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_65]
   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_65]
   at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407) ~[na:1.8.0_65]
   at java.nio.file.Files.newDirectoryStream(Files.java:457) ~[na:1.8.0_65]
   at com.ubooquity.f.d.a(SourceFile:49) ~[Ubooquity.jar:1.8.2]
   at com.ubooquity.provider.comic.b.a(SourceFile:166) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c.a(SourceFile:318) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c.a(SourceFile:57) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c$1.a(SourceFile:129) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e.a(SourceFile:287) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e$f.a(SourceFile:830) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e$1$1.run(SourceFile:210) [Ubooquity.jar:1.8.2]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65]
   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]
20160121 23:17:21 [pool-1-thread-12] ERROR com.ubooquity.f.d - Could not list files in folder:
java.nio.file.FileSystemException: /volume1/comics/Caste Des Méta-Barons (La): Too many open files
   at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91) ~[na:1.8.0_65]
   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[na:1.8.0_65]
   at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[na:1.8.0_65]
   at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407) ~[na:1.8.0_65]
   at java.nio.file.Files.newDirectoryStream(Files.java:457) ~[na:1.8.0_65]
   at com.ubooquity.f.d.a(SourceFile:49) ~[Ubooquity.jar:1.8.2]
   at com.ubooquity.provider.comic.b.a(SourceFile:166) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c.a(SourceFile:318) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c.a(SourceFile:57) [Ubooquity.jar:1.8.2]
   at com.ubooquity.c$1.a(SourceFile:129) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e.a(SourceFile:287) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e$f.a(SourceFile:830) [Ubooquity.jar:1.8.2]
   at com.ubooquity.e.e$1$1.run(SourceFile:210) [Ubooquity.jar:1.8.2]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_65]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_65]
   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]

I got the same error today, with same message in log: "too many open files" with same consequence: ubboquity becomes unresponsive. It's not killed, I can still see the process running, but it becomes unresponsive


This time, I was on iphone 4 (it's a bit old) on a slow connection (3G) testing how ubboquity behaved


This is a big problem: if ubboquity doesn't work well with ios equipement, it's a big issue I find

Not a bug

You have two different problems.

For the mixed icons, take a look at this thread (the last few messages).


As for the "too many open files", this is a system wide limitation on the maximum number of file handles your system is allowed to manage. So the problem may come from Ubooquity, but it may also come from something else.

(and it has nothing to do with the OS of the client you are using)


Try to look for documentation on "too many open files" and the "ulimit" command on Google, you'll find how to increase this limit.

i don't want to change system settings on my NAS: Ubooquity is the only service that creates problem; on some web server like lightttp, the mas bum files can be configured... is there a similar setting within Ubooquity

"mas bum files" ?

sorry: in lightttp, the parameter is "server.max-fds"

is there an equivalent setting within Ubooquity? maybe it's not compatible with my symbology settings

No it does not have one, but it should not require one (Ubooquity does not need to keep a lot of files open).

I'll have to do some tests to try to find a potential file handler leak.

Do you have some specific settings ? (like a very high number of comics/books per page)

I've set Ubooquity to 24 comics per page, in "admin" settings. I wouldn't consider that high!


my two cents: if I look at the error messages: it's showing a "could not list files in folder", a directory, and the "too many open files", error. I get this error several times.

It reads like it's trying to open all files in the directory; why is it trying to list all files in folders? to count them? when this happens, I'm only browsing the folders...

if I have a slow connection, and I click on refresh because I get impatient, maybe the files being listed are not closed properly before I go to the next page, hence leading to the open files stacking up; if that is the case, it's simpler to do the counting during scanning and store the value in the dB, no need to list files in directory until the user navigates into it


for my info : what is the embed web server in Ubooquity?

No, 24 comics per page is a low value indeed.

I was asking because Ubooquity has to read thumbnails files when displaying a page (as well as a few other files like themes element if you use a custom theme). But that's not important.

Ubooquity also scans your shared folders and all the files inside at startup, to detect any new, modified or removed file. It probably uses a lot of file handles at this time.

But don't focus on that.


If you want to get to the bottom of the problem, the first step is to characterize it.

The total number of file handles available on your system is shared by all applications.

Start by getting this max number and list consumption by application. There is a tutorial here.

The numbers you'll get will be a good starting point to understand what happens exactly.


NB: the web server is embedded because the goal of Ubooquity is to be self-sufficient, a single jar to copy and launch. And using an external server would not make sense does not need much in that domain. The embedded server is a single class: https://github.com/NanoHttpd/nanohttpd/blob/master/core/src/main/java/fi/iki/elonen/NanoHTTPD.java



I'm running into the same problem. I've changed my filesystem to allow the max number of open files, yet every couple of days Ubooquity crashes and I have to manually stop the process and restart it. It's gotten to the point where I even signed up for a server checking status to tell me when it's died so I can restart it. I've got my open files set to 65535, yet it's still crashing.


What exactly do you need from me to fix this bug?

65k file handles is more than enough.

I still have to look for a file handle leak in Ubooquity. It's quite high on my todo list, I just lack the time right now...