Can not start up service Gerrit on Ubuntu 16.04 - gerrit

In my case, I tried to install Gerrit code review in ubuntu 16.04. In that time, i have found one problem with enable service Gerrit using command line
sudo systemctl enable gerrit
and executed this above command, then I got error message bellow
gerrit.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable gerrit
How to fix this problem?

Related

How do you resolve the GitLab error "Error response from daemon: invalid condition: 'not-running'"?

I set up a Windows GitLab runner that's supposed to download a Docker image from our Container Registry and then run a build script in the pipeline. Unfortunately the Docker container never launches due to the following error:
Running with gitlab-runner 15.1.0 (76984217)
on WindowsDockerRunner wZMWQZYi
Resolving secrets
Preparing the "docker-windows" executor
Using Docker executor with image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Pulling docker image mcr.microsoft.com/windows/servercore:ltsc2019 ...
Using docker image sha256:e6b07227af5ca9303c2112b574f6f27f38135bbf9df29d829142410221967401 for mcr.microsoft.com/windows/servercore:ltsc2019 with digest mcr.microsoft.com/windows/servercore#sha256:26c6c296a4737ba478fe3c3e531b098f89b5562c40b416ba6fb8177ac462d1af ...
Preparing environment
Running on RUNNER-WZMWQZYI via
runner2...
ERROR: Job failed (system failure): prepare environment: Error response from daemon: invalid condition: "not-running". Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information
The error message doesn't clearly state what the cause of the problem is and the documentation that it references doesn't mention anything about "condition". Based on the link pointing to shell profiles I suspect it might have something to do with the shell that's being run, but when I run the Docker container locally it boots into PowerShell just fine.
Does anyone know how to solve this?
I came across this issue after installing Docker Engine using the Windows Server install script, which fetches docker.exe and dockerd.exe from https://master.dockerproject.org, These builds were last updated in March 2022, I found gitlab-runner 14.9 and earlier work okay with this version (released prior to March 2022), but 14.10 does not (released 2022-04-19) nor do any newer versions.
Installing Docker Desktop resolves this as it provides the latest version. However using Docker Desktop introduces licensing issues. An alternative is to manually install Docker Engine / update the version downloaded by the Microsoft script.
Docker Engine builds are provided on the Moby GitHub project to download from https://download.docker.com/win/static/stable/x86_64/ downloading the lastest version from here and replacing the docker executables in C:\Windows\System32 fixes the problem, working with the latest gitlab-runner.
An alternative is to use the docker-engine chocolatey package (which incidentally I maintain) which provides installation scripting for the above stable builds:
choco install docker-engine
There is also an open issue with the Windows-Containers team to move off (out of date) nightlies: https://github.com/microsoft/Windows-Containers/issues/256 which would provide a stable docker build, through the Microsoft recommended installation method.
Was finally able to solve this issue. We had the Docker Engine installed on our GitLab Runner, but that doesn't seem to be sufficient for GitLab CI/CD. After installing Docker Desktop on the runner the issue disappeared and we were able to run the pipeline.
After some trial and error I got it up and running.
I have another server running the gitlab-runner and docker without any issues (no docker desktop installed, which is not allowed because of licensing stuff).
The server I'm trying to setup right now is a 'redundancy' build server.
So to find out what was my problem, I started switching things from one build server to the other. Currently, it appears that simply downgrading to the gitlab-runner V13.4.0 was enough.
I did reregister the runner, since gitlab stated that the V15.x.x version was using executor "unknown".
Not sure what is going on there, but at least I can continue building now.

Docker daemon is not running

Newbie in this area. I have installed the new version of Docker in my windows PC. I am using windows 10 Pro. I have tried the very basic docker command but it is not working. I have also run the docker as administrator. Getting the below error always
docker: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.39/containers/create: open //./pipe/docker_engine: Zugriff verweigert In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
Doing an combination of following two things might help :
- Exit docker from tray (lower right hand of the windows desktop)
- Relaunch it as administrator (Start Menu --> Type "Docker" --> Right Click the icon --> "Run as Administrator"
Please see if you still get the error.
Seems to be related to the below issue:
I had the same issue - I was able to resolve the issue by running
power shell with Admin privs. I validated this was the same behavior
for running the commands via elevated cmd prompt. It also enabled
docker run hello-world command which was returning the error message
...Access is denied. In the default daemon configuration on Windows,
the docker client must be run elevated to connect. This error may also
indicate that the docker daemon is not running.
here
I did the following :
In windows you can go to the show hidden icon in the taskbar, hover your cursor on the docker icon and right click then a drop down menu will be shown and from that click restart.
press windows key + R
%appdata%\Docker
delete all the the files in the folder
killed the docker process in task bar.
try to open docker gui again.
check out this link if none of the above works, check out this link : Docker cannot start on Windows
check link : https://bobcares.com/blog/docker-error-response-from-daemon-i-o-timeout/
if nothing is work try to uninstall and reinstall the docker.
What worked for me:: First clicking on troubleshoot and then doing reset to factory defaults.
Warning: the existing containers will be gone
I got this error because my Docker Desktop was not running. Resolved by starting Docker Desktop.
If you don't have any WSL installed :
Ensure that the Hyper-V feature enabled, you can do this by searching "Turn Windows features On or Off".
Using Docker desktop, disable the option to "Use the WSL 2 based engine"(which is recommended, so only use if you don't have any WSL installed).Docker desktop settings
In case, Docker Deamon is still not running when using it for the first time, this video might help. I solved this issue by downloading WSL 2 file and installing it manually on my windows machine.
I also have the same error while i try to run docker, the problem in my case is i never install WSL2 linux kernal in my window. After installation my docker running well.
follow these steps to make your docker running well in windows.
First uninstall your current docker and make sure your window have the following features:
Hyper-V installed and working
Virtualization enabled in the BIOS
Hypervisor enabled at Windows startup
This link guide you to complete above steps
Now open this link to download the WSL 2 linux kernal pakage
After the installation of WSL 2 is done. Install your docker again, follow the instructions and it will work perfectly.
By simply opening the Docker on the desktop just
and restarting
the Docker, you can easily resolve it.
Open the troubleshoot of Docker and restart the docker as shown in this image.
Troubleshooting docker
I faced the same issue and what worked for me is
Navigate to the below link, download and install the Linux kernel update package (step4)
https://learn.microsoft.com/en-us/windows/wsl/install-win10#step-4---download-the-linux-kernel-update-package
Make sure to restart your system after installation
What worked for me:
Go to Docker Desktop > Troubleshoot (the bug icon) > Reset to factory defaults. All containers need to be pulled again from registry but was up again in no time.
Hope this works for someone!
Two things:
Run the docker as administrator
Run Powershell as administrator
and see the trick.
Step 1 - Enable the Windows Subsystem for Linux
Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as Administrator) and enter this command:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Step 2 - Enable Virtual Machine feature
Open PowerShell as Administrator and run:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Step 3 - Download the Linux kernel update package
WSL2 Linux kernel update package for x64 machine
Run the update package downloaded in the previous step
Step 4
Open PowerShell and run this command to set WSL 2 as the default version when installing a new Linux distribution:
wsl --set-default-version 2
Step 5
Restart you PC
note - Please enable Virtualization Technology from the boot menu its important
to check and verify: Go to taskmanager and click on the performance and see Virtualization enable or not.
enter image description here
Open Powershell and run bellow cmd:
cd "C:\Program Files\Docker\Docker"
./DockerCli.exe -SwitchDaemon
After installation of Docker connect to PowerShell as admin and run below command.
It will start the Docker service.
Step 1> cd "C:\Program Files\Docker\Docker"
Step 2> ./DockerCli.exe -SwitchDaemon
This thread was one of the first that I found, so wanted to compile some of the solutions I've found for various issues.
I am using Windows 11 & a first time docker install.
Issue 1: Docker desktop was 'stopped' and whenever I tried to run a package in the terminal I was getting a long message ending in: This error may also indicate that the docker daemon is not running.
Solution:
Follow the official steps on how to install WSL 2 at https://learn.microsoft.com/en-us/windows/wsl/install
Open PowerShell and run command:
wsl --update
Uninstall Docker.
Delete temporary data:
C:\Users<USER>\AppData\Roaming\Docker
C:\Users\ProgramData\Docker
C:\Users\ProgramData\DockerDesktop
Reinstall Docker, ensure wsl box is ticked during install.
Restart computer.
Run Docker as administrator.
Run PowerShell as administrator.
Run the following command:
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
If this doesn't work, you may need to run the above command one or two more times.
Issue 2: Docker desktop settings check box 'Use the WSL 2 based engine (Windows Home can only run the WSL 2 backend)' was greyed out and unchecked.
Solution:
Open: C:\Users<USER>\AppData\Roaming\Docker\settings.json
Change: "wslEngineEnabled": false to "wslEngineEnabled": true
Reinstall Docker & restart computer. (not sure if necessary.)
Run Docker as administrator.
Run PowerShell as administrator.
Run the following command:
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
If this doesn't work, you may need to run the above command one or two more times.
i tried numerous ways to solve this but i noticed that when my docker is not working, the Ubuntu app for windows shouldn't work also. As such after digging through numerous errors, i found that hypervisor launch is not enabled in my boot configuration (Windows). You can check if it is set to on using the command
bcdedit /enum | findstr -i hypervisorlaunchtype
if it is set to off, set it to auto
bcdedit /set {current} hypervisorlaunchtype Auto
now, if the docker issue is still not resolved, you can try switching the containers to ubuntu if it is not set yet, hope this helps.
I spent all day troubleshooting this exact issue (after a Windows 11 update, which a few other threads suggested might be the cause), and tried most things suggested in this thread.
What eventually worked was completely removing docker and WSL (guide here), rebooting, and reinstalling WSL then docker again.
Hope this helps someone else.
You can use cmd in centos 7
systemctl restart docker
Yes, suggested solution worked for me.
After installation of Docker connect to PowerShell as admin and run below command.
It will start the Docker service.
C:\Program Files\Docker\Docker/DockerCli.exe -SwitchDaemon

Cannot Connect to Docker Daemon - Windows 10 WSL

I am using Ubuntu Bash is windows 10. I have been struggling with connecting to the Docker Daemon. There has been couple of queries in the past which I followed with not luck.
From the search I could see that the TCP endpoint need to be open for connection to the Docker Daemon. Followed the following excellent posts with no luck:
https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/
https://blog.bigfont.ca/run-docker-from-the-wsl/
The content of the above blogs are of few months back. May be process has changed for today.
Please guide.
Try the following command from your WSL command line :
echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashr
If you are getting wsl-2 , hypervyser issues try following hacks
1) Open services from windows start menu
2. Click on Startup type and select Automatic
Note:
If you are getting the issue of " Access denied " while selecting Startup type as Automatic then open your PowerShell and type the following command:
(Make sure you have admin access for PowerShell)
Set-Service LxssManager -StartupType "Automatic"
Done, Now open your docker desktop app

