launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

I have jenkins agent running on windows 10 , when i start the agent via jnlp using OPENWEBSTART its connect i can see "Connected" but then Terminated the next second , when I went into the Jenkins/remoting/logs i found out this error , any one can please help what is the issue and why its getting terminated after connection

I read some where to update towards OpenJDK 11 , i tried that too but it does not help

Following is the log details:

Nov 09, 2021 9:53:03 AM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFORMATION: Remoting server accepts the following protocols: [JNLP4-connect, Ping]
Nov 09, 2021 9:53:03 AM org.jenkinsci.remoting.protocol.impl.BIONetworkLayer$Reader run
INFORMATION: Waiting for ProtocolStack to start.
Nov 09, 2021 9:53:08 AM hudson.remoting.UserRequest perform
WARNUNG: LinkageError while performing UserRequest:hudson.slaves.SlaveComputer$SlaveInitializer@6cfcc55d
java.lang.ExceptionInInitializerError
at hudson.slaves.SlaveComputer$SlaveInitializer.call(SlaveComputer.java:1042)
at hudson.slaves.SlaveComputer$SlaveInitializer.call(SlaveComputer.java:1033)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:376)
at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "hudson.util.RingBufferLogHandler.defaultSize" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at com.sun.javaws.security.JavaWebStartSecurity.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.lang.Integer.getInteger(Unknown Source)
at java.lang.Integer.getInteger(Unknown Source)
at hudson.util.RingBufferLogHandler.<clinit>(RingBufferLogHandler.java:39)
... 11 more



OpenJdk version : Open JDK 1.8.2 265
OpenWebStart version : 1.4.0
Windows OS : 10
Jenkins Version : 2.318

Because of the problem every time i have to run my jenkins agent.jar file to get make my agent online

Any hint/help in this regards


Janak Mulani
Posts: 726
Joined: 24 Mar 2020, 13:37

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Janak Mulani »

Please attach the log files that are created when you run the Jnlp using OWS.

The above log is for the itw-settings app used to configure OWS deployment properties.

Janak Mulani
Posts: 726
Joined: 24 Mar 2020, 13:37

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Janak Mulani »

Janak Mulani wrote: 10 Nov 2021, 18:35 Please attach the log files that are created when you run the Jnlp using OWS.

The above log is for the itw-settings app used to configure OWS deployment properties.
I requested you to attach the log files. not copy them. You can zip the log files and attach to your post. It is difficult to read and search the log file that you have copied in your post.

TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

Hello Janak

My apologies

Both log files has been attached.

Regards and Thanks
Attachments
2021-11-11_10_38_15.29-ows-stage2.log
(73.09 KiB) Downloaded 348 times
2021-11-11_10_38_15.29-ows-stage1.log
(19.42 KiB) Downloaded 351 times


Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Stephan Classen »

so there are many errors about the application trying to read properties which protected by the security manager.
Can you disable the security manager and test if this gets you further.


<security>
<all-permissions/>
</security>

TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

In my jnlp file i already added this tag
<security>
<all-permissions/>
</security>

I opened my jnlp file via notepad editor and this tag is already present in my jnlp file

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Stephan Classen »

Have you also changed this on the server. Because OWS will download the latest version of the JNLP from the server and use that instead of the one on your filesystem.

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Stephan Classen »

We also just released version 1.5.0 which has improvements which may help in your case.
So please give it a try and send us a fresh set of log files in case you still encounter the problem

TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

yes it has also done on the server
as mentioned by you i just updated the open webstart , restart the computer and tried to run , unfortunately i still encounter the same problem. Attached is the log files.
Attachments
2021-11-26_11_19_15.746-ows-stage2.log
(35.51 KiB) Downloaded 309 times
2021-11-26_11_19_15.746-ows-stage1.log
(64.57 KiB) Downloaded 316 times

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Stephan Classen »

Can you pass "--nosecurity" as an argument to javaws when launching the JNLP.

TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

Hi
Can you please guide how to do that , I actually opened my jnlp file via right click Open With OpenWebStart.
you mean i have to pass "--nosecurity" inside security tag in jnlp file
Thanks

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Stephan Classen »

You can pass this only on the command line.

Open a powershell or cmd window and navigate to your jnlp file.

Then enter the following command "javaws <name of your jnlp> --nosecurity"

TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

I tried it with the above command still its getting the same error
First step its connected and then immediately after connected its get terminated.

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Stephan Classen »

by passing the --nosecurity you disabled all security in OWS and ITW.
There is not more things to disable.

Do you know if your application is defining its own SecurityManager?

TestEngineer
Posts: 8
Joined: 04 Nov 2021, 15:56

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by TestEngineer »

As far as i know application is not defining any security manager , it works in past with java web start recently after shifting to OWS i start receiving this error
Do you know how i can check that if application defining its own security manager ?

Janak Mulani
Posts: 726
Joined: 24 Mar 2020, 13:37

Re: launch Jenkins agent jnlp file via OpenWebStart crashed Caused by: java.security.AccessControlException:

Post by Janak Mulani »

You can check the source code or check if the app is running in a sandbox (there should be an icon on the window).

Post Reply