I have a build running under Jenkins (Windows 7) that builds a C++ application. I wrote a small test app in python that runs the application after it is built and tests its networking capabilities. The problem is that the python script fails with
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
The test app works fine if I run it locally (it's only connecting on localhost 127.0.0.1) but it always fails when run under Jenkins.
I thought it was the firewall preventing the connection, but I discovered that the firewall has been turned off on the build machine.
I also have the Jenkins service logging in with an account that has admin access. I don't know where else to look.
Is it possible to run an app that accesses the local network during a Jenkins build?
Update:
As it turns out, my issue has nothing to do with networking, as far as I can tell. The C++ app tries to setup some DirectX9 services and is blocked from doing so under the user privileges provided by Jenkins. As a result, it quits before it even gets to setting up the networking. Now I have a different problem to solve.
Related
Setup:
test framework around latest WebdriverIO v.7
Jenkins on GCP: master - Ubuntu, slave - Windows Server 2022 VM.
connection between Jenkins master and slave is done with GCP jenkins plugin, so Windows slave is being created for test and then dies.
app under test: Electron v14.2.1 based app.
Test - "User can start screenshare"
User start a call.
User select an available screen and start a screenshare.
Problem:
Electron library can not detect available screen for capturing and sreensharing, because there is no RDP connection opened in test session.
In test logs no sources (screen) found:
2022-08-01 07:40:20:409 -00:00 | info | main-api-handler: - open-screen-picker-window - Properties: {
"cmd": "open-screen-picker-window",
"id": 1,
"sources": []
}
Questions:
How can the screen be emulated?
Where the RDP should be established? Should it?
Are there other way than RDP to provide the screen for the Electron app?
The problem was solved by my colleague:
"So the root cause of this issue is that the SSH server which Jenkins uses to configure the node runs as a service, and that means it has problems interacting with desktop apps. Unfortunately, Windows' own SSH server only runs as a service. More explanations here: Starting GUI programs via OpenSSH on Windows?
To resolve this, I installed a separate SSH server (OpenSSH from MSYS2). The machine image is configured to autologin on boot, and sshd is started on logon as the currently logged in user. This gives it access to the desktop, and screenshare tests now seem to work better"
I am new to Jenkins and currently I have to test machine Test1 and Test2 on the test machines , I run ranorex automation tests , every thing works fine until i start getting the issue and that is when I restart my remote desktop(Test1 machine) and remote desktop(Test2 machine) both machine does not comes online on jenkins dashboard and appears as offline , then when I manually start both machine then on dashboard they both came online and my test execution works , previously i tried to use jenkins as service which some how block my automation test execution and error comes "The system needs to be interactive" , so I disabled jenkins service for Windows Service which solves my "The system needs to be interactive" error but I landed with this issue , whenever I perform restart my both test machines went offline
Any help in this regards
Thanks
You can use a schedule task with the 'On Startup' trigger, this is how I'm doing it and it works well.
I have TFS agent runnig on Windows 10.
While trying to run build on hosted agent I get below error:
The agent: Agent-ABC lost communication with the server. Verify the machine is running and has a healthy network connection. For more information, see: https://go.microsoft.com/fwlink/?linkid=846610
This is really frustrating since the machine is runnig fine with no network issues.
How do i resolve this?
Thanks
When attempting to run Boot inside Docker, using the adzerk/boot-clj image, I receive connection refused errors.
Specifically, when the container starts up, boot is started, and then a stack trace is output. The trace (which is not easy to copy and paste between computers with no connectivity) essentially is to do with downloading - https://github.com/boot-clj/boot/releases/download/2.7.2/boot.jar - and receiving "Connection refused" errors.
I’m asking, and answering this, question in the hope that it might help someone else.
Where to start?
My main problem was with a Docker + Clojure + Boot setup, specifically when running “boot” from inside the container. Doing this spewed out a stack trace. This is where my journey begins.
I’m using the adzerk/boot-clj image. I’ve used it locally (OSX) without issue, the problem I experienced was in using a VM (CentOS 7) hosted within a corporate data center.
docker run -ti adzerk/boot-clj
Issuing this starts up the container, the entry point is Boot, and it starts pulling down some jars, specifically boot.jar from Github. The resulting stack trace details several problems, but the crux of it was
“java.net.ConnectException: Connection refused” (connecting to Clojars.org:443)
Hmmm…
So instead of running Boot straight away in the container, I specified the container entry point as “—-entrypoint bash” so I can prod around a little.
So, wget - connection refused.
What about without Docker in the way. Same thing. Connection refused.
After a little wrangling with the network team, I found that the “https_proxy” env variable needs to be set on CentOS to route traffic out to the internet. A very specific issue to me in the situation.
However….
wget is now fine, both on the host, and inside the adzerk/boot-clj container. Boot however was not.
In an effort to simplify things even more, I took Docker out of the equation entirely, and used boot locally.
Installed java-1.8.0-openjdk.x86_64, installed Boot. Same problem.
So dug around a little, and found this - https ://github.com/boot-clj/boot-bin/issues/2
This was a start. It mentions setting the BOOT_JVM_OPTIONS, specifically https.proxyHost and https.proxyPort.
It still didn’t work… Arrrg.
OK, let’s take Boot out of the equation.
I wrote a test harness in Java, very simple that connects to https ://clojars.org and attempts to read the index page. Copied from https ://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html, and setting the JVM_OPTS.
It still fails. “Connection refused”
…. Weird beard.
I finally stumbled on this SO - https ://stackoverflow.com/questions/43695299/java-httpurlconnection-works-on-windows-and-fails-on-linux - specifically the answer from Stephen C
“Java doesn't necessarily respect your system's default proxy settings. Since you are able to "curl" the URL on the Linux machine, the most likely explanation is that Java is not using the proxy that you have configured. The following links explains various ways to configure the proxies for Java:”
So taking the first link - https ://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm - and the answer from Leonel
I issued “java -Dhttps.proxyHost=xxx -Dhttps.proxyPort=80 HelloWorld”
I get an error, but a different one. This is progress. “Unable to tunnel through proxy”
A quick Google of this led me here: http ://www.oracle.com/technetwork/java/javase/8u111-relnotes-3124969.html - “Disable Basic authentication for HTTPS tunneling”
So updated to “java -Dhttps.proxyHost=xxx -Dhttps.proxyPort=80 -Djdk.http.auth.tunneling.disabledSchemes=“” HelloWorld
Profit.
Info:
java -v
openjdk version 1.8.0_144
Openjdk Runtime Environment (build 1.8.0_144-b01)
OpenJDK 64-Bit Server VM (build 25.144-b01, mixed mode)
Sorry for all my profanity Boot.
I have a build/test server which is currently running Jenkins for my continuous integration and it also is acting as my test server where code will be deployed to once built (i hope to rectify this and seperate these at a later date when budget allows)
I have a .NET web solution (nothing complex just Umbraco essentially) that i have in SVN and Jenkins is now building correctly. I now want to deploy it onto the same server using MSDeploy. After the build completes the package is generated but the deploy fails with the error
ERROR_DESTINATION_NOT_REACHABLE: Web deployment task failed. (Could not connect to the remote computer ("xxxxx.xxxxxxx.xxx.xxxx"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started
Here is my msbuild parameters that Jenkins uses
/P:Configuration=Release
/P:DeployOnBuild=True
/P:MSDeployPublishMethod=WMSVC
/P:DeployTarget=MSDeployPublish
/P:PublishProfile=GetSomePixels
/P:MsDeployServiceUrl=https://build.########
/P:AllowUntrustedCertificate=True
/P:CreatePackageOnPublish=True
/P:UserName=#######
/P:Password=########
I've checked the server and the Web Management Service is running and is starting up manually
I've also gone into IIS 8 manager (server 2012) and checked the "Allow Remote Connections" box under "Management Service". Restarted IIS and the WMSVC and still not working.
If i go to https://myserver.co.uk:8172/MsDeploy.axd in a browser it resolves (gives you the warning about an untrusted cert) and then displays a blank page.
Anyone got any ideas as to what i can do? I thought that it may be firewall related and even though it had added an exception to windows firewall for 8172 i have turned the entire firewall off to completely rulle that out and still no luck.
Have run this on the server to check its listening on the correct port
C:\Users\Administrator>netstat -a | findstr 8172
TCP 0.0.0.0:8172 GSP-BUILD:0 LISTENING
TCP [::]:8172 GSP-BUILD:0 LISTENING
Ok i've resolved this. It appears you have to activate the web management service first and then install web deploy and i'd done it the other way round. I uninstalled WebDeploy and re-installed it, restarted the server and its working
Agree with comment.
We had a similar issue. Initial installation even post Web Management Service activation appeared to be incomplete. In our case, even though the service said it was started we couldn't achieve the "green tick" when testing the connection from the Publish dialog when defining a profile.
Reinstalling WebDeploy 3.6 made it function properly.