07-23-2023, 04:56 AM
I'm new with Jenkins and i want to execute commands using a node, but I have the following error:
***java.io.IOException: Batch scripts can only be run on Windows nodes.***
My node is:
node ('master') {
git 'https://github.com/bryaneibon/SeleniumWithCucucumber.git'
bat label: '', script: 'mvn verify'
}
When I delete the bash command, everything works perfectly.
By trying with the command:
node ('master') {
git 'https://github.com/bryaneibon/SeleniumWithCucucumber.git'
bat 'mvn verify'
}
I have exactly the same error.
***The condensed log is as follows:***
No credentials specified
> /usr/local/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/local/bin/git config remote.origin.url
Fetching upstream changes from
> /usr/local/bin/git fetch --tags --force --progress --
.
.
.
[Pipeline] bat
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: Batch scripts can only be run on Windows nodes
at org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:58)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:106)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:99)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:317)
.
.
.
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE
***java.io.IOException: Batch scripts can only be run on Windows nodes.***
My node is:
node ('master') {
git 'https://github.com/bryaneibon/SeleniumWithCucucumber.git'
bat label: '', script: 'mvn verify'
}
When I delete the bash command, everything works perfectly.
By trying with the command:
node ('master') {
git 'https://github.com/bryaneibon/SeleniumWithCucucumber.git'
bat 'mvn verify'
}
I have exactly the same error.
***The condensed log is as follows:***
No credentials specified
> /usr/local/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/local/bin/git config remote.origin.url
[To see links please register here]
# timeout=10Fetching upstream changes from
[To see links please register here]
> /usr/local/bin/git --version # timeout=10> /usr/local/bin/git fetch --tags --force --progress --
.
.
.
[Pipeline] bat
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: Batch scripts can only be run on Windows nodes
at org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:58)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:106)
at org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:99)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:317)
.
.
.
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Finished: FAILURE