Page 1 of 1

[SOLVED] Problem with network drives

PostPosted: Mon May 13, 2013 2:58 pm
by DaveWut
Hi there,

So I recently installed network drives to share my music and videos across my local network I though it would be interesting to use them for subsonic. So once my setup was complete under my Ubuntu box, I changed the settings and had add two entries pointing to two SMB shares. One for Videos and the other one for Music. My SMB shares are permanently mounted to my file system, so I don't think there's a problem here.

The thing is, after a while (without using the system), things goes really wrong. All libraries were already scanned and subsonic starts to act really strangely. For instance, once logged in, menu.view and top.view doesn't show at all, they keep loading indefinitely (I really don't know why the fuck this happens). The other thing is, once this behavior is noticed, they next scheduled scan will fail and will throw a shit load of warnings.

Here's one of the warnings, they all seems the same:
Code: Select all
[2013-05-12 12:00:17,510] WARN RESTFilter - Error in REST API: EofException
org.mortbay.jetty.EofException
        at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)
        at org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(AbstractGenerator.java:546)
        at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:567)
        at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:907)
        at net.sourceforge.subsonic.controller.StreamController.sendDummy(StreamController.java:389)
        at net.sourceforge.subsonic.controller.StreamController.handleRequest(StreamController.java:209)
        at net.sourceforge.subsonic.controller.RESTController.stream(RESTController.java:1080)
        at sun.reflect.GeneratedMethodAccessor673.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:473)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
        at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at net.sourceforge.subsonic.security.RESTRequestParameterProcessingFilter.doFilter(RESTRequestParameterProcessingFilter.java:110)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
        at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
        at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
        at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:43)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.RESTFilter.doFilter(RESTFilter.java:51)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at net.sourceforge.subsonic.filter.ParameterDecodingFilter.doFilter(ParameterDecodingFilter.java:54)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
        at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
        at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.io.IOException: Connection reset by peer
        at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:94)
        at sun.nio.ch.IOUtil.write(IOUtil.java:51)
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
        at org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:166)
        at org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:208)
        at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:693)
        ... 66 more


Here's the interesting part of the error:
Code: Select all
Caused by: java.io.IOException: Connection reset by peer


So, once I saw that, I though there might be some options that would allow me to "temporary" fix the problem. I found this option:
Image
It might help a little, but not that much I think. It there's a way to optimized SMB share access with Subsonic?

Thanks
Dave

Re: Problem with network drives

PostPosted: Tue May 14, 2013 1:20 pm
by DaveWut
The fast access mode doesn't fix the problem. On each media scanning schedules, Subsonic forgets about my music folder and I must manually scan the entiry library once again.
Can someone help me with this? Here's what kind of library I have:
Image

My network drives are configured using Windows Server 2012. MAYBE and I said maybe there's a little option that might help? Otherwise, would it be the Ubuntu mounting option that may be tricked to obtain a better connection stability?

Thanks
Dave

EDIT: And I would like to point out this topic is really interesting: viewtopic.php?f=2&t=12093
Maybe subsonic doesn't reset it's connection to the network share and that, by consequences, cannot re-read informations from the network drive.

EDIT2: BTW, while trying to load top.view and menu.view, my server quickly became overloaded. My load average can easly reach 20 sometimes (the machine has a 4 core processor).

Re: Problem with network drives

PostPosted: Fri May 17, 2013 1:07 pm
by DaveWut
I'm kind of tired of not be able to use SS instantly... So well, here's another shot of info.
I use this command to map a SMB share on my local file system under Ubuntu 12.10 x64:
Code: Select all
//SERVER/Music /home/user/Media/Music cifs domain=DOMAIN,username=USER,password=PASSWORD,uid=33,iocharset=utf8 0 0

Note that this command is working, my shares are currently accessible.

Subsonic takes like a full 15-20 minutes to load both top and menu views. Sometime, my proxy server (which is Apache2) stops the requests and tells my there was error transferring data with both views. Seems like jetty is unable to complete the request... it takes god damn too much time.

Anyone have an idea... which I could look to fix the problem?

Thanks
Dave

Re: Problem with network drives

PostPosted: Fri May 17, 2013 2:02 pm
by frankspin
I'm having a similar issue with my shares mounted on unRaid. I can add music but forcing a scan of Subsonic doesn't find the new files until I restart the computer.

Re: Problem with network drives

PostPosted: Fri May 17, 2013 10:41 pm
by gurutech
The issue is not with the Linux side - it's with the Windows side.

The problem is that Windows can't handle the two permanent mapped drives from the same SMB client (aka your Linux machine). Microsoft's "solution" is to increase the IRPStackSize in the registry, which requires a reboot after adjusting. The only problem is that this will work for a while, but will crap out again.

The solution I have found (which works MUCH BETTER than MS's solution!) is to put all of your media into a single "main" folder, and share that folder, (ie. D:\Media\ ) and then share that out to your network, mapping this to your Linux machine via SMB/CIFS. Then from within Subsonic (or Madsonic), set each type of media into its own media folder.

For example, I have all my media in a folder called "Media" on my D: drive (D:\Media). Inside this folder, I have subfolders for "music", "movies", and "audiobooks". I share the "Media" folder as "Media" over my network.

My /etc/fstab file contains a single line (added to the stock mappings):
Code: Select all
//server.local/media    /media/media    cifs    rw,auto,credentials=/etc/.my.creds.file    0 0


Inside Madsonic, I have 3 mappings (one each for music, movies, and audiobooks):
Code: Select all
/media/media/Music
/media/media/Movies
/media/media/Audiobooks


Hope this helps!

Re: Problem with network drives

PostPosted: Mon May 20, 2013 5:13 pm
by DaveWut
Wow, thanks a lot for the tip! This might effectively be my problem. I will make some changes and will come back here if there's anything else!

Thanks again!
Dave

EDIT: I confirm, changing IRPStackSize to 50 fixed the problem. Silly Microsoft lol!