Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters undefined with Jenkins 2.7 #193

Open
zhao0 opened this issue Aug 13, 2016 · 0 comments
Open

Parameters undefined with Jenkins 2.7 #193

zhao0 opened this issue Aug 13, 2016 · 0 comments

Comments

@zhao0
Copy link

zhao0 commented Aug 13, 2016

I create a job following the ReadMe guide, set ${gitlabSourceBranch} to Branch Specifier.
However, it failed while pulling the source branch.

> git -c core.askpass=true fetch --tags --progress ssh://git@*** HIDDEN **.git +refs/heads/:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/${gitlabSourceBranch}^{commit} # timeout=10
> git rev-parse refs/remotes/origin/refs/remotes/origin/${gitlabSourceBranch}^{commit} # timeout=10
> git rev-parse refs/remotes/origin/${gitlabSourceBranch}^{commit}
# timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

It seems that params are undefined, After google for a long time, I figureout that it is jenkins's security update. Detail:https://jenkins.io/blog/2016/05/11/security-update/.
I define the following system properties to work around this limitation, and it works

Set hudson.model.ParametersAction.keepUndefinedParameters to true, e.g.java -Dhudson.model.ParametersAction.keepUndefinedParameters=true -jar jenkins.war to revert to the old behavior of allowing any build parameters. Depending on your environment, this may be unsafe, as it opens you up to attacks as described above.
Set hudson.model.ParametersAction.safeParameters to a comma-separated list of safe parameter names, e.g. java -Dhudson.model.ParametersAction.safeParameters=FOO,BAR_baz,quX -jar jenkins.war.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant