Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

DiscordConnector irregularly throws AccessControlExceptions #58

Closed
J0B10 opened this issue Jun 17, 2019 · 2 comments
Closed

DiscordConnector irregularly throws AccessControlExceptions #58

J0B10 opened this issue Jun 17, 2019 · 2 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@J0B10
Copy link
Member

J0B10 commented Jun 17, 2019

Description

During tests I now encountered an AccessControlException multiple times.
Often (but not allways) the first thing throwing the exception is one of JDAs RateLimit-Workers.
I suspect that it has some problems with the SandboxSecurityManager but I couldn't figure out till now what is actually causing it.

As I tried debugging it completly disappeared and till now didn't occur again.
We even did some heavy spaming with the badge bot to provoke some errors, but everything was working fine again.

Stack trace

8483295 15:47:25.857 [ForkJoinPool.commonPool-worker-8] WARN  discord.DiscordChatConnector  - Rest action for connector badge bot failed: -1: java.security.AccessControlException
8586147 15:49:08.709 [JDA MainWS-ReadThread] INFO  manager.PluginManagerImpl  - [badges] Created sub badge for Shatox, saved it under subbadgetemp/Shatox _1.png
8586148 15:49:08.710 [JDA RateLimit-Worker 5] ERROR requests.Requester  - There was an exception while executing a REST request
java.security.AccessControlException: access denied ("java.net.SocketPermission" "discordapp.com" "resolve")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.security.AccessController.checkPermission(AccessController.java:884)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at java.lang.SecurityManager.checkConnect(SecurityManager.java:1048)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1269)
	at java.net.InetAddress.getAllByName(InetAddress.java:1193)
	at java.net.InetAddress.getAllByName(InetAddress.java:1127)
	at okhttp3.Dns.lambda$static$0(Dns.java:39)
	at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:185)
	at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:149)
	at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:84)
	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:214)
	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:264)
	at okhttp3.RealCall.execute(RealCall.java:93)
	at net.dv8tion.jda.core.requests.Requester.execute(Requester.java:191)
	at net.dv8tion.jda.core.requests.Requester.execute(Requester.java:133)
	at net.dv8tion.jda.core.requests.Requester.execute(Requester.java:116)
	at net.dv8tion.jda.core.requests.ratelimit.BotRateLimiter$Bucket.run(BotRateLimiter.java:350)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
@J0B10 J0B10 added bug Something isn't working help wanted Extra attention is needed labels Jun 17, 2019
@J0B10 J0B10 self-assigned this Jun 17, 2019
@sebinside
Copy link
Member

By reading the error message: Pretty sure thats a sandbox problem. The RateLimit-Worker sends a REST request which is blocked.

The strange thing: If the origin of this request is the connector (e.g. the bot), everything should work fine. I could imagine that the request is an (unprivileged) side effect of a (privileged) bot action. That would be a problem :D

@J0B10
Copy link
Member Author

J0B10 commented Oct 31, 2019

Now didn't happen for >4 months.

When it reoccurs we'll reopen it.

@J0B10 J0B10 closed this as completed Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants