rain0r / ampd

A web-based MPD client.
GNU General Public License v3.0
52 stars 5 forks source link

Connection is dropped on song with missing artist tag #413

Closed DirkSchmitt closed 2 years ago

DirkSchmitt commented 2 years ago

Playing a song without artist tag the connection in the web-UI (→ cloud symbol) is switching between connected and disconnected.

Environment:

The here played song is tagged with composer but neither with artist, performer or conductur. The id3 Tags are listed below:

mutagen-inspect /computer42/audio/music-mp3/Wolfgang_Amadeus_Mozart/Wolfgang_Amadeus_Mozart--Mozart_Complete_-_01_-_Fruhe_Symphonien/05--Mozart_Complete_-_01_-_Fruhe_Symphonien--Andante_Symphony_No_4_in_D_KV19_-_Andante.mp3
-- /computer42/audio/music-mp3/Wolfgang_Amadeus_Mozart/Wolfgang_Amadeus_Mozart--Mozart_Complete_-_01_-_Fruhe_Symphonien/05--Mozart_Complete_-_01_-_Fruhe_Symphonien--Andante_Symphony_No_4_in_D_KV19_-_Andante.mp3
- MPEG 1 layer 3, 192000 bps (CBR?), 44100 Hz, 2 chn, 201.22 seconds (audio/mp3)
APIC=cover front,  (image/jpeg, 1227847 bytes)
TALB=Mozart Complete - 01 - Frühe Symphonien
TCOM=Wolfgang Amadeus Mozart
TCON=Classical
TDTG=2015-05-30 00:44:26
TIT2=Andante/Symphony No 4 in D KV19 - Andante
TRCK=005/115

Stacktrace in the console:

022-10-23 12:56:09.602 TRACE 1936275 --- [.0-42080-exec-6] o.h.a.s.s.albumart.AlbumArtService       : Looking for a cover in the directory of file: music-mp3/Wolfgang_Amadeus_Mozart/Wolfgang_Amadeus_Mozart--Mozart_Complete_-_01_-_Fruhe_Symphonien/05--Mozart_Complete_-_01_-_Fruhe_Symphonien--Andante_Symphony_No_4_in_D_KV19_-_Andante.mp3
2022-10-23 12:56:09.609 ERROR 1936275 --- [.0-42080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException: Cannot invoke "String.trim()" because "artist" is null] with root cause

java.lang.NullPointerException: Cannot invoke "String.trim()" because "artist" is null
    at org.hihn.ampd.server.service.cache.CoverCacheService.buildFileName(CoverCacheService.java:119) ~[classes!/:1.5.3]
    at org.hihn.ampd.server.service.cache.CoverCacheService.buildCacheFullPath(CoverCacheService.java:125) ~[classes!/:1.5.3]
    at org.hihn.ampd.server.service.cache.CoverCacheService.loadCover(CoverCacheService.java:81) ~[classes!/:1.5.3]
    at org.hihn.ampd.server.service.albumart.AlbumArtService.findAlbumCoverForTrack(AlbumArtService.java:75) ~[classes!/:1.5.3]
    at org.hihn.ampd.server.controller.CoverController.findAlbumCoverForTrack(CoverController.java:45) ~[classes!/:1.5.3]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:241) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:678) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.23.jar!/:5.3.23]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.23.jar!/:5.3.23]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.65.jar!/:na]
    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
rain0r commented 2 years ago

Hi there,

thanks for reporting this bug. I'm working on a fix for this but in the meantime you could prevent this from happening by setting local.cover.cache=false.

Either in your application.properties file or by starting ampd with java -jar -Dlocal.cover.cache=false ampd.jar.

rain0r commented 2 years ago

The issue should be fixed with release 1.5.4.