[JIRA] [github-organization-folder-plugin] (JENKINS-34612) Jenkins 2.1 not registering GitHub org webhooks: "WARNING: Failed to register GitHub Org hook to ..."

75 views
Skip to first unread message

karlmdavis@java.net (JIRA)

unread,
May 4, 2016, 4:15:01 PM5/4/16
to jenkinsc...@googlegroups.com
karlmdavis created an issue
 
Jenkins / Bug JENKINS-34612
Jenkins 2.1 not registering GitHub org webhooks: "WARNING: Failed to register GitHub Org hook to ..."
Issue Type: Bug Bug
Assignee: Kohsuke Kawaguchi
Components: github-organization-folder-plugin
Created: 2016/May/04 8:14 PM
Environment: Jenkins 2.1, github-organization-folder 1.3, github-api 1.75
Priority: Minor Minor
Reporter: karlmdavis

When creating a new job for a GitHub org, I'm seeing the following in the Jenkins logs:

WARNING: Failed to register GitHub Org hook to https://github.com/karlmdavis (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
May 04, 2016 8:03:46 PM org.jenkinsci.plugins.orgfolder.github.MainLogic applyOrg
WARNING: Failed to register GitHub Org hook to https://github.com/HHSIDEAlab (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

I did confirm that the personal access token I'm using has the admin:repo_hook permission, as well as admin:org_hook. Not sure what else to check.

The plugin seems to work correctly aside from this: it finds projects with {{Jenkinsfile}}s and builds them when asked. Just no webhook triggers.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

karlmdavis@java.net (JIRA)

unread,
May 4, 2016, 4:44:01 PM5/4/16
to jenkinsc...@googlegroups.com
karlmdavis updated an issue
Change By: karlmdavis
When creating a new job for a GitHub org, I'm seeing the following in the Jenkins logs:

{code}

WARNING: Failed to register GitHub Org hook to https://github.com/karlmdavis (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
May 04, 2016 8:03:46 PM org.jenkinsci.plugins.orgfolder.github.MainLogic applyOrg
WARNING: Failed to register GitHub Org hook to https://github.com/HHSIDEAlab (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
{code}

I did confirm that the personal access token I'm using has the {{admin:repo_hook}} permission, as well as {{admin:org_hook}}. Not sure what else to check.


The plugin seems to work correctly aside from this: it finds projects with {{Jenkinsfile}}s and builds them when asked. Just no webhook triggers.

karlmdavis@java.net (JIRA)

unread,
May 4, 2016, 4:50:02 PM5/4/16
to jenkinsc...@googlegroups.com
karlmdavis commented on Bug JENKINS-34612
 
Re: Jenkins 2.1 not registering GitHub org webhooks: "WARNING: Failed to register GitHub Org hook to ..."

Blargh, I just figured out what the problem was. Hat tip to this fine fellow for the clue I needed: https://github.com/juretta/hudson-github-plugin/issues/4#issuecomment-56458604. The bug is actually a case-sensitivity issue.

