Gerrit server on Raspberry pi 4 loses all days work - gerrit

I have set up a Gerrit server on a Raspberry pi 4 in a classroom for training purposes. In the morning I start it with:
sudo $GERRIT_SITE/bin/gerrit.sh start
In the afternoon I stop it with:
sudo $GERRIT_SITE/bin/gerrit.sh stop
Then I pack up and go home. When I start it at home, nothing has been saved. Everything has worked during the day, we have made commits, code review, merged etc. All is lost, I only have a couple of old commits visible.
What's happening? Doesn't Gerrit sync it's files, or is it an ownership issue?
I notice some files in the server directory are owned by the gerrit user and some by root, and I am starting the server as the pi user. Which ownership should go where? What is the correct way of starting and running Gerrit?

Related

Jenkins node launch stuck

I've a Jenkins node configured on Linux machine which was working fine till last night but today it went offline automatically.
And when tried to launch it stuck with following logs -
just before slave <node-name> gets launched ...
executing pre-launch scripts ...
I'm unable to find the cause of this issue. Could you please guide me how to resolve this?
In my case, machine was not responding. Hence the node went offline. Even after restarting the machine, got same error while launching node.
Hence I deleted existing node and created the same again and it worked.
That mean the agent machine is offline, you can check that agent status in Jenkins to find out reason why its offline.
Need to be execute to bring the agent online again.

Running Docker locally in browser on Windows10: Error - IP Not Found

