Top Bar File Tree View Cleanup

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

Top Bar File Tree View Cleanup

Postby Nikonerik » Sat Oct 27, 2012 5:20 pm

How do I reset the resulting file tree that I see when I select the File Tree Button on the Top Bar? It seems that I have an old Folder Location that is hanging around.
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm

Re: Top Bar File Tree View Cleanup

Postby Nikonerik » Sat Oct 27, 2012 8:47 pm

For example when I click on the file tree link that should not be there I get this error:

Subsonic encountered an internal error. You can report this error in the Subsonic Forum. Please include the information below.
Exception java.lang.SecurityException
Message Access denied to file F:\My Media\Big Bang Theory _ Comic-Con 2012 full panel UNEDITED.mp4
Java version Oracle Corporation 1.7.0_05
Operating system Windows 7 6.1
Server jetty/8.y.z-SNAPSHOT
Memory Used 48 of 82 MB
Stack trace java.lang.SecurityException: Access denied to file F:\My Media\Big Bang Theory _ Comic-Con 2012 full panel UNEDITED.mp4 at net.sourceforge.subsonic.service.MediaFileService.getNonIndexedMediaFile(MediaFileService.java:194) at net.sourceforge.subsonic.service.MediaFileService.getNonIndexedMediaFile(MediaFileService.java:171) at net.sourceforge.subsonic.controller.FileTreeController.getMediaFiles(FileTreeController.java:136) at net.sourceforge.subsonic.controller.FileTreeController.addDirectories(FileTreeController.java:125) at net.sourceforge.subsonic.controller.FileTreeController.handleRequestInternal(FileTreeController.java:72) 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:900) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:648) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1336) at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82) at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:242) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at net.sourceforge.subsonic.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:43) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at net.sourceforge.subsonic.filter.ParameterDecodingFilter.doFilter(ParameterDecodingFilter.java:54) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at net.sourceforge.subsonic.filter.BootstrapVerificationFilter.doFilter(BootstrapVerificationFilter.java:54) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:559) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:365) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Unknown Source)
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm

Re: Top Bar File Tree View Cleanup

Postby hakko » Sat Oct 27, 2012 9:54 pm

What does your media folders look like? Is F: or F:\My Media one of them?

How are access rights set up? What user is running Subsonic, and does that user have access to that file?

Normally, a scan initiated from Settings -> Media folders should make sure that the file tree view is up to date with what's in your folders.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top Bar File Tree View Cleanup

Postby Nikonerik » Sun Oct 28, 2012 12:59 am

This is what I have and this is what I get:
(I should not have the "My Media" links)
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm

Re: Top Bar File Tree View Cleanup

Postby hakko » Sun Oct 28, 2012 10:02 am

I'll look into this, looks like a bug. Does it get solved if you add F:\My Media as a Media Folder, and then remove it?
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top Bar File Tree View Cleanup

Postby Nikonerik » Sun Oct 28, 2012 7:44 pm

I actually tried that . . . no effect.
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm

Re: Top Bar File Tree View Cleanup

Postby hakko » Sun Oct 28, 2012 8:54 pm

I guess you've restarted your server since you removed F:\My Media? It would be interesting to read the log files referenced from About -> Bug report otherwise, to see if they give a clue on what went wrong (that's the best way to troubleshoot).

To delete directories from the PostgreSQL database, you need to use a tool called PgAdmin that came with the PostgreSQL install. It's graphical and not very complicated. See this screenshot: http://pgadmin.org/images/screenshots/p ... _win32.png

You navigate in the left side view, by right-clicking and connecting to your own PostgreSQL server. Then, mark the database "musiccabinet" and press the SQL button (next to the Recycle bin button). This brings up a new window where you can execute arbitrary SQL commands.

To look for top directories, type this and then press the green forward arrow to execute the command:
Code: Select all
select path, deleted from library.directory where parent_id is null order by 1;


It should display G:\Movies, H:\TV etc. I'd be interested to hear what is prints, actually, if you don't mind pasting it here.

To delete directories from the database, copy a path you want to remove (they're case sensitive, so you can't just type h:\tv), and type something like this and press the green forward arrow again:
Code: Select all
insert into library.directory_delete (path) values ('F:\My Media');
select library.delete_from_library();


This will take a little while to complete (maybe 10sec, but it totally depends on your library size), just let it run until it finishes.

This should remove F:\My Media from your file tree view.

If you remember anything about how this situation happened (to help me reproduce it), I'd be interested to hear that, too.

Thanks.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top Bar File Tree View Cleanup

Postby Nikonerik » Sun Oct 28, 2012 9:41 pm

I attached the log file from the C:\subsonic directory.

When I try to Connect to the dbase server PgAdmin is asking me for a password??
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm

Re: Top Bar File Tree View Cleanup

Postby Nikonerik » Mon Oct 29, 2012 4:30 am

I managed to follow your instructions with a little help from Google:

In pgAdmin III under the server right click and go to properties, then the advanced tab and in the host address type 127.0.0.1.

Furthermore I was lucky to remember the password I used when I installed PostgreSQL! I had NO expectation that I'd be connecting to this dbase and manipulating the data therein.

Any-hoo . . . .
Here's what came back when I entered the first query:

"F:\My Documents\My Digital Editions\Audiobooks"
"F:\My Documents\My Media"
"F:\My Media"
"F:\My Music"
"G:\Movies"
"H:\TV"
"J:\Euterpe"
"J:\Music Video"

(For those of you playing at home: "Euterpe" -Is from Greek mythology - the name of one of Zeus's daughters, who was regarded to be the Muse of Music

. . . I applied your second query and deleted the two "My Media" entries, refreshed my Subsonic page in the browser and it looks great now!

Thanks! That was fun.

IIRCC . . . in Windows Explorer I promoted the "My Media" folder from within "My Documents" and then added the new location in MC'net. I don't remember what efforts I made, if any, to delete the old location; except to say that I was frustrated that I couldn't get rid of it using obvious means.
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm

Re: Top Bar File Tree View Cleanup

Postby hakko » Mon Oct 29, 2012 6:21 am

Sorry about the bug, good to hear it's working. I guess there must be some scenario with adding/deleting multiple media folders (possible scanning your library meanwhile) that causes this, I'll see how to make it more robust.

As a side-note: it does take a little bit of effort to learn SQL, but it's a very, very powerful tool. I use the database all the time for answering questions like "which albums in my library don't have embedded cover art", "which new artists should I look into that are most related to the music I listen to the most" etc. It's very handy actually.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Top Bar File Tree View Cleanup

Postby Nikonerik » Mon Oct 29, 2012 8:52 pm

Looks like I have some reading to do! . . . . Now where is my copy of SQL For Dummies?
Nikonerik
 
Posts: 63
Joined: Wed Oct 10, 2012 1:49 pm


Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 35 guests