airsonic-advanced / airsonic-advanced

GNU General Public License v3.0
1.26k stars 133 forks source link

No playback #646

Open wolkenschieber opened 3 years ago

wolkenschieber commented 3 years ago

Problem description

Music doesn't play.

Steps to reproduce

Instead of playing the file following exception is thrown:

INFO --- o.a.p.s.CacheConfiguration$CacheLogger   : Cache Key: 88 | EventType: CREATED | Old value: null | New value: org.airsonic.player.domain.Playlist@670ddeb9
ERROR --- .WebSocketAnnotationMethodMessageHandler : Unhandled exception from message handler method

org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.messaging.handler.annotation.DestinationVariable int] for value 'undefined'; nested exception is java.lang.NumberFormatException: For input string: "undefined"
        at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:47) ~[spring-core-5.3.8.jar:5.3.8]
        at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:192) ~[spring-core-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.annotation.support.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:117) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:117) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:148) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:116) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMatch(AbstractMethodMessageHandler.java:565) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch(SimpAnnotationMethodMessageHandler.java:511) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.simp.annotation.support.SimpAnnotationMethodMessageHandler.handleMatch(SimpAnnotationMethodMessageHandler.java:94) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessageInternal(AbstractMethodMessageHandler.java:520) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessage(AbstractMethodMessageHandler.java:454) ~[spring-messaging-5.3.8.jar:5.3.8]
        at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144) ~[spring-messaging-5.3.8.jar:5.3.8]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
        at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: java.lang.NumberFormatException: For input string: "undefined"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:na]
        at java.base/java.lang.Integer.parseInt(Integer.java:652) ~[na:na]
        at java.base/java.lang.Integer.valueOf(Integer.java:983) ~[na:na]
        at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211) ~[spring-core-5.3.8.jar:5.3.8]
        at org.springframework.core.convert.support.StringToNumberConverterFactory$StringToNumber.convert(StringToNumberConverterFactory.java:64) ~[spring-core-5.3.8.jar:5.3.8]
        at org.springframework.core.convert.support.StringToNumberConverterFactory$StringToNumber.convert(StringToNumberConverterFactory.java:50) ~[spring-core-5.3.8.jar:5.3.8]
        at org.springframework.core.convert.support.GenericConversionService$ConverterFactoryAdapter.convert(GenericConversionService.java:437) ~[spring-core-5.3.8.jar:5.3.8]
        at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41) ~[spring-core-5.3.8.jar:5.3.8]
        ... 14 common frames omitted

System information

Additional notes

This happens on a fresh installation.

Abraka commented 3 years ago

Try to delete all players existing in settings-->players. Then create new one a try to play some music.

wolkenschieber commented 3 years ago

@Abraka Many thanks, that actually helped.

Additionally I want to mention that I have seen above exceptions never since filing this bug. No matter if the players are working or not.

MichaIng commented 2 years ago

Same issue (but no related error message) and same solution here. This was however a fresh install, hence no database or configs were present, only the airsonic.war, it is hence unexpected that the default web player fails to play music and a delete/recreate cycle required.

In browser console I see:

>>> SEND
destination:/app/playqueues/0/play/mediafile
content-length:8

{"id":1}

but nothing happens.

System is Debian Bullseye with OpenJDK 17.

I can reliably replicate it by removing all Airsonic data aside of the airsonic.war to have everything freshly created. Change/add media library, scan, refresh, play (now, last or next does all not work). Then delete player 0, page reload (which creates an identical new player 0) and voila, music files play 🙂.

I it needs to be looked at the initial config/database creation when nothing exists yet. I can help testing/debugging and provide any information from the system you may need.

MichaIng commented 2 years ago

Hey guys, not sure about your priorities and whether this issue affects all fresh installs, but for us it is the major reason why we cannot ship Airsonic-Advanced as replacement for Airsonic to our users. Users will install it, recognise that trying to play anything or adding anything to the query doesn't work and uninstall it. It's all about the first impression if this shall succeed in a broader way, and the one major feature (play music) broken OOTB is a deal breaker.

Simply cloning the existing default web player and deleting the existing one already does the job, so I guess the default one is somehow defined in a legacy/incompatible way but is not migrated or so?

MichaIng commented 2 years ago

I think I may have found the reason. I recognised that it is not an issue with v10.6.0, so I compared the default web player. On v11 snapshots it is Player 0 [admin] while on v10.6.0 it is Player 1 [admin]. Deleting the player in v11 snaphot, having the default automatically recreated, leads to a Player 1 [admin] entry as well. Is the index 0 probably invalid and playback only works with an index of 1 or higher?

EDIT: Cloning Player 0 to get Player 1 works as well. So it seems to be really the index.

randomnicode commented 2 years ago

👀

If Player 0 is always removed at migration or never created, might solve the issue?

MichaIng commented 2 years ago

Never created on a fresh install and removed on upgrade would make sense. Not sure whether it ever worked so that it makes sense to migrate it somehow?

MichaIng commented 2 years ago

Great, I can verify the latest snapshot solved it, many thanks 👍!

emilio-millepiani commented 1 month ago

Hi! In 11.0.0-SNAPSHOT.20240424015024 (Docker version) I have the same problem. How can I solve it?

Thanks!