Corrupt content in jenkins-result.txt using bat step in pipeline in LTS 2.375.2


suddenly one of my jobs started failing. It occurs when in a declarative pipeline a bat step is used:
bat ‘echo just a string’

The response is:
09:49:25 d:\jenkinslocserver\workspace\Han_Gitea_testpush_master@2>echo just a string 09:49:25 just a string
09:49:25 Cannot contact AgentHan: corrupted content in d:\jenkinslocserver\workspace\Han_Gitea_testpush_master@2@tmp\durable-e400d5a3\jenkins-result.txt: java.lang.NumberFormatException: For input string: “test;”

In fact the file jenkins-result.txt contains this string “test;”

When the bat step is replaced by an echo step everything runs fine.
The bat step is also running fine inside a freestyle job but fails when using a pipeline.
Also using the powershell step instead of the bat step resolves the issue.

Does anybody have a clue how to resolve this?

regards, Han

Have any windows updates been installed recent? What is the actual contents of the jenkins-result.txt file? If you add a ping -n 10 or something simple like that, does the result change?

When inserting a ping command this behaves correctly:

But the result doesn’t change.

Last few days there haven’t been any windows updates.

Unfortunately I don’t see the file jenkins-result.txt anymore. But I remember from previous runs that it contains the string test;

Can you share your pipeline script?

pipeline {
agent any

stages {
    stage('Hello') {
        steps {
            echo 'Hello World'
            bat 'ping localhost -n 10'
            bat 'echo my pipeline'


Hi Alex,

I found the cause of the issue. In my profile the variable ERRORLEVEL was set to ERRORLEVEL=test; This was causing the durable step to use this as exit code, which could not be interpreted.

Thanks for your support and sorry for any inconvenience.


Interesting! I will keep that in mind if someone sees a similar issue in the future. Glad its working now!