[JIRA] (JENKINS-40763) Token expansion fails when workspace is not available

2 views
Skip to first unread message

tommy.tynja@diabol.se (JIRA)

unread,
Jan 3, 2017, 4:45:01 AM1/3/17
to jenkinsc...@googlegroups.com
Tommy Tynjä created an issue
 
Jenkins / Bug JENKINS-40763
Token expansion fails when workspace is not available
Issue Type: Bug Bug
Assignee: Tommy Tynjä
Components: delivery-pipeline-plugin
Created: 2017/Jan/03 9:44 AM
Environment: Jenkins 2.19
Delivery Pipeline Plugin 0.10.1
Token Macro Plugin 2.0
Priority: Critical Critical
Reporter: Tommy Tynjä

If the workspace of a job is not available, task name token expansion fails since the token macro plugin is trying to get the workspace of the node where the build was performed. If the workspace or node is not available, token expansion fails which causes a TokenMacroException. A log message will be emitted and TokenUtils returns an empty string. If your view contains a lot of tasks / pipelines the Jenkins log will be flooded. See https://github.com/Diabol/delivery-pipeline-plugin/blob/master/src/main/java/se/diabol/jenkins/pipeline/token/TokenUtils.java#L51.

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

tommy.tynja@diabol.se (JIRA)

unread,
Jan 3, 2017, 4:58:01 AM1/3/17
to jenkinsc...@googlegroups.com
Tommy Tynjä commented on Bug JENKINS-40763
 
Re: Token expansion fails when workspace is not available

The behavior of token-macro plugin has changed in 2.0 so it requires the workspace to be accessible. A workaround for this issue is to downgrade token-macro plugin to 1.10.

tommy.tynja@diabol.se (JIRA)

unread,
Jan 3, 2017, 8:11:01 AM1/3/17
to jenkinsc...@googlegroups.com

tommy.tynja@diabol.se (JIRA)

unread,
Jan 3, 2017, 8:14:01 AM1/3/17
to jenkinsc...@googlegroups.com
Tommy Tynjä updated an issue
 
Change By: Tommy Tynjä
If the workspace of a job is not available, task name token expansion fails since the token macro plugin is trying to get the workspace of the node where the build was performed. If the workspace or node is not available, token expansion fails which causes a TokenMacroException. A log message will be emitted and TokenUtils returns an empty string. If your view contains a lot of tasks / pipelines the Jenkins log will be flooded. See https://github.com/Diabol/delivery-pipeline-plugin/blob/master/src/main/java/se/diabol/jenkins/pipeline/token/TokenUtils.java#L51.


This causes the configured task names not to be shown in the delivery pipeline view (even if no expandable variables exist), which makes the task names default to the job name.

Workaround is to downgrade token-macro plugin to 1.x of 1.9 or later.

tommy.tynja@diabol.se (JIRA)

unread,
Jan 4, 2017, 9:27:01 AM1/4/17
to jenkinsc...@googlegroups.com
Tommy Tynjä resolved as Fixed
Change By: Tommy Tynjä
Status: Open Resolved
Resolution: Fixed

tommy.tynja@diabol.se (JIRA)

unread,
Jan 4, 2017, 9:27:01 AM1/4/17
to jenkinsc...@googlegroups.com
 
Re: Token expansion fails when workspace is not available

Proposed solution in pull request 226 merged. Will be part of next release.

tommy.tynja@diabol.se (JIRA)

unread,
Jan 13, 2017, 3:38:03 AM1/13/17
to jenkinsc...@googlegroups.com

olivier.schiavo@mybestpro.com (JIRA)

unread,
Feb 11, 2020, 5:22:04 AM2/11/20
to jenkinsc...@googlegroups.com
Olivier Schiavo commented on Bug JENKINS-40763
 
Re: Token expansion fails when workspace is not available

 

With "cloud" nodes it is very frequent to have jobs with transient workspace which exists only for the duration of the job. All environment variables are available and token expansion would be very useful.

The so-called "solution for solving task names"  is basically a try / catch with failover, it breaks environment variable in the task name once the job is finished.

Is there any plan to allow tokenmacro expansion even without a workspace ?

In the current state the delivery-pipeline-plugin is broken for task built on a transient node.

 

 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages