Jenkins Codeception Phantomjs fails randomly - jenkins

I have some strange behaviour of my test setup. I have some acceptance tests written with codeception and run them on a jenkins server every 5 minutes. 95% of them pass without any problems but 5% fail with two different errors. Most of the time it is:
[Facebook\WebDriver\Exception\UnknownServerException] Error Message => 'URL 'http://www.waldhelden.de/' didn't load. Error: 'TypeError: 'undefined' is not a function (evaluating 'e.getImageData(16,16,1,1).data.toString()')'
and sometimes:
[Facebook\WebDriver\Exception\UnknownServerException] Error communicating with the remote browser. It may have died.
This setup is running on an Amazon EC2 server. At first it was a t2.small. After reading that these errors could be caused by weak servers I upgraded to a t2.medium (2 Cores / 4 GB) but the errors are still there.
Any ideas what to do to get this fixed?
Thanks,
Udo

Related

AWS instance crashes after I run a build job on Jenkins

The build job shows that it's running, but it will eventually crash ('eventually' because I have created different instances, and they end up crashing when I want to deploy the application). After it becomes unresponsive, I'm not able to login to the EC2 instance anymore. I get the following error: "port 22: Operation timed out". I'm using the free tier linux and t2.micro instance type. I tried restarting the instance, but it's still unresponsive.
Does this happen to anybody else?

Unable to listen on port 33848 when running Jenkins tests

I am using jenkins-test-harness to run some tests on my jenkins library code, but when it executes the tests I get the following error for each test :
hudson.UDPBroadcastThread#run: Cannot listen to UDP port 33,848, skipping: java.net.SocketException: Can't assign requested address
The test will pass (if it should pass), but it then takes about 75 seconds for the jenkins server to shut down. I believe that these two are related, but I can't work out why I am getting this error. I have nothing else running on this port.
When I run the tests within a gradle docker container, rather than locally on the command line or inside the IDE (IntelliJ). This is very frustrating. While it does not change the result of the tests, it takes the running from about 10 minutes to over 1 hour and 15 minutes.
Am I missing a setting which is making this fail?
For me this was caused by Jenkins assuming that the default IP address it would be provided with would be IPv4 when in fact my machine was dual stack, preferring IPv6. I resolved it by ensuring that the integrationTest section of my build.gradle file had systemProperties 'java.net.preferIPv4Stack' : true. A bit like this:
integrationTest: {
/* other statements */
systemProperties 'java.net.preferIPv4Stack' : true
}
I must confess I saw no significant difference to my Jenkins shutdown time. I'd be interested to know if this resolves the error message, and if that resolves your overall issue.

Intermittent CLI API 500 when Downloading File

I'm using a gdrive CLI command on a Jenkins web node to automatically download a file from Google Drive during a build process.
This use to work, however, recently (As of a week or two ago) the command to download the file intermittently started producing 500 errors with no message.
The command that's being run is: gdrive download query "name = '16.7.3.zip'".
Sometimes the above command downloads the file, but, sometimes it doesn't. Here's an example of the error output:
Is anyone able to give advice on where to start with this issue, is it something on Google's side?
I've read a few articles explaining that this might be throttling from the API, however, I'd have expected a different error code, i.e. 403 with the error "The download quota for this file has been exceeded.".
I have the following specs installed:
gdrive: 2.1.0
Golang: go1.6
OS/Arch: linux/amd64
Intermittent 500 errors are allowed for in the Google Drive API. You simply need to do an exponential backoff and retry. Generally they are caused by internal timeouts within the Drive infrastructure. Sometimes these are related to service problems, other times they can be caused by a request that causes a large amount of work.

502 Bad gateway error for rails production environment?

When I deploy my rails app in jenkins I am getting 502 gateway error for sending form data. But when I run the same in local with all three environments it is working properly.
Updated Question:
My rails app is working properly in local machine in all test,dev,prod environment.
But when I deploy it into Jenkins CI I am getting the above error for form data submission to another server.
The problem is I configured my unicorn server
timeout 5
but the response from the service call taking time so increased time
timeout 15
now it is working

AWS Deployment with Rails - Inaccessible

Could you tell me what happens with AWS Server now? From 3 weeks ago, util now, whenever I deploy my RoR app into AWS Server (using ElasticBeantalk tool), I meet a strange issue
Deployment time is quite good (just about 10-15 minutes), and the healthy of server is still green. But after that, the server is inaccessible. This status last about 3 - 4 hours !!! Then, everything is OK, server run fast and smoothly. I totally don't understand server healthy still un-change although this error happen. Everything I can do is "refresh browser periodically until it run"
I don't think my application is bigger enough with total deployment time like that. It just takes me about 20 minutes on local (production mode)
Here're some error I found out when server is hang:
"An error occured while starting up the preloader."
"Gateway timeout" when loading application.js (using chrome debug)
"Bad gateway" when loading application.js (using chrome debug)
Please give me some advise to solve that. I have been stucked on this issue for a long time
Thanks

Resources