[JIRA] (JENKINS-54346) tee keeps file open

5 views
Skip to first unread message

tolnaisz@hotmail.com (JIRA)

unread,
Oct 30, 2018, 9:40:02 AM10/30/18
to jenkinsc...@googlegroups.com
Szabolcs Tolnai created an issue
 
Jenkins / Bug JENKINS-54346
tee keeps file open
Issue Type: Bug Bug
Assignee: rsandell
Components: pipeline-utility-steps-plugin
Created: 2018-10-30 13:39
Priority: Critical Critical
Reporter: Szabolcs Tolnai

Using the below pipeline script fails in the second stage and in any subsequent runs until the master or slave isn't restarted.

 

The error is:
ERROR: Cannot delete workspace...
 

The script:

stage('first') {
  node() {
    cleanWs()

    tee('output.log')

Unknown macro: {       echo 'test'     }

  }
}

stage('second') {
  node()

Unknown macro: {     cleanWs()     echo 'cleaned'   }

}

Marked as critical due to the fact that slave/master restart is required to resolve the issue and allow further runs to wipe the workspace (until tee is used again).

 

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

postelmansroel@gmail.com (JIRA)

unread,
Jan 9, 2019, 9:01:03 AM1/9/19
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Feb 11, 2019, 3:24:03 PM2/11/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Szabolcs Tolnai
Change By: Jesse Glick
Assignee: rsandell Szabolcs Tolnai

jglick@cloudbees.com (JIRA)

unread,
Feb 11, 2019, 3:24:03 PM2/11/19
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-54346
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Feb 11, 2019, 3:24:04 PM2/11/19
to jenkinsc...@googlegroups.com
Change By: Jesse Glick
Status: In Progress Review

dmel50@hotmail.com (JIRA)

unread,
Feb 22, 2019, 11:21:02 AM2/22/19
to jenkinsc...@googlegroups.com

Probably related to this issue: I had a "too many open files" error in linux, and the lsof command revealed thousands of open file descriptors resulting from Jenkins pipeline tee command.

Note that tee is executed in parallel tasks in my case.

A restart of the Jenkins service has temporarily solved the problem.

tskrainar@icloud.com (JIRA)

unread,
Jul 31, 2019, 3:41:02 PM7/31/19
to jenkinsc...@googlegroups.com

We just started using tee() in a workflow, and in less than 24h, one agent leaked enough descriptors to hit the per-process limit.  Use of tee() in this workflow was fundamental to the workflow itself, so this is a huge blocker for us (considering an agent restart is required to resolve).

 

Jesse Glick any update on https://github.com/jenkinsci/pipeline-utility-steps-plugin/pull/62 ? 

jglick@cloudbees.com (JIRA)

unread,
Jul 31, 2019, 3:54:03 PM7/31/19
to jenkinsc...@googlegroups.com

I am neither the author of the patch, nor the maintainer of the plugin.

There is a trivial workaround for some use cases: replace

tee('output.txt') {
  sh 'some command'
}

with

sh 'some command >output.txt 2>&1'

Of course this is not possible if you were redirecting output from multiple nested steps that could not be coalesced.

a.e.ukhanov@gmail.com (JIRA)

unread,
Oct 17, 2019, 12:19:03 PM10/17/19
to jenkinsc...@googlegroups.com

In our installation(2.176.4) tee on windows nodes works good with workflow-job plugin <=2.25. After upgrade workflow-job  plugin to 2.26+ version job with

 

node('windows')
{
tee {bat ... }
cleanWs()
}

 

drops with

ERROR: Cannot delete workspace: Unable to delete '...'. Tried 3 times...

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

glenn.herbert@hcl.com (JIRA)

unread,
Feb 26, 2020, 5:58:09 PM2/26/20
to jenkinsc...@googlegroups.com

Just running into this today. For I workaround i switched to use powershell as follows:

bat '''
   powershell "cmd /c '.\your.bat' | tee output.txt"
'''
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages