[JIRA] (JENKINS-56251) Plugin Finds Files Only in Master Workspaces?

1 view
Skip to first unread message

jdavis@ipswitch.com (JIRA)

unread,
Feb 22, 2019, 11:54:14 AM2/22/19
to jenkinsc...@googlegroups.com
Jason Davis created an issue
 
Jenkins / Bug JENKINS-56251
Plugin Finds Files Only in Master Workspaces?
Issue Type: Bug Bug
Assignee: mo xun
Components: content-replace-plugin
Created: 2019-02-22 16:52
Environment: Jenkins (Windows) - versions 2.138.3 and 2.150.3
Content Replace Plugin 1.0.4
Nodes = Win2016
Priority: Minor Minor
Reporter: Jason Davis

The script below works to  find and update a file if the file exists in the workspace on the Jenkins master.  When updating the label to run on a node, and ensuring the file does in fact exist in the workspace of the node, the script fails stating that that the file does not exist. 

In case it matters, the jobs are managed in a Jenkins folder.
java.io.FileNotFoundException: File 'C:\jenkins\workspace\Pipeline-Tests\Content-Replace-Test\here.txt' does not exist
at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)

Pipeline with 

pipeline{    
    agent none    
    stages {
        stage ("Do Stuff") {
            agent { label 'master' }           
            
            stages {
                stage ("Test") {
                    steps {
                        echo 'Replace...'
                        
                        contentReplace(configs: [fileContentReplaceConfig(configs:      
                            [fileContentReplaceItemConfig(matchCount: 1, 
                            replace: "versionName-replace", 
                            search: 'versionName.*')], 
                            fileEncoding: 'ASCII', 
                            filePath: 'here.txt')])                    }
                }    
            }
        }
    }        
}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jdavis@ipswitch.com (JIRA)

unread,
Feb 22, 2019, 11:54:15 AM2/22/19
to jenkinsc...@googlegroups.com
Jason Davis updated an issue
Change By: Jason Davis
The script below works to  find and update a file if the file exists in the workspace on the Jenkins master.  When updating the label to run on a node, and ensuring the file does in fact exist in the workspace of the node, the script fails stating that that the file does not exist. 

In case it matters, the jobs are managed in a Jenkins folder.
{code: java }
java
.io.FileNotFoundException: File 'C:\jenkins\workspace\Pipeline-Tests\Content-Replace-Test\here.txt' does not exist

at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
{code}

Pipeline with   Sequential Steps
{code:java}

pipeline{    
    agent none    
    stages {
        stage ("Do Stuff") {
            agent { label 'master' }           
            
            stages {
                stage ("Test") {
                    steps {
                     echo 'Replace...'
                    
                     contentReplace(configs: [fileContentReplaceConfig(configs:      
                     [fileContentReplaceItemConfig(matchCount: 1,
                     replace: "versionName-replace",
                     search: 'versionName.*')],
                     fileEncoding: 'ASCII',
                     filePath: 'here.txt')])                    }
                }    
            }
        }
    }        
}{code}

jdavis@ipswitch.com (JIRA)

unread,
Feb 22, 2019, 11:54:25 AM2/22/19
to jenkinsc...@googlegroups.com
Jason Davis created an issue
Issue Type: Bug Bug
Assignee: mo xun
Components: content-replace-plugin
Created: 2019-02-22 16:52
Environment: Jenkins (Windows) - versions 2.138.3 and 2.150.3
Content Replace Plugin 1.0.4
Nodes = Win2016
Priority: Minor Minor
Reporter: Jason Davis

The script below works to  find and update a file if the file exists in the workspace on the Jenkins master.  When updating the label to run on a node, and ensuring the file does in fact exist in the workspace of the node, the script fails stating that that the file does not exist. 

In case it matters, the jobs are managed in a Jenkins folder.

java.io.FileNotFoundException: File 'C:\jenkins\workspace\Pipeline-Tests\Content-Replace-Test\here.txt' does not exist


at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)

Pipeline with 

pipeline{    
    agent none    
    stages {
        stage ("Do Stuff") {
            agent { label 'master' }           
            
            stages {
                stage ("Test") {
                    steps {
                        echo 'Replace...'
                        
                        contentReplace(configs: [fileContentReplaceConfig(configs:      
                            [fileContentReplaceItemConfig(matchCount: 1, 
                            replace: "versionName-replace", 
                            search: 'versionName.*')], 
                            fileEncoding: 'ASCII', 
                            filePath: 'here.txt')])                    }
                }    
            }
        }
    }        
}

jdavis@ipswitch.com (JIRA)

unread,
Feb 22, 2019, 11:54:25 AM2/22/19
to jenkinsc...@googlegroups.com
Jason Davis updated an issue
Change By: Jason Davis
The script below works to  find and update a file if the file exists in the workspace on the Jenkins master.  When updating the label to run on a node, and ensuring the file does in fact exist in the workspace of the node, the script fails stating that that the file does not exist. 

In case it matters, the jobs are managed in a Jenkins folder.
{code: java }
java
.io.FileNotFoundException: File 'C:\jenkins\workspace\Pipeline-Tests\Content-Replace-Test\here.txt' does not exist

at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
{code}

Pipeline with   Sequential Steps

{code:java}

pipeline{    
    agent none    
    stages {
        stage ("Do Stuff") {
            agent { label 'master' }           
            
            stages {
                stage ("Test") {
                    steps {
                     echo 'Replace...'
                    
                     contentReplace(configs: [fileContentReplaceConfig(configs:      
                     [fileContentReplaceItemConfig(matchCount: 1,
                     replace: "versionName-replace",
                     search: 'versionName.*')],
                     fileEncoding: 'ASCII',
                     filePath: 'here.txt')])                    }
                }    
            }
        }
    }        
}{code}

mxnstrive@gmail.com (JIRA)

unread,
Apr 7, 2019, 9:37:01 AM4/7/19
to jenkinsc...@googlegroups.com
mo xun started work on Bug JENKINS-56251
 
Change By: mo xun
Status: Open In Progress

mxnstrive@gmail.com (JIRA)

unread,
Apr 7, 2019, 9:38:02 AM4/7/19
to jenkinsc...@googlegroups.com
mo xun commented on Bug JENKINS-56251
 
Re: Plugin Finds Files Only in Master Workspaces?

Thanks, Plase upgrade to 1.0.5, try again.

mxnstrive@gmail.com (JIRA)

unread,
Apr 10, 2019, 6:43:02 AM4/10/19
to jenkinsc...@googlegroups.com

mxnstrive@gmail.com (JIRA)

unread,
Jan 9, 2020, 7:50:03 PM1/9/20
to jenkinsc...@googlegroups.com
mo xun closed an issue as Fixed
Change By: mo xun
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages