What is the reason for this error and how can I fix it?
root@BOT:~/BOT# bash start.sh
[main] INFO com.namelessmc.bot.Main - Starting Nameless Link version 5
[main] INFO com.namelessmc.bot.connections.StorageInitializer - Environment variable SHARDS not set, using default value 1
[main] INFO com.namelessmc.bot.Main - Initializing shard 0
[JDA [0 / 1] RateLimit-Elastic-Worker 1] ERROR net.dv8tion.jda.internal.requests.Requester - There was an I/O error while executing a REST request: Read timed out
Exception in thread "main" net.dv8tion.jda.api.exceptions.ErrorResponseException: -1: java.net.SocketTimeoutException
at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:233)
at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:639)
at net.dv8tion.jda.internal.JDAImpl.verifyToken(JDAImpl.java:403)
at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:327)
at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:293)
at net.dv8tion.jda.api.JDABuilder.build(JDABuilder.java:1847)
at com.namelessmc.bot.Main.main(Main.java:155)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:278)
at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:304)
at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:796)
at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1099)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:489)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:483)
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1506)
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1421)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:379)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:337)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:209)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:202)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:276)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:157)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:140)
at net.dv8tion.jda.internal.requests.Requester$WorkTask.execute(Requester.java:406)
at net.dv8tion.jda.api.requests.SequentialRestRateLimiter$Bucket.execute(SequentialRestRateLimiter.java:478)
at net.dv8tion.jda.api.requests.SequentialRestRateLimiter$Bucket.run(SequentialRestRateLimiter.java:518)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Suppressed: java.net.SocketTimeoutException: Read timed out
... 40 more
Suppressed: java.net.SocketTimeoutException: Read timed out
... 40 more
Suppressed: java.net.SocketTimeoutException: Read timed out
... 40 more
Suppressed: java.net.SocketTimeoutException: Read timed out
... 40 more
Caused by: net.dv8tion.jda.api.exceptions.ContextException
at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
at net.dv8tion.jda.api.requests.Request.<init>(Request.java:78)
at net.dv8tion.jda.api.requests.RestFuture.<init>(RestFuture.java:40)
at net.dv8tion.jda.internal.requests.RestActionImpl.submit(RestActionImpl.java:215)
at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:225)
at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:639)
at net.dv8tion.jda.internal.JDAImpl.verifyToken(JDAImpl.java:403)
at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:327)
at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:293)
at net.dv8tion.jda.api.JDABuilder.build(JDABuilder.java:1847)
at com.namelessmc.bot.Main.main(Main.java:155)
It looks like your Nameless Link bot is failing to start due to a socket timeout error when trying to connect to Discord's API.
Check your firewall and that you're using the correct bot token.
It looks like your Nameless Link bot is failing to start due to a socket timeout error when trying to connect to Discord's API.
Check your firewall and that you're using the correct bot token.
I tried but it didn't work.
Even Docker has this problem.
root@BOT:~/BOT# docker compose up
[+] Running 1/0
✔ Container bot-link-1 Recreated 0.0s
Attaching to bot-link-1
bot-link-1 | [main] INFO Core - Starting Nameless Link version 4
bot-link-1 | [main] INFO Configuration - Environment variable DEFAULT_LANGUAGE not set, using default value 'en_UK'
bot-link-1 | [main] INFO Configuration - Environment variable SHARDS not set, using default value 1
bot-link-1 | [main] INFO Core - Initializing shard 0
bot-link-1 | [java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out]
bot-link-1 | [java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out, java.net.SocketTimeoutException: Read timed out]
bot-link-1 | [JDA [0 / 1] RateLimit-Worker 1] ERROR net.dv8tion.jda.internal.requests.Requester - There was an I/O error while executing a REST request: Read timed out
bot-link-1 | Exception in thread "main"
bot-link-1 | net.dv8tion.jda.api.exceptions.ErrorResponseException: -1: java.net.SocketTimeoutException
bot-link-1 | at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:227)
bot-link-1 | at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:632)
bot-link-1 | at net.dv8tion.jda.internal.JDAImpl.verifyToken(JDAImpl.java:407)
bot-link-1 | at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:331)
bot-link-1 | at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:297)
bot-link-1 | at net.dv8tion.jda.api.JDABuilder.build(JDABuilder.java:1828)
bot-link-1 | at com.namelessmc.bot.Main.main(Main.java:158)
bot-link-1 | Caused by: java.net.SocketTimeoutException: Read timed out
bot-link-1 | at java.base/sun.nio.ch.NioSocketImpl.timedRead(NioSocketImpl.java:288)
bot-link-1 | at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:314)
bot-link-1 | at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:355)
bot-link-1 | at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:808)
bot-link-1 | at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:484)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:478)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:160)
bot-link-1 | at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1510)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455)
bot-link-1 | at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426)
bot-link-1 | at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.kt:379)
bot-link-1 | at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.kt:337)
bot-link-1 | at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:209)
bot-link-1 | at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
bot-link-1 | at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
bot-link-1 | at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
bot-link-1 | at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
bot-link-1 | at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
bot-link-1 | at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
bot-link-1 | at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
bot-link-1 | at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
bot-link-1 | at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
bot-link-1 | at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
bot-link-1 | at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
bot-link-1 | at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
bot-link-1 | at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
bot-link-1 | at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
bot-link-1 | at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:190)
bot-link-1 | at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:264)
bot-link-1 | at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:145)
bot-link-1 | at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:128)
bot-link-1 | at net.dv8tion.jda.internal.requests.Requester$WorkTask.execute(Requester.java:378)
bot-link-1 | at net.dv8tion.jda.api.requests.SequentialRestRateLimiter$Bucket.execute(SequentialRestRateLimiter.java:450)
bot-link-1 | at net.dv8tion.jda.api.requests.SequentialRestRateLimiter$Bucket.run(SequentialRestRateLimiter.java:494)
bot-link-1 | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
bot-link-1 | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
bot-link-1 | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
bot-link-1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
bot-link-1 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
bot-link-1 | at java.base/java.lang.Thread.run(Thread.java:840)
bot-link-1 | Suppressed: java.net.SocketTimeoutException: Read timed out
bot-link-1 | ... 43 more
bot-link-1 | Suppressed: java.net.SocketTimeoutException: Read timed out
bot-link-1 | ... 43 more
bot-link-1 | Suppressed: java.net.SocketTimeoutException: Read timed out
bot-link-1 | ... 43 more
bot-link-1 | Suppressed: java.net.SocketTimeoutException: Read timed out
bot-link-1 | ... 43 more
bot-link-1 | Caused by: net.dv8tion.jda.api.exceptions.ContextException
bot-link-1 | at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
bot-link-1 | at net.dv8tion.jda.api.requests.Request.<init>(Request.java:72)
bot-link-1 | at net.dv8tion.jda.api.requests.RestFuture.<init>(RestFuture.java:35)
bot-link-1 | at net.dv8tion.jda.internal.requests.RestActionImpl.submit(RestActionImpl.java:209)
bot-link-1 | at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:219)
bot-link-1 | at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:632)
bot-link-1 | at net.dv8tion.jda.internal.JDAImpl.verifyToken(JDAImpl.java:407)
bot-link-1 | at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:331)
bot-link-1 | at net.dv8tion.jda.internal.JDAImpl.login(JDAImpl.java:297)
bot-link-1 | at net.dv8tion.jda.api.JDABuilder.build(JDABuilder.java:1828)
bot-link-1 | at com.namelessmc.bot.Main.main(Main.java:158)
bot-link-1 exited with code 0
Looks like your machine is unable to connect to Discord servers
The issue is network-related, probably check with your VPS provider. Basically, your bot isn’t getting a response from Discord’s API. The issue is not specific to JDA, or the Nameless-Link code.
Try running:
curl -I https://google.com curl -I https://discord.com/api/v10
If none of them work, it's the network that's causing the issue. If google.com works but discord.com fails, it’s due to firewall or IP block affecting discord's domains.
But I assume this issue can be closed? Pretty inactive and a machine issue, not related to the code or the repo.