JnCrMx / ChocoBot

Just a small Discord bot.
MIT License
1 stars 1 forks source link

Issue Event Polling: 401 Unauthorized #18

Closed JnCrMx closed 4 years ago

JnCrMx commented 4 years ago

javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized when polling for issue events

probably thrown by

https://github.com/JnCrMx/ChocoBot/blob/b2e6cf9f0ed03c0e0fb482ca7ece79727af03571/src/main/java/de/jcm/discord/chocobot/GitHubApp.java#L149

possible causes:

further investigation needed

Stacktrace:

 javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
         at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1056)
         at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:859)
         at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:743)
         at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
         at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
         at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
         at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:390)
         at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:741)
         at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:404)
         at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:300)
         at de.jcm.discord.chocobot.GitHubApp.getIssueEvents(GitHubApp.java:159)
         at de.jcm.discord.chocobot.IssueEventRunnable.run(IssueEventRunnable.java:58)
         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
JnCrMx commented 4 years ago

Seems to be only a temporal inconvenience. Closing for now. Reopen if it occurs again.

JnCrMx commented 4 years ago

still occurring, look into GitHub's rate limits, ok?

JnCrMx commented 4 years ago

have a look at https://developer.github.com/v3/#rate-limiting and https://developer.github.com/v3/#conditional-requests

JnCrMx commented 4 years ago

but with rate limits it would return 403 not 401... maybe some problem about authorization tokens... dunno

JnCrMx commented 4 years ago

I did a stupid mistake and mixed up isAfter and isBefore. Fixed in 7ea2f6be09df34d98e26042c10927593d706d1db