How do you set java options for ssh agents

2020-09-22 Thread Tim Black
I'm using ssh-slaves-plugin  to 
configure and launch 2 ssh agents, and I've specified several java options 
in these agents' config (see photo and text list below), but when these 
agents are launched, the agents' log still shows empty jvmOptions in the 
ssh launcher call. Agent Log excerpt:

SSHLauncher{host='jenkins-testing-agent-1', port=22, 
credentialsId='jenkins_user_on_linux_agent', *jvmOptions=''*, javaPath='', 
prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=30, 
maxNumRetries=20, retryWaitTime=10, 
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy,
 
tcpNoDelay=true, trackCredentials=true} 
[09/22/20 15:56:12] [SSH] Opening SSH connection to 
jenkins-testing-agent-1:22. 
[09/22/20 15:56:16] [SSH] WARNING: SSH Host Keys are not being verified. 
Man-in-the-middle attacks may be possible against this connection. 
[09/22/20 15:56:16] [SSH] Authentication successful. 
[09/22/20 15:56:16] [SSH] The remote user's environment is: 
BASH=/usr/bin/bash
.
.
.
[SSH] java -version returned 11.0.8. 
[09/22/20 15:56:16] [SSH] Starting sftp client. [09/22/20 15:56:16] [SSH] 
Copying latest remoting.jar... Source agent hash is 
0146753DA5ED62106734D59722B1FA2C. Installed agent hash is 
0146753DA5ED62106734D59722B1FA2C Verified agent jar. No update is 
necessary. Expanded the channel window size to 4MB 
[09/22/20 15:56:16] [SSH] Starting agent process: cd 
"/home/jenkins/.jenkins" && java -jar remoting.jar -workDir 
/home/jenkins/.jenkins -jar-cache /home/jenkins/.jenkins/remoting/jarCache 
Sep 22, 2020 3:56:17 PM org.jenkinsci.remoting.engine.WorkDirManager 
initializeWorkDir INFO: Using /home/jenkins/.jenkins/remoting as a remoting 
work directory Sep 22, 2020 3:56:17 PM 
org.jenkinsci.remoting.engine.WorkDirManager setupLogging INFO: Both error 
and output logs will be printed to /home/jenkins/.jenkins/remoting 
<===[JENKINS REMOTING CAPACITY]===>channel started Remoting version: 4.2 
This is a Unix agent WARNING: An illegal reflective access operation has 
occurred WARNING: Illegal reflective access by 
jenkins.slaves.StandardOutputSwapper$ChannelSwapper to constructor 
java.io.FileDescriptor(int) WARNING: Please consider reporting this to the 
maintainers of jenkins.slaves.StandardOutputSwapper$ChannelSwapper WARNING: 
Use --illegal-access=warn to enable warnings of further illegal reflective 
access operations WARNING: All illegal access operations will be denied in 
a future release Evacuated stdout Agent successfully connected and online 


[image: jenkins-ssh-agent-config.PNG]

This is the full text in the "JVM Options" field for 
jenkins-testing-agent-1 and 2:

-Dhudson.slaves.WorkspaceList=- 
-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/Vancouver -Xmx64g 
-Xms64g -XX:+AlwaysPreTouch -XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/home/jenkins/.jenkins/support -XX:+UseG1GC 
-XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled 
-XX:+DisableExplicitGC -XX:+UnlockDiagnosticVMOptions 
-XX:+UnlockExperimentalVMOptions -verbose:gc 
-Xlog:gc:/home/jenkins/.jenkins/support/gc-%t.log -XX:+PrintGC 
-XX:+PrintGCDetails -XX:ErrorFile=/hs_err_%p.log -XX:+LogVMOutput 
-XX:LogFile=/home/jenkins/.jenkins/support/jvm.log

I am having intermittent catastrophic failures of these agent machines 
during builds and am trying to properly configure java settings per 
Cloudbees best practices, but I cannot seem to get off the ground here. 
Another problem in my agents that's probably related is that the agent-side 
(remoting) logs are all zero bytes.

Thanks for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fbceac13-b480-4816-bc99-c5fe7e10fba6n%40googlegroups.com.


[Event]: DevOps World Happening Now

2020-09-22 Thread Alyssa Tong
Hi All,

DevOps World  is taking place right
now. Lots of great Jenkins sessions taking place. Join us!

BR,
alyssa

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAC9wNazBV%3DCNudQF1-t9L-qejpHOFAqH5Ga_6qgsO_QbvymD5w%40mail.gmail.com.


Is it possible for provisioning Jenkins agents with Docker plugin as a Swarm cluster ?

2020-09-22 Thread banthita limwilai
Dear folks,

I have one huge production Jenkins master which is contains projects over 
50. This Jenkins master act as a build and scheduler machine. Then I've 
been facing the issue about the Jenkins performance and its run out of 
resources. So I'm trying to do the optimization by change its architecture 
to Master/agents.

The concerns are, I have  limited number of agent and limited resources per 
agent. Hence, I would like to find the best approach that can provide us 
for acceptable costs and the difficulty of the management. So, I came up 
with the solution using Jenkins plugin *'docker plugin'  *with can operate 
with the minimum resources perfectly. 

I've tested with my test cluster but the scenario was Master/Agents in the 
same machine using docker plugin. It works well.

Then  I'd like to implement in my production Jenkins with this docker 
plugin but I don't want to spawn agents node in the same machine. I want to 
join agent nodes to the swarm cluster. 

Does it possible ?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cfb1d124-7c72-4aad-b194-28c0546f43dcn%40googlegroups.com.


Re: Help with JNLP-agent lost connections, Nothing on Google helps.

2020-09-22 Thread 'Björn Pedersen' via Jenkins Users
Current Weekly ( that is what it seems you are using) is 2.257 now. There 
were some changes to remoting, so make sure  the agent.jar on the the 
client machines is up-to-date  as well. 

And how do you connect to the windows clients? Running it as a windows 
service, manually starting it , ssh ???

Björn

tlnar...@gmail.com schrieb am Dienstag, 22. September 2020 um 09:00:07 
UTC+2:

> Eagerly , I'm waiting for the root cause and resolution 
>
> On Thursday, July 4, 2019 at 7:47:00 PM UTC+5:30 ruslan_zasukhin wrote:
>
>> Hi Everbody
>>
>> I am fighting with this about 2 weeks and so far no any success. 
>> I have read dozen answers on internet about similar troubles - nothing 
>> helps.
>>
>> I have upgrade today Java on master and all windows-slave machines to 
>> latest 8_211, not helps.
>> Jenkins also is latest 2.183 and all plugins up to date.
>>
>> *** So, problem is that windows-slave machines SOMETIMES get closed JNLP 
>> connection.*
>> The same machines sometimes are able to execute job with success.
>>
>> ** May be jenkins-gurus can check Exception-stack below and point where 
>> to search?
>>
>> ** This failure happens at any time at any place of a job. 
>> ** MASTER computer is Mac OS X
>> ** We have around few windows computers (mostly VM on virtual Box,) 
>> few Linux machines (also virtual bog) and few Macs - physical macs 
>> are used.
>>
>> ** Linux and Mac works fine.
>> ** For years Windows also was fine, glitches have started about 2 weeks 
>> ago,
>> On that day we was yet on 2.163
>>
>>
>> =
>>
>> FATAL: command execution failed
>> java.nio.channels.ClosedChannelException
>>  at 
>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>  at 
>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
>>  at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>  at 
>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>  at 
>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>  at java.lang.Thread.run(Thread.java:745)
>> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
>> 192.168.2.160/192.168.2.160:1112' is disconnected.
>>  at 
>> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>>  at 
>> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>>  at com.sun.proxy.$Proxy81.isAlive(Unknown Source)
>>  at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1150)
>>  at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1142)
>>  at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>>  at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>>  at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>  at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>  at 
>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
>>  at hudson.model.Build$BuildExecution.build(Build.java:206)
>>  at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>>  at 
>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>>  at hudson.model.Run.execute(Run.java:1818)
>>  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>>  at hudson.model.ResourceController.execute(ResourceController.java:97)
>>  at hudson.model.Executor.run(Executor.java:429)
>> FATAL: Unable to delete script file 
>> C:\Users\Ruslan\AppData\Local\Temp\jenkins4887328775441465037.bat
>> java.nio.channels.ClosedChannelException
>>  at 
>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>  at 
>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
>>  at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>  at 
>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>  at 
>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>  at java.lang.Thread.run(Thread.java:745)
>> Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote 
>> call on JNLP4-connect connection from 192.168.2.160/192.168.2.160:1112 
>> failed. The channel is closing down or has closed down
>>  at hudson.remoting.Channel.call(Channel.java:950)
>>  at 

Re: Help with JNLP-agent lost connections, Nothing on Google helps.

2020-09-22 Thread LnT
Eagerly , I'm waiting for the root cause and resolution 

On Thursday, July 4, 2019 at 7:47:00 PM UTC+5:30 ruslan_zasukhin wrote:

> Hi Everbody
>
> I am fighting with this about 2 weeks and so far no any success. 
> I have read dozen answers on internet about similar troubles - nothing 
> helps.
>
> I have upgrade today Java on master and all windows-slave machines to 
> latest 8_211, not helps.
> Jenkins also is latest 2.183 and all plugins up to date.
>
> *** So, problem is that windows-slave machines SOMETIMES get closed JNLP 
> connection.*
> The same machines sometimes are able to execute job with success.
>
> ** May be jenkins-gurus can check Exception-stack below and point where to 
> search?
>
> ** This failure happens at any time at any place of a job. 
> ** MASTER computer is Mac OS X
> ** We have around few windows computers (mostly VM on virtual Box,) 
> few Linux machines (also virtual bog) and few Macs - physical macs are 
> used.
>
> ** Linux and Mac works fine.
> ** For years Windows also was fine, glitches have started about 2 weeks 
> ago,
> On that day we was yet on 2.163
>
>
> =
>
> FATAL: command execution failed
> java.nio.channels.ClosedChannelException
>   at 
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>   at 
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>   at 
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>   at 
> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
> 192.168.2.160/192.168.2.160:1112' is disconnected.
>   at 
> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>   at 
> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>   at com.sun.proxy.$Proxy81.isAlive(Unknown Source)
>   at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1150)
>   at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1142)
>   at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
>   at hudson.model.Build$BuildExecution.build(Build.java:206)
>   at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>   at hudson.model.Run.execute(Run.java:1818)
>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>   at hudson.model.ResourceController.execute(ResourceController.java:97)
>   at hudson.model.Executor.run(Executor.java:429)
> FATAL: Unable to delete script file 
> C:\Users\Ruslan\AppData\Local\Temp\jenkins4887328775441465037.bat
> java.nio.channels.ClosedChannelException
>   at 
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>   at 
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>   at 
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>   at 
> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>   at java.lang.Thread.run(Thread.java:745)
> Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote 
> call on JNLP4-connect connection from 192.168.2.160/192.168.2.160:1112 
> failed. The channel is closing down or has closed down
>   at hudson.remoting.Channel.call(Channel.java:950)
>   at hudson.FilePath.act(FilePath.java:1072)
>   at hudson.FilePath.act(FilePath.java:1061)
>   at hudson.FilePath.delete(FilePath.java:1542)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:123)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>   at 
>