ghprb: FileNotFoundException thrown when creating commit status
When the build process is triggered by a pull request made by a user in our Github organization, this exception message invariably appears in the console log. It is not a critical bug as we are able to deploy our app through the build process without any problems. Right now we are using Jenkins to deploy staging apps. However, this may be a potential problem and in that case, we don’t want this exception issue to mess with our build process for production apps. We are using an access token from a bot that’s a member of our Github organization. I am guessing the ghprb plugin fails to include the access token when it makes calls to the Github API, resulting in this response:
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3"
}
The cause could be due to some of the updated plugin dependencies (we have updated all the plugins that we have) which break the ghprb build.
Exception message:
GitHub pull request #836 of commit d8a115d262b237d4cbd542bb04b63f84f0d40f28 automatically merged.
Setting status of d8a115d262b237d4cbd542bb04b63f84f0d40f28 to PENDING with url http://localhost:38080/job/hoteru-staging-all-branches/147/ and message: Merged build started.
FileNotFoundException means that the credentials Jenkins is using is probably wrong. Or that something is really wrong with github.
java.io.FileNotFoundException: https://api.github.com/repos/wego/hoteru/statuses/d8a115d262b237d4cbd542bb04b63f84f0d40f28
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1624)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.kohsuke.github.Requester.parse(Requester.java:383)
at org.kohsuke.github.Requester._to(Requester.java:185)
at org.kohsuke.github.Requester.to(Requester.java:160)
at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:702)
at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:714)
at org.jenkinsci.plugins.ghprb.GhprbRepository.createCommitStatus(GhprbRepository.java:140)
at org.jenkinsci.plugins.ghprb.GhprbRepository.createCommitStatus(GhprbRepository.java:122)
at org.jenkinsci.plugins.ghprb.GhprbBuilds.onStarted(GhprbBuilds.java:81)
at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onStarted(GhprbBuildListener.java:19)
at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onStarted(GhprbBuildListener.java:12)
at hudson.model.listeners.RunListener.fireStarted(RunListener.java:213)
at hudson.model.Run.execute(Run.java:1714)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 26 (2 by maintainers)
Commits related to this issue
- Fix issue #232 due to changes in underlying api — committed to hcldan/ghprb by deleted user 9 years ago
- Fix issue #232 due to changes in underlying api — committed to hcldan/ghprb by deleted user 9 years ago
- Merge pull request #86 from ddumontatibm/master Fix issue janinko/ghprb#232 due to changes in underlying api — committed to jenkinsci/ghprb-plugin by DavidTanner 9 years ago
- Merge pull request #232 from janinko/master Combine forks — committed to AtkinsChang/ghprb by DavidTanner 9 years ago
- Merge pull request #86 from ddumontatibm/master Fix issue janinko/ghprb#232 due to changes in underlying api — committed to nosmo/ghprb-plugin by DavidTanner 9 years ago
- add rhoar-bot as GitHub Pull Request Builder admin For some reason, GHPRB isn't able to change commit status in GitHub without this change. See also [1] or [2]. [1] https://github.com/janinko/ghprb/... — committed to rhoar-ci/jenkins-jobs by Ladicek 5 years ago
For us it turned out that we had the right permissions for the app, but the user didn’t have write access to the repository we were trying to update.
There is something weirder going on with the credential integration. If I click on the “add credentials” button on the page, and add a credential, it does not show up in the dropdown menu. Refreshing the page does not help. Adding it via the global credentials menu does work (once), but only for a username/password combo. Secret text credentials do not show up in the dropdown menu no matter what you do, even though the wiki page says they should work.
I had same issue and problem was that team didn’t have repository permission. I had to open
/orgs/<organization>/teams/<team>/repositories, and add repository to specific team.Ran into this as well. Fix for us was to set the username in the “Admin list” section of the job config to the username of the user whose token we are associating with the plugin. Very strange.