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

[Jenkins] Handshake error on agent #1048

Closed
PatrickFeistel opened this issue Jul 19, 2023 · 4 comments
Closed

[Jenkins] Handshake error on agent #1048

PatrickFeistel opened this issue Jul 19, 2023 · 4 comments
Assignees
Labels
jenkins solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@PatrickFeistel
Copy link

PatrickFeistel commented Jul 19, 2023

Platform

Azure

bndiagnostic ID know more about bndiagnostic ID

a692711e-6045-f92a-e8e6-ccecca229be6

bndiagnostic output

? Connectivity: Found possible issues
? Resources: Found possible issues
? Apache: Found possible issues
? Processes: Found possible issues

bndiagnostic was not useful. Could you please tell us why?

ports 22, 80, 443 are accessible

Describe your issue as much as you can

I tried to setup a Jenkins Windows Agent from a clean Windows Server VM.
I installed Java 11.

But when trying to connect to Jenkins (via WebSocket) with:
curl.exe -sO https://ci.leansped.de/jnlpJars/agent.jar & java -jar agent.jar -jnlpUrl https://ci.leansped.de/computer/LeanSped/jenkins-agent.jnlp -secret d65a85a1eb878f0db5ae2348d37ede457dbbc1ececa16c7d87fb9078a4506982 -workDir "C:\Jenkins"

I get the following error:

Juli 19, 2023 1:33:51 NACHM. hudson.remoting.jnlp.Main$CuiListener error
SCHWERWIEGEND: Handshake error.
io.jenkins.remoting.shaded.jakarta.websocket.DeploymentException: Handshake error.
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:658)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:696)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:849)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:493)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:337)
        at hudson.remoting.Engine.runWebSocket(Engine.java:678)
        at hudson.remoting.Engine.run(Engine.java:499)
Caused by: io.jenkins.remoting.shaded.org.glassfish.tyrus.core.HandshakeException: Response code was not 101: 400.
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.client.TyrusClientEngine.processResponse(TyrusClientEngine.java:301)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.ClientFilter.processRead(ClientFilter.java:167)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.handleRead(SslFilter.java:402)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.SslFilter.processRead(SslFilter.java:365)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:111)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.Filter.onRead(Filter.java:113)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:295)
        at io.jenkins.remoting.shaded.org.glassfish.tyrus.container.jdk.client.TransportFilter$4.completed(TransportFilter.java:279)
        at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127)
        at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219)
        at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

In the Apache access_log on the master I can find the following message for the request:
"GET /wsagents/ HTTP/1.1" 400 522

Do you have any suggestions where my fault is?

@PatrickFeistel PatrickFeistel added the tech-issues The user has a technical issue about an application label Jul 19, 2023
@github-actions github-actions bot added the triage Triage is needed label Jul 19, 2023
@gongomgra
Copy link
Collaborator

Hi @PatrickFeistel,

Thanks for using Bitnami. You mentioned you have the 80, 443 and 22 ports open in your firewall, but other ports may be required to be opened in the instance firewall for the remote agents to connect with the Jenkins instance, or another additional configurations. I found an article regarding Jenkins agents in Azure, but it seems to be from 2017, so not sure if it still applies

https://www.jenkins.io/blog/2017/04/20/secure-jenkins-on-azure/#connect-jnlp-based-agents

We recommend you to open a new question in the official Jenkins forums for further help on this.

https://community.jenkins.io/

Apart from the above, and according to the bndiagnostic bundle you shared, you are running out of free memory. Can you try using a bigger instance?

-----------------------------------
Display amount of free and used memory in the system
-----------------------------------
Running: free -m
In: /opt/bitnami

Output:

               total        used        free      shared  buff/cache   available
Mem:            1921         841         121           0         958         859
Swap:              0           0           0

Additionally, I see there are a couple of IP addresses performing requests to your server, which may be causing the high resources consumption

-----------------------------------
Check number of lines of Apache access log
-----------------------------------
Running: wc -l access_log
In: /opt/bitnami/apache2/logs/
                                                                                                                                                                                                                                                              Output:

9290 access_log



-----------------------------------
Check performance issues: Count number of requests for the 10 most active IP addresses in the last 100.000 requests
-----------------------------------
Running: tail -n 100000 access_log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 10 | awk '{print $1}'
In: /opt/bitnami/apache2/logs/

Output:

4626
3170
330
299
77
64
18
18
18
17

Can you check the guide below?

https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/deny-connections-bots-apache/

Hope it helps!

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Aug 13, 2023
@PatrickFeistel
Copy link
Author

Hi @gongomgra,

your link https://www.jenkins.io/blog/2017/04/20/secure-jenkins-on-azure/#connect-jnlp-based-agents helped me.
The communication between master and slave over the internal network works!

Thanks for your help :)

@gongomgra
Copy link
Collaborator

Hi @PatrickFeistel,

Thanks for your message. I'm glad you managed to solve your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jenkins solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

2 participants