[JIRA] (JENKINS-59321) github-branch-source plugin throws InvocationTargetException when creating

1 view
Skip to first unread message

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 1:05:02 PM9/13/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
 
Jenkins / Bug JENKINS-59321
github-branch-source plugin throws InvocationTargetException when creating
Change By: Liam Newman
Summary: The git github -branch-source plugin seems to have broken from 2.5.3 -> 2.5.7 throws InvocationTargetException when creating
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 1:05:02 PM9/13/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 1:27:03 PM9/13/19
to jenkinsc...@googlegroups.com
Liam Newman commented on Bug JENKINS-59321
 
Re: github-branch-source plugin throws InvocationTargetException when creating

Steve Boardwell

For the JobDSL syntax change, you are correct - the underlying data representation changed.  The JobDSL syntax is reflecting that.  Could you open a separate issue for that? Maybe something to fix on the JobDSL side or as a symbol annotation in this plugin.

As for the exception, it looks like this only happens if you try to save a blank job but also for an invalid URL.  That shouldn't be the case. It should be a validation error, but not an explosion.   

It does also result in a Jenkins error webpage with this message: 

java.lang.IllegalArgumentException: Repository URL must not be empty at org.jenkinsci.plugins.github_branch_source.GitHubRepositoryInfo.forRepositoryUrl(GitHubRepositoryInfo.java:84) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.<init>(GitHubSCMSource.java:336) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:529) at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:784) at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83) at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:678)

 

 

This should be a validation error

 

 

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 1:59:01 PM9/13/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-59321
[~lostinberlin]


For the JobDSL syntax change, you are correct - the underlying data representation changed.  The JobDSL syntax is reflecting that.  Could you open a separate issue for that? Maybe something to fix on the JobDSL side or as a symbol annotation in this plugin.

As for the exception, it looks like this only happens if you try to save a blank job but also for an invalid URL. , right?  

That shouldn't be the case. It should be a validation error , but ( not an explosion .   

It does also result in a Jenkins error webpage with
), but this message: 

{{java.lang.IllegalArgumentException: Repository URL must
is specific to a case that is not be empty at org.jenkinsci.plugins.github_branch_source.GitHubRepositoryInfo.forRepositoryUrl(GitHubRepositoryInfo.java:84) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.<init>(GitHubSCMSource.java:336) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:529) at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:784) at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83) at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:678)}}

a valid job, right?  

 

This should be a validation error

 

 

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 1:59:02 PM9/13/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-59321
[~lostinberlin]

For the JobDSL syntax change, you are correct - the underlying data representation changed.  The JobDSL syntax is reflecting that.  Could you open a separate issue for that? Maybe something to fix on the JobDSL side or as a symbol annotation in this plugin.

As for the exception, it looks like this only happens if you try to save a blank job, right? 

That shouldn't be the case. It should be a validation error (not an explosion), but this is specific to a case that is not a valid job, right? 

 

 

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 2:00:01 PM9/13/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Sep 13, 2019, 2:01:02 PM9/13/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-59321
[~lostinberlin]

For the JobDSL syntax change, you are correct - the underlying data representation changed.  The JobDSL syntax is reflecting that.  Could you open a separate issue for that? Maybe something to fix on the JobDSL side or as a symbol annotation in this plugin.

As for the exception, it looks like this only happens if you try to save a blank job, right? 

That shouldn't be the case. It should be a validation error (not an explosion), but this is specific to a case that is not a valid job, right? 

  It likely means we're not validating everything we should. 

 
< /td>

lostinberlin2010@gmail.com (JIRA)

unread,
Sep 13, 2019, 2:04:01 PM9/13/19
to jenkinsc...@googlegroups.com

Hi Liam Newman, thanks for the quick response. Are you saying that the github configuration needs owner, repository, and repositoryUrl? I would have thought that, from the looks of the variables, it was either/or with the configuredByUrl determining whether to use the repositoryUrl.

re: Job DSL
This was correctly shown in the jobDSL API Viewer - it was more of an Info with a view to maybe adding the information á la 'breaking change for any dsl job definitions'. Or was there anything else you think I could ask from the job-dsl-plugin?

lostinberlin2010@gmail.com (JIRA)

unread,
Sep 13, 2019, 2:47:02 PM9/13/19
to jenkinsc...@googlegroups.com

Btw, with the current jenkins:lts it isn't possible to create a multibranch-pipeline without installing the "Cloudbees Credentials Plugin". The configuration page of the job doesn't load (spinning disk) with the logs showing:

Sep 13, 2019 6:34:54 PM org.eclipse.jetty.server.handler.ContextHandler$Context log
WARNING: Error while serving http://localhost:8080/job/test-pipeline/contextMenu
java.lang.reflect.InvocationTargetException
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535)
...
...
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/var/jenkins_home/war/WEB-INF/lib/jenkins-core-2.176.3.jar!/lib/hudson/actions.jelly:39:70: <st:include> com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider
	at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:745)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:289)
	at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)
	at org.apache.commons.jelly.tags.core.ForEachTag.doTag(ForEachTag.java:150)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
...
...
	at jenkins.model.ModelObjectWithContextMenu$ContextMenu.from(ModelObjectWithContextMenu.java:193)
	at hudson.model.Actionable.doContextMenu(Actionable.java:360)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
	... 77 more
Caused by: java.lang.NoClassDefFoundError: com/cloudbees/hudson/plugins/folder/properties/FolderCredentialsProvider
	at java.lang.Class.getDeclaringClass0(Native Method)
	at java.lang.Class.getDeclaringClass(Class.java:1235)
	at java.lang.Class.getEnclosingClass(Class.java:1277)
	at com.cloudbees.plugins.credentials.CredentialsStore.<init>(CredentialsStore.java:102)
...
...
	at org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:97)
	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
	... 117 more

Would it be possible to add the "Cloudbees Credentials Plugin" plugin as a dependency?

lostinberlin2010@gmail.com (JIRA)

unread,
Sep 13, 2019, 3:21:02 PM9/13/19
to jenkinsc...@googlegroups.com

Can confirm that setting all 3 fields and configureByUrl to true works with the job-dsl plugin

lostinberlin2010@gmail.com (JIRA)

unread,
Sep 13, 2019, 4:03:03 PM9/13/19
to jenkinsc...@googlegroups.com
Steve Boardwell edited a comment on Bug JENKINS-59321
Can confirm that setting all 3 fields and {{configureByUrl}} to true works with the job-dsl plugin .

Some strange happenings going on with job-dsl though.
* Leaving {{repoOwner}} or {{repository}} blank and they will be missing from the {{repositoryUrl}} in the generated jobs config page. Infact the {{repositoryUrl}} is overwritten, regardless of what you put in there.
* The {{configuredByUrl}} is also disregarded it seems. The "Repository HTTPS URL" is always activated in the generated job.

lostinberlin2010@gmail.com (JIRA)

unread,
Sep 13, 2019, 4:06:03 PM9/13/19
to jenkinsc...@googlegroups.com
Steve Boardwell edited a comment on Bug JENKINS-59321
Can confirm that setting all 3 fields and {{configureByUrl}} to true works with the job-dsl plugin.

Some strange happenings going on with job-dsl though.
* Leaving {{repoOwner}} or {{repository}} blank and they will be missing from the {{repositoryUrl}} in the generated jobs config page. Infact In fact, the {{repositoryUrl}} is overwritten, regardless of what you put in there.
* The {{configuredByUrl}} is also disregarded it seems. The "Repository HTTPS URL" is always activated in the generated job
, regardless of the boolean value .

bitwiseman@gmail.com (JIRA)

unread,
Sep 27, 2019, 2:18:02 PM9/27/19
to jenkinsc...@googlegroups.com

Steve Boardwell 

Seem like we should have some JobDSL tests as part of this plugin's build.   Would you be willing to make some?  This is likely the only way to avoid (or at least be aware of) future breaking changes.

lostinberlin2010@gmail.com (JIRA)

unread,
Sep 27, 2019, 2:25:02 PM9/27/19
to jenkinsc...@googlegroups.com

Liam Newman,
I would love to help, just not sure when I will be able to get around to it. I think now that it might, in fact, be a problem with the job-dsl-plugin itself (looking at my last comment). Let me have a look over the next few days and get back to you.

linuxsuren@gmail.com (JIRA)

unread,
Sep 28, 2019, 6:44:03 AM9/28/19
to jenkinsc...@googlegroups.com

linuxsuren@gmail.com (JIRA)

unread,
Sep 28, 2019, 6:45:01 AM9/28/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Sep 28, 2019, 4:33:04 PM9/28/19
to jenkinsc...@googlegroups.com

Rick 

Thanks for that!

Steve Boardwell 

"The "Repository HTTPS URL" is always activated in the generated job" - you mean in the UI, yes, that is by design. We do not want people to use the old way, but we've kept it available for now.

From an API perspective, things are more complex.  I'm not sure the JobDSL ramifications were fully considered when making the change. 

I've dug into this a bit more and I now understand what is going on.  We changed the DataboundConstructor and it now requires a bunch of extra parameters which screws up the JobDSL.

Essentially, we started requiring more and different parameters on the constructor, so they are all required.  
This is definitely a bug and it definitely needs to be fixed in this plugin.  I don't have time to do it now, but it is on my list. 

linuxsuren@gmail.com (JIRA)

unread,
Oct 28, 2019, 10:45:03 PM10/28/19
to jenkinsc...@googlegroups.com
Rick started work on Bug JENKINS-59321
 
Change By: Rick
Status: Open In Progress

linuxsuren@gmail.com (JIRA)

unread,
Oct 28, 2019, 10:45:03 PM10/28/19
to jenkinsc...@googlegroups.com

linuxsuren@gmail.com (JIRA)

unread,
Oct 28, 2019, 10:45:03 PM10/28/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Oct 31, 2019, 12:20:05 PM10/31/19
to jenkinsc...@googlegroups.com
Liam Newman reopened an issue
Change By: Liam Newman
Resolution: Fixed
Status: Resolved Reopened
Assignee: Rick Liam Newman

bitwiseman@gmail.com (JIRA)

unread,
Oct 31, 2019, 12:21:03 PM10/31/19
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 8:17:04 PM11/4/19
to jenkinsc...@googlegroups.com

Steve Boardwell

Here's a PR that I believe addresses your issue.  Sorry for the wait. 

https://github.com/jenkinsci/github-branch-source-plugin/pull/254 

Assuming it passes CI, there will be a link to an incremental you can try out. 

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 8:48:04 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-59321
[~lostinberlin]


Here's a PR that I believe addresses your issue.  Sorry for the wait. 

[https://github.com/jenkinsci/github-branch-source-plugin/pull/254

Assuming it passes CI Okay , there will it isn't quite ready. But when it is would you be a link willing to an incremental you can give it try out. for me?  

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 9:20:03 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-59321
[~lostinberlin]

Here's a PR that I believe addresses your issue.  Sorry for the wait. 

[https://github.com/jenkinsci/github-branch-source-plugin/pull/254

Okay, Once it isn't quite ready. But when it passes CI and there is a link to an "incremental" in the PR, would you be willing to give it a try for me

bitwiseman@gmail.com (JIRA)

unread,
Nov 4, 2019, 9:52:03 PM11/4/19
to jenkinsc...@googlegroups.com
Liam Newman edited a comment on Bug JENKINS-59321
[~lostinberlin]

Here's a PR that I believe addresses your issue.  Sorry for the wait. 

[https://github.com/jenkinsci/github-branch-source-plugin/pull/254

Once it passes CI and there is a link to an "incremental" in the PR, would you be willing to give it a try? 

(Here it is: [https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/github-branch-source/2.5.9-rc941.09ba8e411aa7/] )

lostinberlin2010@gmail.com (JIRA)

unread,
Jan 14, 2020, 7:42:06 AM1/14/20
to jenkinsc...@googlegroups.com

Hi Liam Newman, it's my turn to apologise for the wait (I even saw you in Lisbon - sorry I didn't say hi).

I have installed the incremental in the PR and it works as expected.

bitwiseman@gmail.com (JIRA)

unread,
Feb 10, 2020, 7:25:02 PM2/10/20
to jenkinsc...@googlegroups.com

Steve Boardwell
I tried to get this into v2.6.0, but are were some unexpected snags. It is on the list of things to do, but I'll have to circle back to it.

Reply all
Reply to author
Forward
0 new messages