Comments (20)
I am having the same problem. I get:
SEVERE: undefined method `getDefaultParametersValues' for #Java::HudsonMatrix::MatrixProject:0x183c44d
I also can't figure out what I am supposed to name the parameter that is going to get the branch name for a given commit. Help!
from jenkins-gitlab-hook-plugin.
Ah, after looking at the plugin code, I see it takes whatever parameter you use in the Branch Specifier field of your job config. It can be anything. However the code assumes that you will use the ${FOO} form of the variable, when $FOO is also valid.
from jenkins-gitlab-hook-plugin.
I've managed to reproduce with latest plugin version and Jenkins v1.523.
Looking into it.
from jenkins-gitlab-hook-plugin.
Don't know why that method is suddenly not available any more.
But, I found a workaround. https://github.com/elvanja/jenkins-gitlab-hook-plugin/tree/hotfix/getDefaultParametersValues_fix branch contains the new code.
Could you build the plugin and try if it works now?
I've tested it with Jenkins v1.523 and it works for me, but I'd like to verify before releasing.
Let me know how it goes, thanks!
from jenkins-gitlab-hook-plugin.
I tried with Jenkins 1.518, and when a request comes to the plugin from the hook, the executor thread crashes. The log says:
@4000000051e9af4625c05c2c Jul 19, 2013 9:27:24 PM sun.reflect.NativeMethodAccessorImpl invoke0
@4000000051e9af4625c067e4 INFO: gitlab web hook triggered for repo url git@foo:foo/bar.git and master branch
@4000000051e9af4639545694 Jul 19, 2013 9:27:24 PM sun.reflect.NativeMethodAccessorImpl invoke0
@4000000051e9af463954624c INFO: project foo_build matches the master branch
@4000000051e9af4715952f44 Jul 19, 2013 9:27:25 PM sun.reflect.NativeMethodAccessorImpl invoke0
@4000000051e9af4715953714 INFO: foo_build scheduled for build
@4000000051e9b00014f45394 java.lang.ClassCastException: hudson.model.BooleanParameterDefinition cannot be cast to hudson.model.ParameterValue
@4000000051e9b00014f63024 at hudson.model.ParametersAction.getAssignedLabel(ParametersAction.java:127)
@4000000051e9b00014f6340c at hudson.model.Queue$Item.getAssignedLabel(Queue.java:1368)
@4000000051e9b00014f637f4 at hudson.model.Queue.makeBuildable(Queue.java:1075)
@4000000051e9b00014f66ea4 at hudson.model.Queue.maintain(Queue.java:1009)
@4000000051e9b00014f6b10c at hudson.model.Queue.pop(Queue.java:868)
@4000000051e9b00014f7b2dc at hudson.model.Executor.grabJob(Executor.java:289)
@4000000051e9b00014f7b6c4 at hudson.model.Executor.run(Executor.java:210)
from jenkins-gitlab-hook-plugin.
@omehegan, you're using v1.518? The latest version of the plugin requires ruby runtime v0.20, and if I am not mistaking, you need Jenkins v1.522 for it ( see #10, #12 & #13 for details). Would it be too much to ask if you could upgrade and give it try?
from jenkins-gitlab-hook-plugin.
I seem to have ruby-runtime 0.12. I just upgraded Jenkins to 1.523, but plugin manager doesn't show any newer version of ruby-runtime available. I can't really find much information about that plugin online anywhere. And I still get the same error when the hook is run.
from jenkins-gitlab-hook-plugin.
Then if you could please paste the payload? Remove sensitive data of course, and some more details on how your project is configured would be helpful too, specifically the parameters, git details etc. I'll look into it then...
from jenkins-gitlab-hook-plugin.
Payload:
INFO: with payload: {"before"=>"f4de352bd30a5d03a8b4365d9e2c5d62fb6fed40", "after"=>"bbde08b5a808c9258882db2bb82420e746df368e", "ref"=>"refs/heads/master", "user_id"=>43, "user_name"=>"Owen Mehegan", "repository"=>{"name"=>"bar_v3", "url"=>"[email protected]:foo/bar_v3.git", "description"=>"thing bar UI 2.0", "homepage"=>"http://gitlab.foo.com/foo/bar_v3"}, "commits"=>[{"id"=>"1ec213e86461b7668e932994d2970966bc69ad4a", "message"=>"Procfile to use 1291 for console and fix test env", "timestamp"=>"2013-07-16T23:01:40+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/1ec213e86461b7668e932994d2970966bc69ad4a", "author"=>{"name"=>"Soo Hwan Park", "email"=>"[email protected]"}}, {"id"=>"eba8dc84dc4fef094c50dbbc95579475712a36ac", "message"=>"bundle exec to fix rake issues", "timestamp"=>"2013-07-17T00:19:08+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/eba8dc84dc4fef094c50dbbc95579475712a36ac", "author"=>{"name"=>"Patrick Davis", "email"=>"[email protected]"}}, {"id"=>"15a84f983f39c8563fa95b3e0c124f15978f2c87", "message"=>"Merge branch 'master' into regression-tests\n\nConflicts:\n\tconfig/admin_test3.yml\n\tconfig/admin_test4.yml", "timestamp"=>"2013-07-17T00:27:34+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/15a84f983f39c8563fa95b3e0c124f15978f2c87", "author"=>{"name"=>"Soo Hwan Park", "email"=>"[email protected]"}}, {"id"=>"c1712538deeafc5b6067a1ffbf9e5395e2f82541", "message"=>"updated logo back to foo", "timestamp"=>"2013-07-18T19:53:04+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/c1712538deeafc5b6067a1ffbf9e5395e2f82541", "author"=>{"name"=>"Patrick Davis", "email"=>"[email protected]"}}, {"id"=>"9fb1d6dacf0a04a83be88d96e7c874b41af46260", "message"=>"changed release notes to use markdown format so it's easier to update them.\n\nAdded /release_notes/ endpoint that converts and displays them as html.", "timestamp"=>"2013-07-18T23:50:38+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/9fb1d6dacf0a04a83be88d96e7c874b41af46260", "author"=>{"name"=>"Jens Schmidt", "email"=>"[email protected]"}}, {"id"=>"5fc3d09fa9724eb7c973c19ef8b2e8753d433c35", "message"=>"Merge branch 'better_release_notes' of /home/git/repositories/foo/bar_v3", "timestamp"=>"2013-07-18T23:52:39+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/5fc3d09fa9724eb7c973c19ef8b2e8753d433c35", "author"=>{"name"=>"Jens Schmidt", "email"=>"[email protected]"}}, {"id"=>"56cce741e042bd23e201c5b5446055cd9dca2ddd", "message"=>"Squashed commit of the following:\n\n Fixed some exceptions when going between AR and LI Editing controllers\n\nPT: https://www.pivotaltracker.com/story/show/53584985\nCR: http://gitlab.foo.com/foo/bar_v3/merge_requests/322", "timestamp"=>"2013-07-19T00:20:07+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/56cce741e042bd23e201c5b5446055cd9dca2ddd", "author"=>{"name"=>"Colin Zhu", "email"=>"[email protected]"}}, {"id"=>"8c7bcdb1e3f229943a64a8aec57b426ed90589c1", "message"=>"remove campaign status panel dropdown (was not functional)", "timestamp"=>"2013-07-19T16:27:43+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/8c7bcdb1e3f229943a64a8aec57b426ed90589c1", "author"=>{"name"=>"Jens Schmidt", "email"=>"[email protected]"}}, {"id"=>"5aa527d89419240b65dcba25b2029397ae3c9b65", "message"=>"Merge branch 'master' of gitlab.foo.com:foo/bar_v3", "timestamp"=>"2013-07-19T18:33:28+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/5aa527d89419240b65dcba25b2029397ae3c9b65", "author"=>{"name"=>"Colin Zhu", "email"=>"[email protected]"}}, {"id"=>"bbde08b5a808c9258882db2bb82420e746df368e", "message"=>"Squashed commit of the following:\n\n Saving Static Bundles now only saves selected site placements from\n the grid\n\n Fixed a bug where BundleMap was not being updated after saving new\n bundles\n\nPT: https://www.pivotaltracker.com/story/show/53488973\nPT: https://www.pivotaltracker.com/story/show/53644475\nCR: http://gitlab.foo.com/foo/bar_v3/merge_requests/284", "timestamp"=>"2013-07-19T18:35:09+00:00", "url"=>"http://gitlab.foo.com/foo/bar_v3/commit/bbde08b5a808c9258882db2bb82420e746df368e", "author"=>{"name"=>"Colin Zhu", "email"=>"[email protected]"}}], "total_commits_count"=>10}
The build is a matrix job (sometimes they seem to do things differently from stand-alone jobs). It has a parameter named 'branch' with a default of master. Our repo URL is set to e.g. [email protected]:foo/foo_v3.git. Branch specifier is ${branch} and also under advanced we have 'Checkout/merge to local branch' set to ${branch} - this is how we have always done manual builds of repo branches from the Jenkins UI.
Let me know if you need any more information.
from jenkins-gitlab-hook-plugin.
That'll do for now. Never used matrix jobs, so I might need help, I'll ask if I hit a wall. Thanks.
from jenkins-gitlab-hook-plugin.
OK guys, did some testing again. Used regular and matrix project (multiple configuration, unless you are talking about some other kind?) configuration too. All seems to be working. I am testing with Jenkins v1.523, Git plugin v1.4.0 and latest Gitlab hook plugin. I've also used a payload exactly like the one above, with just gitlab project url changed to match my setup.
All the Jenkins projects required to execute have been triggered for build. Essentially, I can't repeat this last issue.
I've released this latest fix as a new version v0.2.10. If you don't see it in your Jenkins instances just yet, you can download from http://repo.jenkins-ci.org/releases/org/jenkins-ci/ruby-plugins/gitlab-hook/0.2.10/ and just deploy manually.
I'd appreciate if you could test with this version and let me know how it goes.
@omehegan, if you still have issues, maybe you can try the Git notify commit trick directly. https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Pushnotificationfromrepository has all the details. And the hook is not a problem to setup in Gitlab either. Also, if you are still experiencing issues, maybe you could create a regular Jenkins project and see if the problem occurs for it as well?
from jenkins-gitlab-hook-plugin.
Sorry for the silence, I just grabbed the latest plugin via normal Jenkins plugin update and triggering a test hook worked, yay :) I'm pretty sure that means a normal push will also trigger it, will report back if it doesn't.
Thanks a lot for the fix, really appreciated! 👍
from jenkins-gitlab-hook-plugin.
@daaain, excellent, thanks for the update!
@omehegan, could you please test the latest official build and let me know how it goes?
from jenkins-gitlab-hook-plugin.
With the latest build, I still get the thread crash I described before. The build goes into the queue, but once it goes to actually start the job executor thread dies. I feel like I must be doing something wrong but I don't understand what. I'm using the same versions of everything as you are, except Jenkins 1.523.
from jenkins-gitlab-hook-plugin.
@elvanja It seems like the crash is related to Jenkins trying to figure out where to run the job. My matrix/multiple configuration jobs run on several slaves, which are selected by label in the Configuration Matrix part of the job configuration. This works fine when we run the job through the Jenkins UI or with a direct GET request on the job build URL, and it's the normal way of doing matrix builds across slaves. Not sure why the gitlab plugin trigger causes it to crash.
from jenkins-gitlab-hook-plugin.
Either that or it's just a general problem with accessing or dealing with the parameters of the build. It seems weird that it's trying to cast hudson.model.BooleanParameterDefinition cannot to hudson.model.ParameterValue.
from jenkins-gitlab-hook-plugin.
I figured out what is causing the crash. If I have ANY other parameter associated with my job, in addition to the string parameter where the branch name is passed in, I get this crash. That seems like a bug.
from jenkins-gitlab-hook-plugin.
@omehegan Found it! Yes, there was a bug related to multiple parameters and the way default values are picked up from Jenkins project definition. Anyway, I've fixed it. You can try it with the latest version v0.2.11.
Let me know how it goes.
from jenkins-gitlab-hook-plugin.
It works! Hooray! We will do some more testing and file separate issues if any are found. Thank you!
from jenkins-gitlab-hook-plugin.
Excellent!! OK, I am closing this one.
If anything else is at fault, please file a new issue.
Thanks again!
from jenkins-gitlab-hook-plugin.
Related Issues (20)
- build_now works on separate servers?
- "no project references the given repo url and commit branch" muti-branch freestyle HOT 2
- naming autogenerated project does not postfix with branchname on first creation HOT 2
- build_now hook not working on Jenkins 1.620 and Gitlab 7.8.2 HOT 3
- How could I skip building based on commit message? (Enhancement Request?) HOT 1
- Does not install on Jenkins 1.635 HOT 2
- Don't trigger a build on commit notifications in multiple scms is wrong HOT 1
- Support for git sparsepath HOT 1
- Support for multiple projects HOT 2
- Pipeline projects
- Jenkins does not run build on the "Tag Push Events" trigger from Web Hook HOT 1
- plugin does not work with (multibranch) pipeline projects?
- jenkins2 : GitLab CI Service URL in old format when using the plugin
- how to reference nested payload value
- 应该如何正确填写回调URL,我按照文档书写的地址一致验证不过 HOT 4
- Installed but not show in jenkins
- How to read json payload from gitlab webhook in Jenkins
- unsupported Java version: 11
- unsupported Java version: 11 HOT 9
- Configure Clouds in jenkins With docker give error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jenkins-gitlab-hook-plugin.