-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Component/s: durable-task-plugin
-
None
-
Environment:z/OS
When running sh step on z/OS with encoding set to UTF-8 the step execution hangs when trying to read the jenkins-result.txt file. This is because the file is in native EBCDIC encoding, but it is read with UTF-8 encoding specified in sh step.
Following pipeline is used for reproduction:
Â
pipeline {
  agent{node('zOS-node')} Â
stages {
    stage('example for bugreport')  {
      steps {
        sh(script:'''#!/bin/sh -e
          echo "UTF-8 output" | iconv -f 1047 -t utf-8''',Â
          encoding:'UTF-8')
      }
    }
  }
}
Execution results in:
[Pipeline] // stage [Pipeline] withEnv [Pipeline] { [Pipeline] stage [Pipeline] { (example for bugreport) [Pipeline] sh UTF-8 output Cannot contact zOS-node: java.io.IOException: corrupted content in /[path removed]/durable-040db3a4/jenkins-result.txt: java.lang.NumberFormatException: For input string: "�"
In my understanding on z/OS the jenkins-result.txt is always in native encoding as it is generated via shell scripts generated at https://github.com/jenkinsci/durable-task-plugin/blob/aa22cf15d5e07bd99247e71ed467ae5107b74d73/src/main/java/org/jenkinsci/plugins/durabletask/BourneShellScript.java#L231 and following lines. Hence, it should be read with native encoding instead of encoding specified in sh step (which is intended for output/payload). I’ll come up with a PR.
- is related to
-
JENKINS-70660 Issue reading ASCII jenkins-result.txt file on z/OS machine
-
- Open
-