The log entries I included in my issue description were a red herring: a webhook was automatically created (I just missed it), and was being fired from GitHub as expected, and was even being received by Jenkins. Unfortunately, though, Jenkins was ignoring the hook events, because my organization name in Jenkins was cased as HHSIDEALab, rather than as HHSIDEAlab (which is how it's cased in GitHub and in the hook events).

Hilariously, this blew a whole day for me. I know it's a super minor problem in the grand scheme of things, but if you folks could fix the issue, or at least add a useful error/warning in the logs, that'd be super helpful to "future me"s.

simon.so@gmail.com (JIRA)

unread,
May 6, 2016, 5:14:03 PM5/6/16
to jenkinsc...@googlegroups.com
Simon So commented on Bug JENKINS-34612

Unbelievable. Thank you karlmdavis! Cost me probably a day as well, could have been worse!

sorin.sbarnea@gmail.com (JIRA)

unread,
Jun 30, 2016, 9:08:01 AM6/30/16
to jenkinsc...@googlegroups.com

In my case, it was not that. It seems that the only way to avoid this error is to add the Jenkins user as an organisation owner. Being an admin is not enough, it has to be an owner, which is really worrying as an owner can wipe the entire organisation with two clicks.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

sorin.sbarnea@gmail.com (JIRA)

unread,
Jul 21, 2016, 8:15:03 AM7/21/16
to jenkinsc...@googlegroups.com

I really doubt this is about case-sensitivity here because I get the same message even if the organization name and full-name do match on both Jenkins job and GitHub. Both strings are identical, same case, no special characters or prefix or suffix spaces.

{{Failed to register GitHub Org hook to https://github.com/bmlltech (missing permissions?):

{"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

}}

sorin.sbarnea@gmail.com (JIRA)

unread,
Jul 21, 2016, 8:15:03 AM7/21/16
to jenkinsc...@googlegroups.com
Sorin Sbarnea edited a comment on Bug JENKINS-34612
I really doubt this is about case-sensitivity here because I get the same message even if the organization name and full-name  do match on both Jenkins job and GitHub. Both strings are identical, same case, no special characters or prefix or suffix spaces.

{ { code}
Failed to register GitHub Org hook to https://github.com/bmlltech (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}

{code
} }

sorin.sbarnea@gmail.com (JIRA)

unread,
Jul 21, 2016, 8:16:01 AM7/21/16
to jenkinsc...@googlegroups.com
Sorin Sbarnea edited a comment on Bug JENKINS-34612
I really doubt this is about case-sensitivity here because I get the same message even if the organization name and full-name  do match on both Jenkins job and GitHub. Both strings are identical, same case, no special characters or prefix or suffix spaces.

{code}
Failed to register GitHub Org hook to https://github.com/ bmlltech bmlltest (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
{code}

ybian@me.com (JIRA)

unread,
Aug 3, 2016, 8:14:01 AM8/3/16
to jenkinsc...@googlegroups.com

Same issue here. And I believe it is not case-sensitivity issue in my case.

gpt@gtirloni.com (JIRA)

unread,
Aug 4, 2016, 4:20:02 PM8/4/16
to jenkinsc...@googlegroups.com

Same issue encountered on the following environment:

Jenkins 2.16
GitHub API Plugin 1.76
GitHub Branch Source Plugin 1.8.1
GitHub Organization Folder Plugin 1.4
GitHub plugin 1.20.0
Pipeline 2.2

Stack trace:

Aug 04, 2016 8:14:26 PM WARNING org.jenkinsci.plugins.orgfolder.github.MainLogic applyOrg
Failed to register GitHub Org hook to https://github.com/crash-test-dummies (missing permissions?): {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
Aug 04, 2016 8:14:26 PM FINE org.jenkinsci.plugins.orgfolder.github.MainLogic
null
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
	at org.kohsuke.github.Requester.handleApiError(Requester.java:553)
	at org.kohsuke.github.Requester._to(Requester.java:264)
	at org.kohsuke.github.Requester.to(Requester.java:205)
	at org.kohsuke.github.GHHooks$Context.getHooks(GHHooks.java:25)
	at org.kohsuke.github.GHOrganization.getHooks(GHOrganization.java:276)
	at org.jenkinsci.plugins.orgfolder.github.MainLogic.existsHook(MainLogic.java:198)
	at org.jenkinsci.plugins.orgfolder.github.MainLogic.applyOrg(MainLogic.java:89)
	at org.jenkinsci.plugins.orgfolder.github.ItemListenerImpl.maybeApply(ItemListenerImpl.java:41)
	at org.jenkinsci.plugins.orgfolder.github.ItemListenerImpl.onUpdated(ItemListenerImpl.java:29)
	at hudson.model.listeners.ItemListener$3.apply(ItemListener.java:195)
	at hudson.model.listeners.ItemListener$3.apply(ItemListener.java:193)
	at hudson.model.listeners.ItemListener.forAll(ItemListener.java:167)
	at hudson.model.listeners.ItemListener.fireOnUpdated(ItemListener.java:193)
	at com.cloudbees.hudson.plugins.folder.AbstractFolder.save(AbstractFolder.java:667)
	at hudson.util.PersistedList.onModified(PersistedList.java:173)
	at hudson.util.PersistedList._onModified(PersistedList.java:181)
	at hudson.util.PersistedList.add(PersistedList.java:72)
	at jenkins.branch.CustomOrganizationFolderDescriptor.newInstance(CustomOrganizationFolderDescriptor.java:109)
	at hudson.model.ItemGroupMixIn.createProject(ItemGroupMixIn.java:323)
	at hudson.model.ItemGroupMixIn.createTopLevelItem(ItemGroupMixIn.java:203)
	at jenkins.model.Jenkins.doCreateItem(Jenkins.java:3669)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
	at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:52)
	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: https://api.github.com/orgs/crash-test-dummies/hooks
	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:240)
	at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
	at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
	at org.kohsuke.github.Requester.parse(Requester.java:492)
	at org.kohsuke.github.Requester._to(Requester.java:243)
	... 85 more