How to uninstall Jenkins installed from jenkins.war on Ubuntu 14.04

I have downloaded and installed Jenkins on an Ubuntu 14.04 operating system. Jenkins is currently running as a service.
Once Jenkins has been installed on Ubuntu 14.04 via the Jenkins.war file, how is it uninstalled?
I'm trying to do some backup testing and cannot seem to find the answer anywhere. The only directions I've been able to find are instructions to uninstall the Jenkins package. When I run any similar commands for uninstalling Jenkins packages, I receive the message:
Package 'jenkins' is not installed, so not removed
or
Package 'jenkins-executable-war' is not installed, so not removed
Thanks in advance for any help!
We need to stop jenkins first.
sudo service jenkins stop
Then try
sudo apt-get remove --purge jenkins
If problem still exists, Try removing it manually using these instructions.
https://stackoverflow.com/a/11621186/3086531
for RHEL/Linux guys please stop the jenkins and then remove below folder
$user.home/.jenkins
Like if user home directory is /root then remove /root/.jenkins

Jenkins won't start after plugin installation *and does not log anything*

I installed Jenkins' Gradle plugin and used the automatic restart option via the Jenkins web interface. Jenkins seemed to hang on the "restarting..." page, so I finally tried to manually restart the Jenkins service on the server (64-bit Debian 7) using service jenkins restart.
Now, Jenkins is no longer running at all (verified with ps -ef | grep -i [J]enkins and service jenkins status), and when I try service jenkins [re]start, I see an [ ok ] message but nothing else seems to happen. I've deleted /var/log/jenkins/jenkins.log, and each time I try a service start (or restart), the log file reappears, but it's blank (ls -lA shows that the file was recently made, but cat produces no output). I also tried rebooting the server, with no effect. I finally deleted the Gradle folders under /var/lib/jenkins/plugins, which also did not appear to make a difference.
How do I even begin to approach this problem? Should I just re-install Jenkins?
EDIT: System info:
> uname -a
Linux AUC-Workstation1 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux
According to dpkg -l, I'm using Debian's jenkins package, version 1.617.
EDIT 2: I'm actually using the jenkins package provided directly by Jenkins, as per the instructions here.
I just had a problem where multiple Jenkins plugins were breaking Jenkins startup (after an upgrade) and here is the procedure I followed to resolve the issue, which might work for other plugin startup issues.
I'm working on an Ubuntu server, but I expect that this would work for Debian if it's going to work at all - I encourage others to adjust the procedure:
logged into the server and switched to the jenkins user (sudo su jenkins in my case)
went to the main jenkins directory
renamed plugins to plugins.problems_YYYYMMDD
previously, I attempted to disable the plugins, but this did not work for me (system still would not start)
created an empty directory plugins
restarted jenkins (sudo service jenkins restart)
In my case, this started just fine
iteratively followed the following procedure to add plugins back in
copied 1 or more plugins from plugins.problems_YYYYMMDD/ to plugins/
restarted jenkins
went to the plugin center and installed updates as available
sometimes I needed to install updates in a particular order due to dependencies
evaluated results in 'Manage Old Data'
I think I'm facing some manual updates of the old data
Note: if you know which plugins are likely the problem, then it is easier to just disable or temporarily (re)move them rather than (re)moving all of the plugins!
I never did figure out the initial problem, but I did get Jenkins working again, sort of.
I uninstalled Jenkins (using apt-get purge) and then re-installed it. This time it failed to start because it needed Java 7, but I apparently only had Java 6 installed (this surprised me, because I thought I had previously configured Jenkins to use Java 7 on that machine). So I installed openjdk-7-jdk and openjdk-7-jre, set JAVA and JAVA_HOME appropriately in the Jenkins config file, and started the service again. This allowed Jenkins to start.

Resources