Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] | [FATAL] Possibly Uncaught Exception, Reason: ReferenceError: player is not defined #229

Closed
Koko2110 opened this issue Apr 9, 2024 · 11 comments

Comments

@Koko2110
Copy link

Koko2110 commented Apr 9, 2024

Hello. I am encountering the following errors upon trying to play anything. The bot does connect but immediately disconnects. This is the log at the time of the error. As you can see I am met with ReferenceError: player is not defined on initialization and with another [ERROR] | [object Object] when trying to play something.

Any help would be appreciated! Let me know if what I have provided is not enough.

djs-bot    | [09.04.2024 - 22:53]         | Spawned shard 0
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Bot running on OPLevel: 1
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Debug mode is [ENABLED]!
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Booting up the bot...
djs-bot    |                                InsertNameHereBot/v5.5.1 (ID: XXXXXXXXXXXXXXXXXXX)
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Loading error handlers...
djs-bot    | [09.04.2024 - 22:54] [INFO ] | Loaded debug error handlers!
djs-bot    | [09.04.2024 - 22:54] [DEBUG] | Music engine "Erela" has been loaded
djs-bot    | [09.04.2024 - 22:54] [DEBUG] | Prisma ORM has been loaded
djs-bot    | [09.04.2024 - 22:54] [INFO ] | Slash commands have been loaded. Waiting for bot to finish initializing...
djs-bot    | (node:255) [FSTWRN002] FastifyWarning: The routes plugin being registered mixes async and callback styles, which will result in an error in `fastify@5`
djs-bot    | (Use `node --trace-warnings ...` to show where the warning was created)
djs-bot    | [09.04.2024 - 22:54] [INFO ] | Schedules have been loaded.
djs-bot    | [09.04.2024 - 22:54] [INFO ] | Event listeners have been loaded.
djs-bot    | [09.04.2024 - 22:54] [INFO ] | WS is now listening on port 3001
djs-bot    | [09.04.2024 - 22:54] [INFO ] | Successfully logged in as おんがく#XXXX
djs-bot    | [09.04.2024 - 22:54] [INFO ] | API is now listening on port 8080
djs-bot    | [09.04.2024 - 22:54] [ERROR] | AggregateError
djs-bot    | [09.04.2024 - 22:54] [ERROR] | [FATAL] Possibly Uncaught Exception
djs-bot    | 	Reason: ReferenceError: player is not defined
djs-bot    | 
djs-bot    | uncaughtException
lavalink   | 2024-04-09 22:54:01.509  INFO 1 --- [  XNIO-1 task-1] io.undertow.servlet                      : Initializing Spring DispatcherServlet 'dispatcherServlet'
lavalink   | 2024-04-09 22:54:01.509  INFO 1 --- [  XNIO-1 task-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
lavalink   | 2024-04-09 22:54:01.511  INFO 1 --- [  XNIO-1 task-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
lavalink   | 2024-04-09 22:54:01.534  INFO 1 --- [  XNIO-1 task-1] l.server.io.HandshakeInterceptorImpl     : Incoming connection from /192.168.240.2:58722
lavalink   | 2024-04-09 22:54:01.556  INFO 1 --- [  XNIO-1 task-1] lavalink.server.io.RequestLoggingFilter  : GET /, client=192.168.240.2
djs-bot    | [09.04.2024 - 22:54] [DEBUG] | Node: DockerNode | Lavalink node is connected.
djs-bot    | [09.04.2024 - 22:54] [INFO ] | Slash commands have been pushed to application
djs-bot    | [09.04.2024 - 22:54] [SILLY] | InsertNameHereBot/v5.5.1 (ID: XXXXXXXXXXXXXXXXXXX) is online!
lavalink   | 2024-04-09 22:54:01.847  INFO 1 --- [  XNIO-1 task-1] lavalink.server.io.SocketServer          : Connection successfully established from InsertNameHereBot/v5.5.1 (ID: XXXXXXXXXXXXXXXXXXX)
djs-bot    | prisma:info Starting a postgresql pool with 7 connections.
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Player: 759889672804630530 | A music player has been created in XXXXXXX
lavalink   | 2024-04-09 22:54:18.913  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"volume","guildId":"XXXXXXXXXXXXXXXXXX","volume":100}
lavalink   | 2024-04-09 22:54:18.914  WARN 1 --- [   XNIO-1 I/O-2] lavalink.server.io.WebSocketHandler      : Sending websocket commands to Lavalink has been deprecated and will be removed in API version 4. API version 3 will be removed in Lavalink 5. Please use the new REST endpoints instead.
lavalink   | 2024-04-09 22:54:19.134  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"voiceUpdate","guildId":"XXXXXXXXXXXXXXXXXX","sessionId":"259340cdcd1f0eb17d99a913265a6078","event":{"token":"XXXXXXXXXXXXXXXX","guild_id":"XXXXXXXXXXXXXXXXXX","endpoint":"frankfurt2292.discord.media:443"}}
lavalink   | 2024-04-09 22:54:19.738  INFO 1 --- [  XNIO-1 task-1] l.server.player.AudioLoaderRestHandler   : Got request to load for identifier "ytsearch:gangnam style"
lavalink   | 2024-04-09 22:54:20.333  INFO 1 --- [ader-2-thread-1] lavalink.server.player.AudioLoader       : Loaded playlist Search results for: gangnam style
lavalink   | 2024-04-09 22:54:20.423  INFO 1 --- [  XNIO-1 task-1] lavalink.server.io.RequestLoggingFilter  : GET /loadtracks?identifier=ytsearch%3Agangnam%20style, client=192.168.240.2
lavalink   | 2024-04-09 22:54:20.429  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"play","guildId":"XXXXXXXXXXXXXXXXXX","track":"QAAAjQIAKFBTWSAtIEdBTkdOQU0gU1RZTEUo6rCV64Ko7Iqk7YOA7J28KSBNL1YAC29mZmljaWFscHN5AAAAAAAD3EgACzliWmtwN3ExOWYwAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9OWJaa3A3cTE5ZjAAB3lvdXR1YmUAAAAAAAAAAA=="}
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Player: 759889672804630530 | Track has started playing [PSY - GANGNAM STYLE(강남스타일) M/V]
lavalink   | 2024-04-09 22:54:20.456  WARN 1 --- [back-1-thread-1] c.s.d.l.s.y.YoutubeAccessTokenTracker    : YouTube auth tokens can't be retrieved because email and password is not set in YoutubeAudioSourceManager, age restricted videos will throw exceptions.
lavalink   | 2024-04-09 22:54:20.882  INFO 1 --- [back-1-thread-1] c.s.d.l.s.y.YoutubeAccessTokenTracker    : Updating YouTube visitor id (current is null).
lavalink   | 2024-04-09 22:54:20.989  INFO 1 --- [back-1-thread-1] c.s.d.l.s.y.YoutubeAccessTokenTracker    : Updating YouTube visitor id succeeded, new one is CgtjTW03Mm11WTU5WSicjtewBjIOCgJCRxIIEgQSAgsMICI6CiDVivrnxuPximY%3D, next update will be after 600 seconds.
lavalink   | 2024-04-09 22:54:21.104  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"stop","guildId":"XXXXXXXXXXXXXXXXXX"}
djs-bot    | [09.04.2024 - 22:54] [ERROR] | Track has an error:
djs-bot    | [09.04.2024 - 22:54] [ERROR] | [object Object]
lavalink   | 2024-04-09 22:54:21.603  INFO 1 --- [   XNIO-1 I/O-2] lavalink.server.io.SocketServer          : {"op":"destroy","guildId":"XXXXXXXXXXXXXXXXXX"}
djs-bot    | [09.04.2024 - 22:54] [WARN ] | Player: XXXXXXXXXXXXXXXXXX | A music player has been destroyed in XXXXXXX
@Koko2110 Koko2110 changed the title [ERROR] | [FATAL] Possibly Uncaught ExceptionReason: ReferenceError: player is not defined [ERROR] | [FATAL] Possibly Uncaught Exception, Reason: ReferenceError: player is not defined Apr 9, 2024
@LewdHuTao
Copy link

Try use play command again, your lavalink connected right after you use the play command

@LewdHuTao
Copy link

Actually nvm i see the issues, update your jar use link below. Make sure use v3 jar

Screenshot_2024_0408_054214

@DarrenOfficial
Copy link
Member

Lavalink
Jars
v4: https://repo.lavalink.dev/artifacts/lavalink/fe62703c/Lavalink.jar
v3: https://repo.lavalink.dev/artifacts/lavalink/b0db58a0/Lavalink.jar

Docker
v4: https://github.com/lavalink-devs/Lavalink/pkgs/container/lavalink/197704996?tag=v4-update-lp
v3: https://github.com/lavalink-devs/Lavalink/pkgs/container/lavalink/197706659?tag=v3-update-lp

Lavaplayer
ADD THE SNAPSHOT REPOSITORY: https://maven.lavalink.dev/snapshots

FOR USERS OF 1.x
implementation 'dev.arbjerg:lavaplayer:0eaeee195f0315b2617587aa3537fa202df07ddc-SNAPSHOT'

FOR USERS OF 2.x
implementation 'dev.arbjerg:lavaplayer:afec211f05c9dcf0b6ee44276a02f0316ea2458a-SNAPSHOT'

@Koko2110
Copy link
Author

Thank you for your help. I seem to have assumed the proper Lavalink version came with the repo. Probably missed some note regarding this in the docs. I will try to check in the support server before I post here if I have issues in the future.

I replaced the image: line for the lavalink container in the docker/docker-compose.yml file with ghcr.io/lavalink-devs/lavalink:v3-update-lp and everything is okay now.

Thanks again.

@Koko2110
Copy link
Author

I thought I'd update this in case someone finds the solution I posted not working anymore.

It seems the lavalink devs changed their images in the repo around so you'll find ghcr.io/lavalink-devs/lavalink:v3-update-lp no longer being valid? The github link the previous reply mentions also shows "Tag 'v3-update-lp' does not exist for this package version" and the image name is now what seems to be a sha256 sum.

What I did to get it working again was to change the image: line to ghcr.io/lavalink-devs/lavalink@sha256:38e42ce67615efe6424b5e45c86daaf8a990c97ed09b6b2fe5f2b94d07a52406 . Not pleasant to look at, but oh well.

@LewdHuTao
Copy link

I thought I'd update this in case someone finds the solution I posted not working anymore.

It seems the lavalink devs changed their images in the repo around so you'll find ghcr.io/lavalink-devs/lavalink:v3-update-lp no longer being valid? The github link the previous reply mentions also shows "Tag 'v3-update-lp' does not exist for this package version" and the image name is now what seems to be a sha256 sum.

What I did to get it working again was to change the image: line to ghcr.io/lavalink-devs/lavalink@sha256:38e42ce67615efe6424b5e45c86daaf8a990c97ed09b6b2fe5f2b94d07a52406 . Not pleasant to look at, but oh well.

Just use the latest version image: fredboat/lavalink:3.7.12

@Koko2110
Copy link
Author

I thought I'd update this in case someone finds the solution I posted not working anymore.
It seems the lavalink devs changed their images in the repo around so you'll find ghcr.io/lavalink-devs/lavalink:v3-update-lp no longer being valid? The github link the previous reply mentions also shows "Tag 'v3-update-lp' does not exist for this package version" and the image name is now what seems to be a sha256 sum.
What I did to get it working again was to change the image: line to ghcr.io/lavalink-devs/lavalink@sha256:38e42ce67615efe6424b5e45c86daaf8a990c97ed09b6b2fe5f2b94d07a52406 . Not pleasant to look at, but oh well.

Just use the latest version image: fredboat/lavalink:3.7.12

I did try. It didn't help sadly. Maybe I will try purging the container again.

@LewdHuTao
Copy link

You need to install their new youtube source plugins as their old youtube source manager is deprecated https://github.com/lavalink-devs/youtube-source

@Koko2110
Copy link
Author

You need to install their new youtube source plugins as their old youtube source manager is deprecated https://github.com/lavalink-devs/youtube-source

Thanks for the heads up and for updating the application.yml. I've been trying to run it, however I am hit with a permission denied error that has me sort of stumped. I realize you are not the lavalink dev, but do you have any idea what is causing this? Just to be safe, I already purged the containers and rebuilt them, made sure my docker-compose.yml is up to date, but this is still what I get in the log:

lavalink   | 2024-05-16 18:42:17.630  INFO 1 --- [           main] lavalink.server.Launcher                 : Starting Launcher using Java 18.0.2.1 on docker.lavalink with PID 1 (/opt/Lavalink/Lavalink.jar started by lavalink in /opt/Lavalink)
lavalink   | 2024-05-16 18:42:17.642  INFO 1 --- [           main] lavalink.server.Launcher                 : No active profile set, falling back to 1 default profile: "default"
lavalink   | 2024-05-16 18:42:19.509  INFO 1 --- [           main] lavalink.server.bootstrap.PluginManager  : Downloading https://maven.lavalink.dev/releases/dev/lavalink/youtube/youtube-plugin/1.2.0/youtube-plugin-1.2.0.jar
lavalink   | 2024-05-16 18:42:20.597  WARN 1 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [lavalink.server.bootstrap.PluginManager$$EnhancerBySpringCGLIB$$fc257968]: Constructor threw exception; nested exception is java.io.FileNotFoundException: ./plugins/youtube-plugin-1.2.0.jar (Permission denied)
lavalink   | 2024-05-16 18:42:20.610  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 
lavalink   | 
lavalink   | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
lavalink   | 2024-05-16 18:42:20.667 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
lavalink   | 
lavalink   | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [lavalink.server.bootstrap.PluginManager$$EnhancerBySpringCGLIB$$fc257968]: Constructor threw exception; nested exception is java.io.FileNotFoundException: ./plugins/youtube-plugin-1.2.0.jar (Permission denied)
lavalink   | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:296) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.6.jar!/:2.6.6]
lavalink   | 	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.6.jar!/:2.6.6]
lavalink   | 	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.6.jar!/:2.6.6]
lavalink   | 	at lavalink.server.Launcher.launchPluginBootstrap(Launcher.kt:133) ~[classes!/:na]
lavalink   | 	at lavalink.server.Launcher.main(Launcher.kt:125) ~[classes!/:na]
lavalink   | 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[na:na]
lavalink   | 	at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
lavalink   | 	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[Lavalink.jar:na]
lavalink   | 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[Lavalink.jar:na]
lavalink   | 	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[Lavalink.jar:na]
lavalink   | 	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[Lavalink.jar:na]
lavalink   | Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [lavalink.server.bootstrap.PluginManager$$EnhancerBySpringCGLIB$$fc257968]: Constructor threw exception; nested exception is java.io.FileNotFoundException: ./plugins/youtube-plugin-1.2.0.jar (Permission denied)
lavalink   | 	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:311) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	... 23 common frames omitted
lavalink   | Caused by: java.io.FileNotFoundException: ./plugins/youtube-plugin-1.2.0.jar (Permission denied)
lavalink   | 	at java.base/java.io.FileOutputStream.open0(Native Method) ~[na:na]
lavalink   | 	at java.base/java.io.FileOutputStream.open(Unknown Source) ~[na:na]
lavalink   | 	at java.base/java.io.FileOutputStream.<init>(Unknown Source) ~[na:na]
lavalink   | 	at java.base/java.io.FileOutputStream.<init>(Unknown Source) ~[na:na]
lavalink   | 	at lavalink.server.bootstrap.PluginManager.downloadJar(PluginManager.kt:81) ~[classes!/:na]
lavalink   | 	at lavalink.server.bootstrap.PluginManager.manageDownloads(PluginManager.kt:74) ~[classes!/:na]
lavalink   | 	at lavalink.server.bootstrap.PluginManager.<init>(PluginManager.kt:26) ~[classes!/:na]
lavalink   | 	at lavalink.server.bootstrap.PluginManager$$EnhancerBySpringCGLIB$$fc257968.<init>(<generated>) ~[classes!/:na]
lavalink   | 	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source) ~[na:na]
lavalink   | 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) ~[na:na]
lavalink   | 	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:na]
lavalink   | 	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211) ~[spring-beans-5.3.18.jar!/:5.3.18]
lavalink   | 	... 25 common frames omitted
lavalink   | 
lavalink exited with code 0

@LewdHuTao
Copy link

If you use docker and have permission issues, this might help you

Screenshot_2024_0517_053226

@Koko2110
Copy link
Author

Thanks once again. I thought 600 would do it since that's what I had to do when setting up other docker projects, so it completely slipped my mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants