Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanity.openjdk Windows IOException: Access is denied #8374

Closed
pshipton opened this issue Jan 22, 2020 · 14 comments
Closed

sanity.openjdk Windows IOException: Access is denied #8374

pshipton opened this issue Jan 22, 2020 · 14 comments

Comments

@pshipton
Copy link
Member

pshipton commented Jan 22, 2020

https://ci.eclipse.org/openj9/job/Test_openjdk8_j9_sanity.openjdk_x86-32_windows_Personal/1
https://ci.eclipse.org/openj9/job/Test_openjdk8_j9_sanity.openjdk_x86-64_windows_Personal/1
All tests fail with IOException: Access is denied

[2020-01-22T17:16:27.562Z] java.io.IOException: Access is denied.
[2020-01-22T17:16:27.562Z] 	at java.io.WinNTFileSystem.createFileExclusively(Native Method)
[2020-01-22T17:16:27.562Z] 	at java.io.File.createNewFile(File.java:1012)
[2020-01-22T17:16:27.562Z] 	at SpecialTempFile.main(SpecialTempFile.java:86)
[2020-01-22T17:16:27.562Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2020-01-22T17:16:27.562Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2020-01-22T17:16:27.562Z] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2020-01-22T17:16:27.562Z] 	at java.lang.reflect.Method.invoke(Method.java:498)
[2020-01-22T17:16:27.562Z] 	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
[2020-01-22T17:16:27.562Z] 	at java.lang.Thread.run(Thread.java:821)
[2020-01-22T17:16:28.219Z] java.io.IOException: Access is denied.
[2020-01-22T17:16:28.219Z] 	at java.io.File.createTempFile(File.java:2024)
[2020-01-22T17:16:28.219Z] 	at java.io.File.createTempFile(File.java:2070)
[2020-01-22T17:16:28.219Z] 	at CheckPermission.main(CheckPermission.java:364)
[2020-01-22T17:16:28.219Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2020-01-22T17:16:28.219Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2020-01-22T17:16:28.219Z] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2020-01-22T17:16:28.219Z] 	at java.lang.reflect.Method.invoke(Method.java:498)
[2020-01-22T17:16:28.219Z] 	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
[2020-01-22T17:16:28.219Z] 	at java.lang.Thread.run(Thread.java:821)
@pshipton
Copy link
Member Author

@smlambert @llxia seems like a setup issue, any ideas?

@pshipton pshipton changed the title sanity.openjdk win32 IOException: Access is denied sanity.openjdk Windows IOException: Access is denied Jan 22, 2020
@llxia
Copy link
Contributor

llxia commented Jan 22, 2020

Sorry, I do not recall any special settings for openjdk tests on windows. @sophia-guo do you have any ideas?

@sophia-guo
Copy link
Contributor

sophia-guo commented Jan 23, 2020

Yes, looks like the setup issue. No same issue happened in AdoptOpenJDK windows test builds.

The most errors are either calling createTempFile or createTempDirectory. Suspect the default Temporary Files Location value %TEMP%.

12:16:28  java.io.IOException: Access is denied.
12:16:28  	at java.io.File.createTempFile(File.java:2024)
12:16:28  	at java.io.File.createTempFile(File.java:2070)

In adopt the jenkins windows TEMP is set as:

02:34:11 TEMP=/cygdrive/c/Users/JENKIN~1.TES/AppData/Local/Temp

What's the %TEMP% in those Eclipse openj9 windows? ( looks like it's %systemdrive%\Windows\Temp )

@pshipton
Copy link
Member Author

@jdekonin can you please address the previous comment.

@jdekonin
Copy link
Contributor

The machines are all the same. There is no restriction on jobs writing to /tmp. Where is the job trying to write too? Why is the job trying to create content outside of the workspace directory? This leads to content clutter on the machines.

jenkins@oj9-win2012r2-1 ~
$ echo $TEMP
/tmp

@sophia-guo
Copy link
Contributor

sophia-guo commented Jan 23, 2020

The machines are all the same. There is no restriction on jobs writing to /tmp. Where is the job trying to write too?

Test job with createTempFile creates an empty file in the default temporary-file directory ( note it is jenkins user on cygwin).

There are some other access denied

12:16:31  STDERR:
12:16:31  java.nio.file.AccessDeniedException: C:\Windows\6073852034634688818.tmp

Why is the job trying to create content outside of the workspace directory? This leads to content clutter on the machines.

Test could cleans up itself when exit( f.deleteOnExit(); ), which is independent of jenkins job. Shouldn't have leftover issue. If not should report an issue in JBS.

@smlambert
Copy link
Contributor

We run printenv at the beginning of every test run.

Looking at a passing run on a windows machines at AdoptOpenJDK, there is both a TMP and TEMP environment variable set.
Screen Shot 2020-01-28 at 9 27 22 PM
Screen Shot 2020-01-28 at 9 41 51 PM

Looking at the console output of the failing test on the OpenJ9 machine, there is no TMP or TEMP environment variables.

That seems to be the fundamental difference between machine configurations that is causing the test failure. If you compare all printenv output, you also see other differences between environment variables, including between PATH settings. If you correct this difference in machine configuration, the test failures will be resolved.

@pshipton
Copy link
Member Author

@jdekonin fyi Shelley's comment #8374 (comment)

@jdekonin
Copy link
Contributor

jdekonin commented Jan 29, 2020

Machines are connecting to jenkins differently, otherwise I don't see anything playbook specific that would address the setting of the env. TEMP is now defined in the machine configuration. Pete launched a grinder to see what else fails.
https://ci.eclipse.org/openj9/job/Grinder/620/console

Just jdk_security1_0, any suggestions as to what is needed if this is a system configuration issue?

[2020-01-29T22:00:36.829Z] STDERR:
[2020-01-29T22:00:36.829Z] java.security.ProviderException: java.security.KeyException: Access is denied.
[2020-01-29T22:00:36.829Z] 
[2020-01-29T22:00:36.829Z] 	at sun.security.mscapi.RSAKeyPairGenerator.generateKeyPair(RSAKeyPairGenerator.java:118)
[2020-01-29T22:00:36.829Z] 	at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:697)
[2020-01-29T22:00:36.829Z] 	at FinalizeHalf.test(FinalizeHalf.java:76)
[2020-01-29T22:00:36.829Z] 	at FinalizeHalf.main(FinalizeHalf.java:54)
[2020-01-29T22:00:36.829Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[2020-01-29T22:00:36.829Z] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[2020-01-29T22:00:36.829Z] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2020-01-29T22:00:36.829Z] 	at java.lang.reflect.Method.invoke(Method.java:498)
[2020-01-29T22:00:36.829Z] 	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
[2020-01-29T22:00:36.829Z] 	at java.lang.Thread.run(Thread.java:821)
[2020-01-29T22:00:36.829Z] Caused by: java.security.KeyException: Access is denied.
[2020-01-29T22:00:36.829Z] 
[2020-01-29T22:00:36.829Z] 	at sun.security.mscapi.RSAKeyPairGenerator.generateRSAKeyPair(Native Method)
[2020-01-29T22:00:36.829Z] 	at sun.security.mscapi.RSAKeyPairGenerator.generateKeyPair(RSAKeyPairGenerator.java:112)
[2020-01-29T22:00:36.829Z] 	... 9 more
[2020-01-29T22:00:36.829Z] 
[2020-01-29T22:00:36.829Z] JavaTest Message: Test threw exception: java.security.ProviderException
[2020-01-29T22:00:36.829Z] JavaTest Message: shutting down test

@jdekonin
Copy link
Contributor

Make env vars stick in jenkins config
eclipse-cbi/jiro#80

@pshipton
Copy link
Member Author

Updated the jdk_security1_0 failure comment with more information, although still not helpful. It's using the MSCAPI Provider, which is Windows specific. Googling found https://docs.genesys.com/Documentation/PSDK/latest/Developer/TLSSecurityProviders which mentions certmgr.msc, not sure if that helps.

@jdekonin
Copy link
Contributor

@vsebe is this something that you have seen with any of our internal windows test wrt machine configuration requirements?

@vsebe
Copy link
Contributor

vsebe commented Jan 31, 2020

Nothing related to certificates in WMI.

@pshipton
Copy link
Member Author

pshipton commented Mar 16, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants