Jenkins crashes on npm install - jenkins

I'm trying to build our code through jenkins. I set it up 4 days ago and everything worked back then, but now every build fails. At first I thought it was because of the Jest testing I added (jest kept hanging instead of stopping) but I fixed that with --forceExit and the problem still exists.
With every build, it seems like Jenkins is crashing silently. I couldn't find any useful logs or anything. What is weird though, is that I tried to execute the commands through ssh in the jenkins folder where the project was placed by jenkins. When I did that, the npm install was really slow and the whole server was hanging. There are two other projects running from that server with nodejs, one with keystonejs that crashes every time this happens, the other one is plain express and had no problems. Any idea what can be the problem here?
EDIT: It's also happening more randomly and I couldn't connect to my server for a while through ssh or any other possibility.

If is simple what you need to do, then don't use jenkins, is just to heavy.
Instead build an sh file that builds what you need, the down side of this is that you have to execute it by hand when you need to build.

Related

When I click the "build now" link in Jenkins, I only want that to build one time but it builds twice

I am completely new to using Jenkins. I'm going through some "step-by-step" videos by RagHav Pal and have reached the point where I have made a batch file that runs command lines when I hit the "Build Now" link. It has been established in the "Build" and "Execute Windows batch command" area of the configuration "Build Environment" tab.
The build is happening as expected, and I do expect some of the Robot Framework Test Cases to fail (which they do). The problem is this: When the build is happening, it is queueing up another build right behind it. It then runs that build too when the first one is done? This queueing continues. Builds keep on building and I have to hit the "x" on the queued build to stop this madness.
I have no idea why it's rebuilding, nor do I know what I've done to cause this. I need the details please, if anyone can help. I want one build... period! Nothing more.
THINGS I HAVE TRIED:
I've tried restarting Jenkins after upgrading any plugins that looked like they needed upgrades.
I've started Jenkins localhost:9090 using Microsoft Edge and discovered I'll get endless builds. However, if I start Jenkins localhost:9090 using Chrome browser I only get 2 builds. Why this difference? I want 1 build only.
I've taken a look at my java folder to see what is there. It has "jdk-12.0.1" which I believe is used for Eclipse. It has "jdk1.8.0-221" and "jre1.8.0-221" and I renamed each of these folders to something else and restarted Jenkins from command line to see which one is getting used. It is using the "jre1.8.0-221". Should I be running the jdk? Dunno? I put everything back the way it was.
I verified the "Poll SCM" check box is not selected.
THE BATCH FILE:
c:
cd C:\Users\TestLab\Desktop\Workspaces\JenkinsWorkspace\RobotFramework\GoDirectProject1
robot GDTest/GoDirectSuite1.robot
echo Completed
EXPECTED AND ACTUAL RESULTS:
I'm expecting the build to happen one time and stop
Actual results are as explained above in "Summarize the Problem"

Missing build from jenkins

I ran a build yesterday, hoping I would read some logs today.
I came today, and got an error 404 when trying to access the build. Strange.
Running another build, shows my build actually did run, but it is unreachable.
Is there a way to get my hands on the logs?
Notice build #10 is missing, even though it did start.
Probably a windows update is to blame for this.
The broken link is http://192.168.80.10:8080/job/Dev_git/10
More information on a run can usually be found using the context menu under Console Output. This is only accessible if you have the correct permissions set in Jenkins.
This of course does not work, if a build is missing. One reason could be that your Jenkins is configured in a way that only a certain number of historic builds are kept, see Build History Missing in Jenkins for an explanation how to deal with that.
However, your case seems to be different, because a build in the middle of the history is missing. For this, I suggest to look around in the jobs directory of your Jenkins installation where it stores all the configuration and run data.
References
https://wiki.jenkins.io/display/JENKINS/Administering+Jenkins
Where does Jenkins store configuration files for the jobs it runs?

Jenkins detecting more than one instance

