[JIRA] (JENKINS-42836) Build parameter not expanded in script path

7 views
Skip to first unread message

brian.keyser@digitalglobe.com (JIRA)

unread,
Mar 16, 2017, 11:06:02 AM3/16/17
to jenkinsc...@googlegroups.com
Brian Keyser created an issue
 
Jenkins / Bug JENKINS-42836
Build parameter not expanded in script path
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline, scm-api-plugin
Created: 2017/Mar/16 3:05 PM
Priority: Minor Minor
Reporter: Brian Keyser

Steps to reproduce

  1. Create a pipeline job
  2. Add a build parameter to specify the URL of a git repository, ${gitUrl}
  3. Add a build parameter to specify the build script to execute, ${script}
  4. Within the Pipeline section
    1. Select "Pipeline script from SCM"
    2. Select "Git" for the SCM
    3. Enter ${gitUrl} for the Repository URL
    4. Enter the branch to build
    5. Enter ${script) for the "Script Path"

Perform a "Build with Parameters" and enter values for the gitUrl and script values and select Build.  The following error is reported

Mar 16, 2017 2:43:53 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
INFO: Worker #4 completed: FAILURE
Mar 16, 2017 2:43:53 PM org.jenkinsci.plugins.workflow.flow.FlowExecutionList unregister
WARNING: Owner[Worker/4:Worker #4] was not in the list to begin with: []
Mar 16, 2017 2:43:53 PM io.jenkins.blueocean.events.PipelineEventListener$1 run
SEVERE: Unexpected error publishing pipeline FlowNode event.
java.util.concurrent.ExecutionException: hudson.AbortException: /var/jenkins_home/workspace/Worker@script/${script} not found
at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:289)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:276)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
at io.jenkins.blueocean.events.PipelineEventListener$1.run(PipelineEventListener.java:226)
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: hudson.AbortException: /var/jenkins_home/workspace/Worker@script/${script} not found
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:136)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)

If ${script} is set to the location of a script, the job starts successfully.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

brian.keyser@digitalglobe.com (JIRA)

unread,
Mar 16, 2017, 11:06:03 AM3/16/17
to jenkinsc...@googlegroups.com
Brian Keyser updated an issue
Change By: Brian Keyser
Steps to reproduce
# Create a pipeline job
# Add a build parameter to specify the URL of a git repository, $\{gitUrl}
# Add a build parameter to specify the build script to execute, $\{script}
# Within the Pipeline section
## Select "Pipeline script from SCM"
## Select "Git" for the SCM
## Enter $\{gitUrl} for the Repository URL
## Enter the branch to build
## Enter $\{script
) } for the "Script Path"


Perform a "Build with Parameters" and enter values for the gitUrl and script values and select Build.  The following error is reported
{code:java}

Mar 16, 2017 2:43:53 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
INFO: Worker #4 completed: FAILURE
Mar 16, 2017 2:43:53 PM org.jenkinsci.plugins.workflow.flow.FlowExecutionList unregister
WARNING: Owner[Worker/4:Worker #4] was not in the list to begin with: []
Mar 16, 2017 2:43:53 PM io.jenkins.blueocean.events.PipelineEventListener$1 run
SEVERE: Unexpected error publishing pipeline FlowNode event.
java.util.concurrent.ExecutionException: hudson.AbortException: /var/jenkins_home/workspace/Worker@script/${script} not found
at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:289)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:276)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
at io.jenkins.blueocean.events.PipelineEventListener$1.run(PipelineEventListener.java:226)
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: hudson.AbortException: /var/jenkins_home/workspace/Worker@script/${script} not found
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:136)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
{code}

If $\{script} is set to the location of a script, the job starts successfully.

tiagomsmagalhaes@gmail.com (JIRA)

unread,
Mar 21, 2017, 7:16:01 AM3/21/17
to jenkinsc...@googlegroups.com
Tiago Magalhães commented on Bug JENKINS-42836
 
Re: Build parameter not expanded in script path

I use SVN and I'm able to checkout the Jenkinsfile from a path with a parameter and define the local directory, but I can't get the jenkinsfile as there is no expansion of the parameter

brian.keyser@digitalglobe.com (JIRA)

unread,
Mar 21, 2017, 9:19:01 AM3/21/17
to jenkinsc...@googlegroups.com
Brian Keyser updated an issue
Change By: Brian Keyser
Component/s: git-plugin
Component/s: scm-api-plugin

andrew.bayer@gmail.com (JIRA)

unread,
Mar 28, 2017, 6:30:02 PM3/28/17
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

chris.broll@hotmail.co.uk (JIRA)

unread,
Apr 13, 2018, 6:03:05 AM4/13/18
to jenkinsc...@googlegroups.com
Chris Broll commented on Improvement JENKINS-42836
 
Re: Build parameter not expanded in script path

Any update on using variables from the environment in the Script file path?

scm_issue_link@java.net (JIRA)

unread,
Apr 20, 2018, 12:44:03 PM4/20/18
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:
src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java
src/test/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinitionTest.java
http://jenkins-ci.org/commit/workflow-cps-plugin/2dc4bf82a1e095b09dde4638a50c893320432f93
Log:
[FIXED JENKINS-42836] env expand the script path from SCM.

andrew.bayer@gmail.com (JIRA)

unread,
Jun 27, 2018, 11:32:02 AM6/27/18
to jenkinsc...@googlegroups.com
Andrew Bayer updated Improvement JENKINS-42836
 

Whoops, this was merged and released a while back, as of workflow-cps 2.49.

Jenkins / Improvement JENKINS-42836
Change By: Andrew Bayer
Status: In Review Resolved
Resolution: Fixed
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

fabian.holler@simplesurance.de (JIRA)

unread,
Feb 6, 2019, 11:02:06 AM2/6/19
to jenkinsc...@googlegroups.com
Fabian Holler commented on Improvement JENKINS-42836
 
Re: Build parameter not expanded in script path

This does not work for me.

I have the "Pipeline: Groovy" Plugin version 2.62 installed.
Similiar to described in the ticket I do the following:

  • Configure my Pipeline job to have a string parameter called branch
  • In the "Pipeline script from SCM" section, I enter as branch specifier ${branch}
  • I start the job and as value for the branch parameter develop.

The job fails during checkout with
stderr: fatal: Couldn't find remote ref refs/heads/${branch}

The variable is not dereferenced.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

zahmad@teladoc.com (JIRA)

unread,
Apr 12, 2019, 9:21:04 AM4/12/19
to jenkinsc...@googlegroups.com

Fabian Holler Andrew Bayer

also a continued issue for me with "Pipeline: Groovy" plugin version 2.65

can we get this reopened and fixed?

jglick@cloudbees.com (JIRA)

unread,
Apr 12, 2019, 9:29:02 AM4/12/19
to jenkinsc...@googlegroups.com

Zishan Ahmad a particular issue was identified and fixed, with test coverage. Please do not reopen. If you continue to have some issue which you believe is related, file a distinct issue report with complete, minimal steps to reproduce from scratch and link to this issue.

fabian.holler@simplesurance.de (JIRA)

unread,
Apr 25, 2019, 11:02:04 AM4/25/19
to jenkinsc...@googlegroups.com

fabian.holler@simplesurance.de (JIRA)

unread,
Apr 25, 2019, 11:08:03 AM4/25/19
to jenkinsc...@googlegroups.com
Fabian Holler edited a comment on Improvement JENKINS-42836
It works only when 'lightweight checkout' is disabled.
There is the ticket https://issues.jenkins-ci.org/browse/JENKINS-42971 for the issue.

o.schneider@precitec-optronik.de (JIRA)

unread,
Jun 27, 2019, 4:00:04 AM6/27/19
to jenkinsc...@googlegroups.com

Fabian Holler thanks a bunch. Was on a wild goose chase here trying to figure this out and was just about to file a ticket here when I saw your comment. Thanks! Once I disabled the lightweight checkout, all worked fine.

tamerlaha@gmail.com (JIRA)

unread,
Jan 15, 2020, 7:13:03 PM1/15/20
to jenkinsc...@googlegroups.com
ipleten commented on Improvement JENKINS-42836
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

tamerlaha@gmail.com (JIRA)

unread,
Jan 15, 2020, 7:19:03 PM1/15/20
to jenkinsc...@googlegroups.com
ipleten edited a comment on Improvement JENKINS-42836

UPDATE2: It's still doesn't work if you specify commit SHA

tamerlaha@gmail.com (JIRA)

unread,
Jan 15, 2020, 11:35:04 PM1/15/20
to jenkinsc...@googlegroups.com
ipleten edited a comment on Improvement JENKINS-42836
UPDATE2: It's still doesn't work it fails if you specify commit SHA readTrusted is used.
Reply all
Reply to author
Forward
0 new messages