[Audio/Lavalink] ValueError: I/O operation on closed pipe when shutdown/restart while using default Java executable (solution inside) #6523
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#6523
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What Red version are you using?
3.5.16
What were you trying to do?
Shutdown the bot to update from 3.5.15 to 3.5.16
What did you expect to happen?
Shutdown peacefully and then restart the bot and Lavalink
What actually happened?
It occurred to me that one of my RedBot instances was raising error at asyncio:
which failed to terminate java.exe and blocked the port, making it impossible to restart Lavalink.
How can we reproduce this error?
!llset javato set to the default java executable. The default executable for me wasC:\Program Files\Common Files\Oracle\Java\javapath\java.EXE!shutdownor!restartAnything else?
Temporary solution: Change your Java executable to Java 11.
This error did not happen on the instance that uses a different Java executable (jdk-11.0.16). No error occurred when shutting down/restarting while using this version of java.exe. I lost an hour and a half because I thought the problem was the port or the Lavalink.exe.
Analyse:
C:\Program Files\Common Files\Oracle\Java\javapath\java.exeist kein echtes Java, sondern ein Starter von Oracle, der die eigentlichejava.exeals Kindprozess startet. Audio beendet beim Shutdown nur den Starter (terminate()), das echte Java läuft weiter und blockiert den Port. Workaround: Mit[p]llset javadirekt auf diejava.exeim JDK-Ordner zeigen (z. B.C:\Program Files\Eclipse Adoptium\jdk-17...\bin\java.exe). Ein richtiger Fix wäre, unter Windows den ganzen Prozessbaum zu beenden oder den javapath-Starter beim Setzen zu erkennen. Das kann ich hier nicht unter Windows testen, deshalb bleibt das Issue offen.Generated by Claude Code
Erledigt in
c73e0b1c9. Behoben: Unter Windows beendet Audio den Lavalink-Prozess jetzt samt Prozessbaum (taskkill /T /F). Auch beim Oracle-Starterjavapath\java.exeläuft danach kein Java-Prozess mehr weiter, der den Port blockiert. Unter Linux und macOS bleibt es beiterminate().Generated by Claude Code