Articles on: Bots & Applications

Lavalink closed abnormally (1006): how to fix

What this error means


When your music bot tries to connect to its Lavalink server hosted on Square Cloud, the connection drops immediately:


Error: Unexpected server response: 400
Error: WebSocket closed abnormally with code 1006.


Why it happens


This is almost always a version mismatch between Lavalink and the client (wrapper) your bot uses. For example, Lavalink v4 is fully REST-based and is not compatible with a v3 client — the handshake fails and the WebSocket closes with code 1006.


How to fix it


1. Match the versions. Update your Lavalink client to the latest release, or run a Lavalink version that's compatible with your current client. Check your wrapper's documentation for the supported Lavalink major version.


2. Configure the ports correctly on Square Cloud:


  • Open the Lavalink server on port 80.
  • Connect to it using port 443 with the secure: true option enabled in your client.


3. Restart both the Lavalink application and your bot.



Hosting the bot itself? See How to host a Discord bot. To keep both the bot and the Lavalink server online without interruptions, see How to keep bots online 24/7.


Updated on: 06/13/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!