Ok, so here's my background first. I'm a noob in the world of commandline interfaces, but have been building websites off and on for a long time (10 yrs) using GUI's. So, I'm trying to make the switch to CLI's while also learning Docker.
Right now I'm stuck at trying to get Docker to load anything into my browser window. Here's what I've done successfully:
Installed Docker CE on my Windows 10 Machine
Setup a new virtual switch in Hyper-V Manager per these instructions and restarted the computer.
Created a new machine using this line of code docker-machine create -d hyperv --hyperv-virtual-switch "Primary Virtual Switch" manager1
Now here's where things get a little interesting. When I run the above function (I've done it twice now) it stalls on the line: Waiting for host to start...
I waited for five minutes to see if it would do anything, before killing the operation. (oh, did I mention I'm running PowerShell in Adminstrator Mode - right click on the icon to "run as administrator").
So when I re-open PowerShell to check if the new "manager1" machine has been created it comes back affirmative, but with this:
PS C:\WINDOWS\system32> docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
manager1 * hyperv Running Unknown IP not found
As far as I can tell these are the steps that I need to take to get Docker to run locally in my browser window, but for the life of me, I'm lost!
Oh, I did downgrade my docker-machine version per a suggestion that I read in a git forum comment, but that was to remedy an issue with the docker-machine create command. Part of me wonders if I'm doing too much. But I honestly don't know what to do next.
UPDATE:
I don't know that this is progress, but in the Virtual Switch Manager, I did switch the external network device from the "Ethernet Connection" to the "Dual Band Wireless" option. Then I restarted my machine. Now I'm showing that the state of the machine is "Timeout". I've also started and stopped my "docker-machine manager1". It sites on the (manager1) Waiting for host to start... line for about half a minute, then proceed to the Waiting for SSH to be available... where it just sits. Here's another screen shot that captures this:
Ok, my confusion was a result of looking beyond the documentation and getting a little confused. I still don't have this fully figured out but everything I was attempting to accomplish is detailed in this getting started with Windows 10 pro article.

Jenkins_"Please wait while Jenkins is restarting" , quite a persistent one

I am getting the "Please wait while Jenkins is restarting" issue , I have restarted the Jenkins service but it still isn't working , I tried to install a plugin yesterday and since then it's showing me that message.
Any help would be much appreciated.
The simplest thing which will work almost every time is:
Login to the (windows) server where Jenkins is hosted.
Open CMD Prompt as administrator.
Go to path where jenkins.exe file is placed.
Enter command: jenkins.exe stop and then jenkins.exe start
For Linux server, kill the process and restart again.

Jenkins: service account got locked

Our Jenkins master is running under an AD account, and some slaves on another server are also running under this account. The password got changed two days ago. So we changed the logon password in master and restart the service, but the account got locked in the last two days. How can I troubleshoot this issue?
If the slaves run on Windows then:
Is the process really running under the user you think it should? (task man and find java or run services.msc and check the jenkins service runas -- on lin it would be (ps -ef|grep java or -i jenkins)
Is there a log in the jenkins directory on the slave
Do you see entries in the system logs (LogViewer)?
Have you tried rebooting the slave system? It shouldn't have any impact, but it is easily tried.

please wait while jenkins is restarting- waiting long

I updated some plugins and restarted the jenkins but now it says:
Please wait while Jenkins is restarting
Your browser will reload automatically when Jenkins is ready.
It is taking too much time (waiting from last 40 minutes). I have only 1 project with around 20 builds. I have restarted jenkins many times and worked fine but now it stucks.
Is there any way out to kill/suspend jenkins to avoid this wait?
I had a very similar issue when using jenkins build-in restart function. To fix it I killed the service (with crossed fingers), but somehow it kept serving the "Please wait" page. I guess it is served by a separate thread, but since i could not see any running java or jenkins processes i restarted the server to stop it.
After reboot jenkins worked but it was not updated. To make it work it I ran the update again and restarted the jenkins service manually - it took less than a minute and worked just fine...
Jenkins seems to have a number of bugs related to restarting, and at least one unresolved: jenkins issue
Windows ONLY....
All the solutions here didn't work and restarting the server was not an option. If you are in the same situation.
I had to kill java.exe and restart the jenkins service. After I did this Jenkins reloaded several times and then went back to normal.
I was stuck on the jenkins restarting page for 10-ish minutes untill I did this.
Hope this helps.
Running this in the command line helped me:
service jenkins restart
I had a similar issue when updating plugins from the pluging update page and I marked the restart jenkins options. jenkins only showed the waiting message for a long time.
I solved the issue restoring .bak to .jpi files of the the plugins that I tried to update.
I did the follow in my jenkins
cd $JENKINS_HOME/plugins/
>sudo mv git.bak git.jpi
.
. (more plugins files)
.
>sudo mv ldap.bak ldap.jpi
>sudo /sbin/service jenkins restart
Check Event Viewer.
I found that my Java died.
Faulting application java.exe, version 7.0.250.17, time stamp 0x51c4b3fd, faulting module ntdll.dll, version 6.0.6002.18541, time stamp 0x4ec3e39f, exception code 0xc0000374, fault offset 0x000abc4f, process id 0x1188, application start time 0x01cee4f42968bc81.
Finally I found that it's Jenkins 1.540 problem. Don't use it.
https://issues.jenkins-ci.org/browse/JENKINS-20630
I faced the same issue after upgrading some plugins on Windows. Looking on jenkins.err.log it displayed this error
Exception in thread "main" java.io.IOException: Jenkins has failed to create a temporary file in C:\Users\builder\AppData\Local\Temp\
at Main.extractFromJar(Main.java:350)
at Main._main(Main.java:194)
at Main.main(Main.java:91)
Caused by: java.io.IOException: There is not enough space on the disk
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
at Main.extractFromJar(Main.java:347)
... 2 more
The problem was that the TEMP folder of the jenkins user had lots of temporary files. After cleaning that folder jenkins restarted correctly.
just performed a restart on the server. That fixed the issue !
In Command prompt execute this
C:\>service jenkins restart
Or
You can go for Service currently running in your machine( Win + R ) seach for Jenkins and Click on restart
For me, the cause seemed to be having lots of old job build logs hanging around. To clean them up, I ran:
cd $JENKINS_HOME/jobs
find -name 'builds' | xargs -n 1 bash -c 'rm -rf $0/[1-9]*'
Then I stopped and started Jenkins again, and it came up within a minute.
Credit to: https://stackoverflow.com/a/39230597/2255242
This is an old thread.. but my personal recommendation is to WAIT before attempting to do anything (such as restarting service, etc).
I wasted hours once trying to fix something that turned out to be not an issue in the first place. In the end, I messed things up and wasted a lot of time.
Just because you see errors in the logs doesn't necessarily mean that you need to take action.
The upgrade took about 45 minutes in the end for me. All i did at one point was refreshing my browser window. It can take a while.
Just my opinion
On Win 10: Stopping with the service command from the command line reported failure to stop the service, but I was able to stop it from services.msc (running as administrator). The updates were applied. Sorry, no definitive answer from me. YMMV.
I used TCPView and killed process that was using port 8080. BAsically it was all Java.exe from Jenkins. Killed all processes and restarted Jenkins Service
try to restart that inside windows services console, it will work
I have observed the same issue after installing a plugin and opting to restart the jenkins when no jobs are running.
When I looked at the jenkins server process, it was running fine and no issues.
On restarting the jenkins service using the below command and reloading the browser, Jenkins was up.
sudo service jenkins restart
If Jenkins is taking an unusually long time to restart the best recourse is to check the generated logs to see what may be wrong. However, even that may be of little help because many plugins try to be "quiet" by default, even if they are furiously working to load content. So if all else fails, you may have to resort to manually disabling plugins.
However here is a free tip: Some plugins are known to be messy. For example the Job Config History plugin we observed to write hundreds of thousands of records for both job configuration changes AND agent changes. Removing this plugin, and deleting the configHistory folder fixed one problem where our startup literally took > 4 hours.
In our case, the problem was we were launching ephemeral agents (via docker and/or kubernetes). Each new "agent" was treated as a configuration change. With thousands of agents per day, it didn't take long to fill up a substantial part of the disk with history that never was effectively cleared.
There are other plugins that leak data in this way. And you can also create self-inflicted wounds, e.g. by using a standalone process to remove "obsolete" files. An example where we were "bitten" is a process that tried to discard old build records, but did an incomplete job - and was "warring" with the running Jenkins process. Jenkins will try breaking its neck to load a build.xml record that is empty or incomplete.
Three more tips:
You can install the monitoring plugin. Often when the jenkins UI proper didn't start, we were able to see the /monitoring in action.
Likewise, /userContent can often be loaded even when the rest of the UI is not fully up.
Don't rule out bad actors. It just takes one aggressive script that tries, e.g. to load the entire build history and ship it back via a REST call to effectively deny service to all other UI users.
I try to fix a file named hudson.model.UpdateCenter.xml located /var/lib/jenkins
I change the URL to https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
Finally, restart Jenkins. it solves my problem

Resources