gpt@gtirloni.com (JIRA)

unread,
Aug 4, 2016, 4:42:05 PM8/4/16
to jenkinsc...@googlegroups.com
Giovanni Tirloni edited a comment on Bug JENKINS-34612
Same issue encountered on the following environment:

Jenkins 2.16
GitHub API Plugin 1.76
GitHub Branch Source Plugin 1.8.1
GitHub Organization Folder Plugin 1.4
GitHub plugin 1.20.0
Pipeline 2.2

Steps to reproduce:

1 - New Item
2 - Enter GitHub organization name
3 - Select "GitHub organization"
4 - Click OK

Details:

1 - Issue happens with and without a GitHub server added to Jenkins with the proper credentials.
2 - Making user an owner or admin of the GH organization does not help.

Stack trace:

{noformat}
{noformat}


gpt@gtirloni.com (JIRA)

unread,
Aug 4, 2016, 5:14:10 PM8/4/16
to jenkinsc...@googlegroups.com

gpt@gtirloni.com (JIRA)

unread,
Aug 4, 2016, 5:19:01 PM8/4/16
to jenkinsc...@googlegroups.com
Giovanni Tirloni edited a comment on Bug JENKINS-34612
I can confirm that once user is made *owner *of the GH organization, then even with the initial errors (due to unauthenticated requests), the Webhook *is* properly added if the proper credential is specified when adding the new item.

gpt@gtirloni.com (JIRA)

unread,
Aug 4, 2016, 5:19:01 PM8/4/16
to jenkinsc...@googlegroups.com

I can confirm that once user is made owner *of the GH organization, then even with the initial errors (due to unauthenticated requests), the Webhook *is properly added if the proper credential is specified when adding the new item.

draganHR@gmail.com (JIRA)

unread,
Nov 25, 2016, 12:05:02 PM11/25/16
to jenkinsc...@googlegroups.com

Confirming Giovanni Tirloni's findings, being organization admin wasn't enough, after making user an organization owner, webhook was created.

stephen.alan.connolly@gmail.com (JIRA)

unread,
Dec 19, 2016, 5:40:03 AM12/19/16
to jenkinsc...@googlegroups.com
Stephen Connolly resolved as Won't Fix
 

The GitHub Org Folders plugin is being tombstoned.

The functionality provided by the GitHub Org Folders plugin has been significantly refactored and migrated to the GitHub Branch Source plugin.

Please verify if this issue is an issue with GitHub Branch Source 2.0.0-beta-1 (available from the experimental update center now or 2.0.0 (available in early January 2017)

Change By: Stephen Connolly
Status: Open Resolved
Resolution: Won't Fix
Reply all
Reply to author
Forward
0 new messages