GitHub OAuth FileNotFoundException: https://api.github.com/user/orgs

153 views
Skip to first unread message

Ed Swierk

unread,
Nov 26, 2013, 12:59:02 AM11/26/13
to jenkins...@googlegroups.com
I had a Jenkins system all set up with authentication via GitHub OAuth, but today it suddenly stopped working. Whenever Jenkins attempts to authenticate a user, GitHub redirects back to http://jenkins.mycompany.com:8080/securityRealm/finishLogin?code=... and throws an exception:
java.io.FileNotFoundException: https://api.github.com/user/orgs
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1401)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
        at org.kohsuke.github.Requester.parse(Requester.java:298)
        ...
To convince myself I hadn't messed something up in my Jenkins config, I spun up a fresh Ubuntu 12.04 server, installed Jenkins 1.541 from the jenkins-ci.org apt repository, and installed the github-api (1.44) and github-oauth (0.14) plugins.

I created a brand-new application in my GitHub account and set http://jenkins.mycompany.com:8080 as the homepage URL and http://jenkins.mycompany.com:8080/securityRealm/finishLogin as the application callback URL.

I then set up the GitHub Authentication Plugin Security Realm with the Client ID and Client Secret from my GitHub application. I left the Web URI and API URI at their default values.

On this new server the result is exactly the same.

I do notice that the authorization scope GitHub is using is the default one for public read-only access (includes public user profile info, public repo info, and gists). So it makes sense that the /user/orgs query fails.

What's not clear is whether (1) Jenkins should be requesting a broader authorization scope, (2) GitHub should be returning a broader authorization scope, (3) Jenkins shouldn't even be attempting to enumerate /user/orgs, or (4) something else.

Any clues what the problem might be? Could this have something to do with it?


b0dh1

unread,
Nov 26, 2013, 6:14:00 AM11/26/13
to jenkins...@googlegroups.com
I saw exactly the same problem this morning in Jenkins 1.539. I decided to try to upgrade Jenkins to the newest version (1.541). Right after the upgrade the error happened again but then after some time it started to work fine. I'm not sure if upgrade actually helped or GitHub API was somehow fixed at that time - but now I can't reproduce the problem any longer.

вторник, 26 ноября 2013 г., 6:59:02 UTC+1 пользователь Ed Swierk написал:

Peter Miklosko

unread,
Nov 26, 2013, 6:20:10 AM11/26/13
to jenkins...@googlegroups.com
It looks like GitHub folks fixed them selfs. I was about to manually update plugin when I seen Jenkins could connect to github again.


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages