pmdMain fails on Gradle 5.4.1: could not determine if Stdout is a console: could not get handle file information (errno 1)

1 of my projects got upgraded to Gradle 5.4.1. Since then, PMD plug-in tasks pmdMain and pmdTest fail. The check task also fails to run.

Error message:

Execution failed for task ‘:pmdTest’.
Could not determine if Stdout is a console: could not get handle file information (errno 1).

I did not set anything for the PMD plug-in, dependencies, or configurations. It’s all default (which means the plug-in automatically loads PMD 6.8.0).

I tried the tasks with the following configuration:

pmd {
	consoleOutput = false
}

but that did not help.

I have attached debug, stacktrace, and scan results. pmdTest-debug-info-20190429t1538.xml (565.5 KB) (which does not contain any XML: it’s all text).

Please help. I like PMD.

Java version: Java 11 SDK, OJ9 version (formerly by IBM, now by Eclipse). This java works fine with the previous Gradle release and PMD 6.5.0.

We see the same error message intermittently when running PMD on our Jenkins nodes (Gradle 5.4, JDK 1.8_161, Windows 10)

I haven’t been able to see any pattern to when it happens. It might be more frequent when the nodes are heavily loaded, but it still happens with only one executor and 2 gradle workers.

Is there any update about this issue?

I am having the same issue with Gradle 5.5, PMD 6.15.0 on Jenkins on a windows server. Has anyone found something?

Thanks posting your problem here and opening an issue. I would like to follow up a couple more questions just to make sure we aren’t hiding a bug in the Native Platform. Could everyone answer the following questions regarding this issue:

1- Is Gradle running inside a Cygwin or msys shell? Or Windows Linux Subsystem?
2- Is the STDOUT/STDERR pipe redirected in any way to a file on disk? If so, where is the file being written (e.g. NFS server, NTFS drive, RAM drive, etc)?
3- Who is calling Gradle? A human at the command line or Jenkins or something else?
4- Is Gradle running inside a container? Is it a Windows or Linux container?
5- Is the output redirected to /dev/null or NUL ?

Also is it possible to try Gradle 6.0 to see if the issue still appears?

If you are using Cygwin or msys, could you tell me the version, most likely using uname -r .

Anything one this ? I am having the same issue running gradle 5.6.4 and pmd 6.13.0. It only seem to happen when Jenkins call pmd