Unable to connect local slave to Jenkins master on AWS - macos

I've set-up a Jenkins on AWS ec2 instance. I have a few machines with me (Ubuntu, Mac) which are supposed to be the slaves.
I've configured the nodes on my Jenkins master and I'm trying to connect the slaves using JNLP-4 protocol via random ports.
I've enabled the Security, Selected the TCP Ports for agents as Random, Enable CLI over remoting, Enable Agent -> Master Access control.
After doing all these, when I try to connect I get the following error:
Vighneshs-MBP:Downloads vighneshpai$ java -jar agent.jar -jnlpUrl https://my.host.name/computer/Mac/slave-agent.jnlp -secret cf400d1a4e0a1dcc75da2b361efafbce3321e17b935bdcf14350a36e
Oct 11, 2018 8:43:50 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: Mac
Oct 11, 2018 8:43:50 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Oct 11, 2018 8:43:50 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3.25
Oct 11, 2018 8:43:50 PM org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
INFO: Using /Users/vighneshpai/Downloads/remoting as a remoting work directory
Both error and output logs will be printed to /Users/vighneshpai/Downloads/remoting
Oct 11, 2018 8:43:50 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://my.host.name/]
Oct 11, 2018 8:43:51 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver resolve
INFO: Remoting server accepts the following protocols: [JNLP4-connect, JNLP-connect, Ping, JNLP2-connect, JNLP3-connect]
Oct 11, 2018 8:43:56 PM org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver isPortVisible
WARNING: connect timed out
Oct 11, 2018 8:43:56 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: https://my.host.name/ provided port:49187 is not reachable
java.io.IOException: https://my.host.name/ provided port:49187 is not reachable
at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:286)
at hudson.remoting.Engine.innerRun(Engine.java:523)
at hudson.remoting.Engine.run(Engine.java:474)
I've also tried using a Fixed port and add the port to the allowed list of ports for Inbound access. Still not able to connect.
Same machines, without any problem connected to the Jenkins running on local machine.
What could be the problem?

Setting the property -Dhudson.TcpSlaveAgentListener.hostName in /etc/default/jenkins resolved my problem.

Changing the port to Fixed instead of random and allowing that particular port in the aws as an exception with TCP, resolved this.

If you've setup http_proxy/https_proxy in the environment variables (and it's a proxy which jenkins doesn't like)) then that too will throw this cryptic error.

Since your Jenkins AWS instance is behind a firewall your slaves won't be able to connect using your given port (49187) if the port itself is not open.
Simply;
Add a security group on AWS console, allowing connections on the port (49187 in this case) for your slave IP address(es).
p.s: If it were to be a random Jenkins machine, a simple sudo ufw allow 49187 should suffice:)

If not a firewall issue, make sure that the setting "Dhudson.TcpSlaveAgentListener.hostName" is set when running the Jenkins to the FQDN of the Jenkins master, or a partial record that the agent can reach for sure.
In our case this wasn't configured as the FQDN and the slave could not reach the record.

My issue was resolved after I performed a Jenkins server restart using the URL
https://JenkinsURL/restart
Or
https://JenkinsURL/SafeRestart

Related

Failed to start SSH Agent: java.lang.RuntimeException: Cannot parse ssh-agent output: '' - TeamCity

System configs:
TeamCity Master: Windows Server 2012 R2 Standard
TeamCity Agent: Windows Server 2022 Datacenter
Infrastructure is in AWS with the correct security groups and open ports needed (9090, 22, 443, etc)
I keep getting this error. I have checked that the ssh-agent is in the path. Keys are added to Teamcity master (private) and GitHub (public key, clone is successful). Windows firewall is also open for port exceptions.
Seems like TeamCity is incompatible with Windows OpenSSH variant. I suggest you to uninstall it (via powershell or windows features) and install git for windows instead which in bundled with all ssh tools.

Exposing USB COM serial devices to Docker Windows container

I have a script that I want to run as a container. It depends on a an USB camera to run.
My host is a Windows 10 IoT Enterprise machine. I have tried exposing the COM serial ports of my host through WSL 2 to a Linux container, but exposing COM serial ports through WSL 2 its currently not supported, so my only option is using Windows containers.
I followed the process used in the Microsoft documentation to expose devices (Just mirroring the OS and version from my host which would be 20H2, and using the GUID for COM serial ports)
docker run --isolation=process --device="class/86E0D1E0-8089-11D0-9CE4-08003E301F73" mcr.microsoft.com/windows:20H2
The container is created and runs for a couple seconds, but when connected to the CLI it displays this error: container 5245931c246cc8181221354158bf7ddad64eb5099a493354a68a39d94feed6f0 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The requested virtual machine or container operation is not valid in the current state. (0xc0370105)
Docker information:
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:56:41 2021
OS/Arch: windows/amd64
Experimental: false
Any feedback will be appreciated, thanks!

Tomcat Connectors (mod_jk) make error

I'm trying to install Tomcat Connectors (mod_jk) on my Mac and I'm following the instructions from the following sites.
http://pablotips.blogspot.com/2015/01/compiling-modjk-on-mac-os-x-1010.html
https://www.bartbusschots.ie/s/2009/05/05/installing-mod_jk-for-apache-22-on-mac-os-x-105-leopard/
I get the following error when I run the make process.
Q.1 How can I fix this error and compile the make process?
Q.2 Will this help me serve my files from the default apache /Sites directory using Tomcat server?
find apr_lib.h
$ sudo find / -name "apr_lib.h"
add lib
LDFLAGS='-L[path]' CFLAGS='-I[path]'
$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' LDFLAGS='-L/usr/include/apr-1' CFLAGS='-I/usr/include/apr-1' --with-apxs=/usr/sbin/apxs
When you are starting Tomcat you are seeing following error as well:
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path
The APR is Apache Tomcat Native library which allows optimal performance in production environments.
Prerequisites for installing APR
APR library
APR-util library
OpenSSL library
Download it from this link http://apr.apache.org/download.cgi and integrate to Tomcat. This will fix your problem
When you installed and integrated then when you restart Tomcat server. You will see like following:
After restarting the Tomcat service, we can get the following message
in catalina.out log if APR was installed successfully.
------------ Oct 07, 2015 8:08:54 AM org.apache.catalina.core.AprLifecycleListener init INFO: Loaded APR
based Apache Tomcat Native library 1.1.29 using APR version 1.5.2. Oct
07, 2015 8:08:54 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], random [true].
Let me know if you need more help from my end

Error, Start Gammu Service

I got error when i trying to start gammu service in Windows Local Services.
The service can work if only i open in command prompt with only this command, and the command prompt must alive as long as the service is on
Is there is another way, to start service? So we no more start from CMD...?
This the log, from smsdlog when i entered the command : gammu-smsd -c smsdrc. So the service work. But still i cannot start in windows service local
Tue 2015/05/26 22:07:41 gammu-smsd[6596]: Connected to Database odbc: aptikad on aptikad_sms
Tue 2015/05/26 22:07:41 gammu-smsd[6596]: Created Windows RW shared memory at 0000000002DE0000
Tue 2015/05/26 22:07:41 gammu-smsd[6596]: Starting phone communication...
Tue 2015/05/26 22:07:50 gammu-smsd[6596]: Inserting phone info
Tue 2015/05/26 22:19:49 gammu-smsd[6596]: Read 1 messages
I have found solutions:
you have to set it as Set as System DSN (not User DSN)
or if you want to use User DSN, Run service as a user not using local account
If it helps, I experienced a lot of problems installing it on Windows yesterday, and I documented successes and failures. It may help you: https://stephenmonro.wordpress.com/2015/06/26/gammu-on-a-windows-computer-for-sms-database/

Entering vagrant ssh for the first time in the terminal

I really don't understand here when I entered vagrant ssh for the first time in the terminal. I'm using laravel Homestead.
output was:
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-30-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information disabled due to load higher than 1.0
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
Last login: Fri Oct 3 01:24:38 2014 from 10.0.2.2
I really don't understand:
Last login: Fri Oct 3 01:24:38 2014 from 10.0.2.2 //because its first time I entered vagrant ssh
and this:
System information disabled due to load higher than 1.0
The last login you see may come from when the Vagrant Box was originally created. For example I just launched a new Vagrant VM based on hashicorp/precise64 and the "last login" showed as September 2012. Subsequent logins will show the last time that you logged in.
Regarding the system information being disabled, see this ServerFault question: System information disabled due to load higher than 1.0 amazon ec2.
Both of the above can safely be considered normal behavior.

Resources