"WARN RESTController - Invalid year: 1992-01-01"

Need help? Post your questions here.

Moderator: moderators

"WARN RESTController - Invalid year: 1992-01-01"

Postby Sporkman » Tue Jul 13, 2010 1:57 am

I'm seeing a bunch of these in subsonic.log:

Code: Select all
[2010-07-09 17:26:18,834] INFO PodcastService - Starting scheduled Podcast refresh.
[2010-07-09 17:26:18,835] INFO PodcastService - Completed scheduled Podcast refresh.
[2010-07-09 18:30:44,855] INFO PlayerDao - Created player 5.
[2010-07-09 18:31:25,831] WARN RESTController - Invalid year: 1992-01-01
java.lang.NumberFormatException: For input string: "1992-01-01"
   at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
   at java.lang.Integer.parseInt(Integer.java:458)
   at java.lang.Integer.valueOf(Integer.java:554)
   at net.sourceforge.subsonic.controller.RESTController.createAttributesForMusicFile(RESTController.java:582)
   at net.sourceforge.subsonic.controller.RESTController.getMusicDirectory(RESTController.java:222)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   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.doGet(FrameworkServlet.java:501)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   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.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
   at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:148)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
   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)


...anything I should change?

-Thanks
Sporkman
 
Posts: 18
Joined: Wed Mar 17, 2010 1:33 am
Location: The Internet

Postby Poffa » Tue Jul 13, 2010 8:51 am

I wouldn't worry.

Subsonic needs to take care of more date formats while parsing tag info. Probably Subsonic expects "1992.01.01", "19920101" or "01-01-1992" and so on. It's a bug, but not a crucial one.
Poffa
 
Posts: 62
Joined: Sun Jun 28, 2009 4:21 pm
Location: Bergen, Bergen

Postby Gonzo » Wed Jul 14, 2010 12:34 am

Your soundfiles contain wrong tags. In your case it seems like some smart program put "1992-01-01" instead of a 4-digit year (1992) into the mp3 tag and thereby breaks the expected format. Try to re-tag theese files (1992-01-01 sounds like some bootleg?)
User avatar
Gonzo
 
Posts: 24
Joined: Sun May 16, 2010 10:43 am

Postby dan1son » Wed Jul 14, 2010 7:38 pm

I get this in my logs now too. I don't recall getting it before. I use musicbrainz picard to tag my files, which throws the entire release date into the id3 tag if possible. I believe the tag is "Date" and not "Year" which should be fine. Unfortunately the logs don't tell you the file, so it's hard to look.

YYYY-MM-DD is the ISO 8601 standard for date and should be acceptable for the parser.

Currently this is taking over my logfile. It'd be great to get a fix on this :)

EDIT: I also get some with YYYY-MM which I would also assume should be acceptable if only the month is known.
dan1son
 
Posts: 18
Joined: Fri Oct 23, 2009 10:11 pm
Location: Austin, TX

Postby Sporkman » Wed Jul 14, 2010 9:23 pm

Gonzo wrote:Your soundfiles contain wrong tags. In your case it seems like some smart program put "1992-01-01" instead of a 4-digit year (1992) into the mp3 tag and thereby breaks the expected format. Try to re-tag theese files (1992-01-01 sounds like some bootleg?)


They were scanned from CDs to FLAC via Rythmbox on Ubuntu...
Sporkman
 
Posts: 18
Joined: Wed Mar 17, 2010 1:33 am
Location: The Internet

Postby Poffa » Wed Jul 14, 2010 9:58 pm

Sporkman wrote:
Gonzo wrote:Your soundfiles contain wrong tags. In your case it seems like some smart program put "1992-01-01" instead of a 4-digit year (1992) into the mp3 tag and thereby breaks the expected format. Try to re-tag theese files (1992-01-01 sounds like some bootleg?)


They were scanned from CDs to FLAC via Rythmbox on Ubuntu...

Excatly how I do it :D

I also have this "problem". Subsonic should be able to parse this format also, but it doesn't bother me that much.
Poffa
 
Posts: 62
Joined: Sun Jun 28, 2009 4:21 pm
Location: Bergen, Bergen

Postby baaldemon » Mon Jul 19, 2010 4:22 pm

I too was getting annoyed by these stack traces in my log file so I ended up just modifying the code myself. As I do not see any case where I would actually need the stack trace for an error of this type I pass null as the exception to the logger. I also modified it to be able to parse several types of full dates.

Code in net.sourceforge.subsonic.controller.RESTController.java
Code: Select all
if (year != null) {
    if (year.length() >4) {
        if (year.matches("^(19|20)\\d{2}.*")){
            year = year.substring(0,4);
        }
        else if (year.matches(".*(19|20)\\d{2}$")){
            year = year.substring(year.length()-4);
         }
    }
    try {
        attributes.add(new Attribute("year", Integer.valueOf(year)));
    } catch (NumberFormatException x) {
        //LOG.warn("Invalid year: " + year, x);
        LOG.warn("Invalid year: "+year, null);
     }
}
baaldemon
 
Posts: 99
Joined: Fri May 07, 2010 11:54 am


Return to Help

Who is online

Users browsing this forum: No registered users and 41 guests