I realize that this question has been asked before but I feel like my case is different.
About five hours after I launch jenkins I sometimes see this message appear when loading the jenkins administrator panel:
Jenkins detected that you appear to be running more than one instance of Jenkins that share the same home directory '’. This greatly confuses Jenkins and you will likely experience strange behaviors, so please correct the situation."
This is strange, it happens every time I launch it, eventually making Jenkins unusable. I installed Jenkins via homebrew and launch is via the jenkins CLI. I manually do this so I don't see how it's possible that Jenkins launches twice.
I reinstalled Jenkins after completely removing it. Still no luck.
Anyone have any issues like this before?
I also had a similar problem and solved it with following checks:
Check if another java process is running which runs jenkins e.g. in unix using top
If you're using tomcat, search for a second instance of tomcat having the jenkins.war exploded somewhere
Could be helpful to just have one version of java installed

Jenkins Update Loses Old Jobs

I am on a redhat linux box. I recently updated Jenkins to version 1.509 only to find that after doing so it has "forgotten" two of my jobs/projects. The jobs can still be found on my Jenkins machine under /var/lib/jenkins/jobs, but they no longer show up in the Jenkins GUI. I attempted to re-create them based off the configuration file I have, but I am not confident I have totally re-created the functionality they had.
I also tried to copy the job and or rename it hoping that would get jenkins to see it, but no luck. I had tried cp -r /var/lib/jenkins/jobs/JOB1 /var/lib/jenkins/jobs/JOB2. I also restarted the service a number of times. Finally I updated all of my plugins on the off chance that was somehow related.
So my question is "How can I get Jenkins to notice these jobs?" or failing that "can I run these jobs from in the terminal?"
NOTE: I am not discouraging others from upgrading Jenkins. After I upgraded Jenkins did complain about a number of things which I didn't pay enough attention to which I believe got me into this mess in the first place.
If I were you, I would try the Jenkins CLI (from $JENKINS_URL/cli) and use the create-job command and feed the job configuration file to the cli's stdin.
If that does not help, I would inspect Jenkins log files (you are saving stdout and stderr of Jenkins somewhere, right?) for any errors or clues. If the job failed to load because of some tag that you can guess is provided by a plugin, try to remove that part from the config file.
If that does not help, I would upgrade Jenkins. I think there might be some fixes related to this in the LTS version changelog since 1.509.
And above all... if I were you, I would start making backups of the job configuration files.
I regularly back up the global config.xml, all the job config.xml files and all the plugins. Using these I can set up my Jenkins from scratch. And I do that to set up a test instance where I try any plugin or Jenkins core upgrade. If I see no problems after running a few of the trickiest builds, I know I can upgrade the production instance with much more confidence.

Jenkins - Not Showing Build History

I have a multi-module maven project that I'm building with Jenkins called MyApp. I also have another maven project that depends on MyApp, and this project runs integration tests on MyApp.
In Jenkins, when I view the status of the MyApp project it successfully displays a list of previously run builds and I can click on them to find out more information (and view the console output).
However, the integration test project, while it does build properly, it only displays previously run builds for about 5 minutes, at which point something happens and jenkins completely forgets the build ever ran.
On the filesystem, I am able to cd to:
/usr/share/tomcat6/.jenkins/jobs/My App Integration Test/builds
and ls reveals
me#myserver:/usr/share/tomcat6/.jenkins/jobs/My App Integration Test/builds$ ls
1 2 2013-01-24_16-46-59 2013-01-24_16-51-58 2013-01-24_18-05-09 2013-01-24_18-58-46 3 4
that all my previously run builds are right there, where they should be.
Jenkins has a "discard old builds" feature in its project configuration page, but I obviously have it unchecked.
I'm running jenkins in tomcat6 on Ubuntu.
Help please?
Jenkins has resolved this issue as of 1.505 I recommend everyone upgrade who does not wish to switch from Jenkins back to Hudson.
This can be done through the GUI via Manage Jenkins->Upgrade to Latest (Note for this to work you need to have the appropriate permissions for Jenkins)
More information can be found here For linux users aptitude update or yum update jenkins should also work for you.
I have jenkins running with 1.517, still facing the issue if the number of builds goes more than 65 without discard option. Found that reload configuration bring back the build history.
I've seen this issue and have always been able to resolve it by following these steps:
Going to \\[buildmachine]\C$\Jenkins\jobs\[jobname]
Removing the builds folder.
Removing shortcuts to lastStable and lastSuccessful.
Open file nextBuildNumber and change the number to 1.
Then build new jobs and they no longer disappear.
As mentioned by Dave Bacher, this appears to be a bug in Jenkins. I switched over to Hudson and problem fixed!

Resources