project-mirai / mirai-api-http

Mirai HTTP API (console) plugin
GNU Affero General Public License v3.0
1.66k stars 343 forks source link

无法正常载入mah,地址已被占用 #581

Closed ShiroDoMain closed 2 years ago

ShiroDoMain commented 2 years ago

运行mcl时mah无法载入,报错Address already in use,但是端口并没有被占用 log: 2022-06-12 14:43:52 I/Mirai HTTP API: **** 2022-06-12 14:43:52 I/http adapter: >>> [http adapter] is listening at http://localhost:9909 2022-06-12 14:43:52 E/MahKtorAdapter[ws]: java.net.BindException: Address already in use java.net.BindException: Address already in use at java.base/sun.nio.ch.Net.bind0(Native Method) at java.base/sun.nio.ch.Net.bind(Net.java:555) at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337) at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294) at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89) at io.ktor.network.sockets.ConnectUtilsJvmKt.bind(ConnectUtilsJvm.kt:32) at io.ktor.network.sockets.TcpSocketBuilder.bind(TcpSocketBuilder.kt:46) at io.ktor.network.sockets.TcpSocketBuilder.bind(TcpSocketBuilder.kt:30) at io.ktor.network.sockets.TcpSocketBuilder.bind$default(TcpSocketBuilder.kt:26) at mirai-api-http-v2.5.0.mirai.jar//io.ktor.server.cio.backend.HttpServerKt$httpServer$acceptJob$1.invokeSuspend(HttpServer.kt:46) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2022-06-12 14:43:52 E/net.mamoe.mirai-api-http: kotlinx.coroutines.JobCancellationException: LazyStandaloneCoroutine is cancelling; job=LazyStandaloneCoroutine{Cancelling}@5a515e5d kotlinx.coroutines.JobCancellationException: LazyStandaloneCoroutine is cancelling; job=LazyStandaloneCoroutine{Cancelled}@5a515e5d Caused by: java.net.BindException: Address already in use at java.base/sun.nio.ch.Net.bind0(Native Method) at java.base/sun.nio.ch.Net.bind(Net.java:555) at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337) at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294) at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89) at io.ktor.network.sockets.ConnectUtilsJvmKt.bind(ConnectUtilsJvm.kt:32) at io.ktor.network.sockets.TcpSocketBuilder.bind(TcpSocketBuilder.kt:46) at io.ktor.network.sockets.TcpSocketBuilder.bind(TcpSocketBuilder.kt:30) at io.ktor.network.sockets.TcpSocketBuilder.bind$default(TcpSocketBuilder.kt:26) at mirai-api-http-v2.5.0.mirai.jar//io.ktor.server.cio.backend.HttpServerKt$httpServer$acceptJob$1.invokeSuspend(HttpServer.kt:46) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

mah配置截图: image

mirai组件版本截图: image

报错截图: image 端口信息截图: image

ShiroDoMain commented 2 years ago

jdk版本为openjdk17

ShiroDoMain commented 2 years ago

运行环境为Ubuntu 20.04LTS,但是在本地Windows环境上启动一切正常

ryoii commented 2 years ago

别的端口呢

ShiroDoMain commented 2 years ago

别的端口呢

尝试过了,还是报错Address already in use

ShiroDoMain commented 2 years ago

重装系统后解决(