Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72474

Jenkins ssh agent on z/OS only working with -Dfile.encoding=ISO-8859-1

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • remoting
    • None

      We are running ssh agent on z/OS with JVM option -Dfile.encoding=ISO-8859-1. While this setting enables the communication between Jenkins controller and agent it causes trouble at other ends. In particular the maven-pipeline plugin is causing trouble on z/OS in combination with the -Dfile.encoding=ISO-8859-1 setting, e.g.

      steps {
          withMaven(maven:'Maven_3_9_0') {
              sh 'mvn -version'
          }
      }
      

      is causing

      [Pipeline] sh
      + mvn -version 
      mvn 1: FSUM7332 syntax error: got (, expecting Newline
      

      Here, this is because maven-pipeline plugin generates scripts that have to be written in native encoding on z/OS but -Dfile.encoding=ISO-8859-1 causes them to be written in ISO-8859-1 encoding.

      However, the ssh agents on z/OS should run without enforcing a particular encoding via -Dfile.encoding.

      Investigation turned out that the problem arises from two involved components implementations that interfere:

      1. Jenkins remoting implementation uses stdin/out for communication with Jenkins controller. It assumes binary transfer over that channel, i.e. whatever byte is written from one end is received as such at the other end. For ssh agents this stdin/out transfer is handled by the ssh and sshd implementations.
      2. On z/OS platform ssh stdin and stdout receive character set conversion between the default character set used at z/OS side and ISO-8859-1 character set (cf. OpenSSH and globalization, table 1, scenario 5).
        In particular, for non-interactive sessions with client on non-z/OS UNIX and server on z/OS the z/OS OpenSSH assumes ISO-8859-1 for the data transferred over network, and therefore transcodes on z/OS server side stdin from ISO-8859-1 to the default character set, and stdout from default character set to ISO-8859-1.

      All in all, the transcoding by z/OS OpenSSH scrambles the data exchanged between Jenkins controller and agent unless the default character set on z/OS is set to ISO-8859-1 what may cause other trouble as described above.

      I will come up with a PR allowing to run ssh agent on z/OS without -Dfile.encoding=ISO-8859-1.

            Unassigned Unassigned
            lne Lutz Neugebauer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: