Wavelink icon indicating copy to clipboard operation
Wavelink copied to clipboard

Lavalink Node Not Connecting in Wavelink 3.5.0

Open haakon-ivy opened this issue 8 months ago • 2 comments

Description: I've been troubleshooting this issue for to long, and I still cannot get Wavelink to connect to my Lavalink server. My bot starts up fine, but Wavelink just does not connect at all. It doesn't show any explicit connection errors, but when I try to play music, it says no nodes are connected.

Lavalink is running and accessible from the browser, so the server itself is working. When I check with netstat -ano | findstr :25432, it confirms that Lavalink is listening on the expected port. Also, if I go to http://127.0.0.1:25432 in my browser, it shows that Lavalink is receiving GET requests.

However, Wavelink does not connect at all.

Error when trying to play music: "An error occurred: Command raised an exception: InvalidNodeException: No nodes are currently assigned to the wavelink.Pool in a CONNECTED state."

What I’ve Tried: I uninstalled and reinstalled Wavelink multiple times using the latest version. I checked that my config.json has the correct Lavalink details (127.0.0.1:25432, correct password). I verified that Lavalink is running on the correct port and is accessible from the browser. I restarted the bot and my PC multiple times. I made sure that my bot is not using outdated NodePool methods. I confirmed that no firewall is blocking Lavalink. I also tried installing Wavelink directly from GitHub to make sure I have the latest version. Config Details: Here’s how my Lavalink details are set up:

Bot Config (config.json)

Token: My bot token Prefix: ? Lavalink host: 127.0.0.1 Lavalink port: 25432 Lavalink password: The correct password Lavalink Server Config (application.yml)

Port: 25432 Address: 127.0.0.1 Password: Same password as in the bot config YouTube, SoundCloud, Twitch, etc., are all enabled Spotify client ID and secret are set correctly Logging is set to DEBUG Bot Code (Connecting to Lavalink)

The bot calls wavelink.Pool.create_nodes to connect to Lavalink. It uses http://127.0.0.1:25432 with the correct password. The function runs when the bot starts (on_ready event). Final Notes: I have tried everything I could find online, but Lavalink still refuses to connect in Wavelink.

Is Wavelink 3.5.0 fully compatible with Lavalink v4? Are there any breaking changes between Wavelink 3.5.0 and Lavalink v3/v4? Should I downgrade to Wavelink 3.4.1 or Lavalink v3? Would really appreciate any insights or fixes. Thanks in advance!

haakon-ivy avatar Mar 09 '25 20:03 haakon-ivy

Wavelink 3.x was written entirely for Lavalink 4. Wavelink 2.x only worked for Lavalink 3, and both of these are unmaintained.

Copy pasting the sample from the github repo should just work as long as the uri="http://...."

Are you sure you have the application.yaml in the correct working directory of the Lavalink.jar and you are running Lavalink from inside the directory it lives in? Have you tried setting Lavalink host to 0.0.0.0 and the uri? Are you running Lavalink inside a container?

I suggest you join the Discord for further help as we would need to see exactly what you are doing.

chillymosh avatar Mar 09 '25 20:03 chillymosh

Try this

            node: wavelink.Node = wavelink.Node(
                uri=f"ws://{os.getenv('LAVALINK_HOST')}:{os.getenv('LAVALINK_PORT')}",
                password=os.getenv('LAVALINK_PASSWORD')
            )
            await wavelink.Pool.connect(nodes=[node], client=self)
            print(f"Connected success to Lavalink in{node.uri}")
        except Exception as e:
            print(f"Error: {e}")
            return

Jaie55 avatar Mar 10 '25 00:03 Jaie55