How do I restore administrator account of jenkins - jenkins

I have recently migrated our Jenkins service from Ubuntu to CentOS 7.
The way I did this is by installing a clean instance of Jenkins (2.89) on CentOS 7 and then move the complete contents of JENKINS_HOME from Ubuntu to CentOS 7.
Obviously, when I try to log in as the administrator it fails on the new instance, since I am having the old instance back instead.
Which means I am dealing with the administrator account of old instance.
I tried to find the administrator account of the old instance in one of the /var/lib/jenkins/users//config.xml files.
But I can't find the definition for the administrator account the config files.
Please help.

If you moved this all correctly, there should be no problem with the adminstrator ID. My guess is that you have not set JENKINS_HOME on the new machine before starting Jenkins.

Related

How to install docker on teamcity build agent

On my windows server 2022, I recently installed Teamcity Professional 2022.10 (build 116751) using the windows installer, and once I got it up and running I an agent through 'Install Agent' in the GUI, again using the windows installer.
I then created my first project, which I managed to do a successful build for, also running my tests. The next step was creating a docker image from this build, and pushing it to my repository. Here however, I am facing issues: my installed agent is not compatible for that build, giving me the following incompatibility error:
Incompatible runner: Docker
Unmet requirements:
docker.version exists
docker.server.version exists
While it's clear to me that something is going wrong with the docker version, I'm not sure what exactly, or how/where to fix it. Since both the agent and the teamcity installation are running as windows services (Windows server 2022), I'm not sure if the docker version has to be installed in something running in the agent service, or simply on my windows server installation. The latter is the case: running docker info shows that it is installed.
I have tried to somehow connect to my agent, to try and install docker there, using its hostname through RDP, which does promt me for a username and password, but I have no idea which combination to use there. I have tried using the credentials of my account running the process, but none of the credentials seem to work. Nowhere in the installer did I have to pick any credentials, so I am not sure how to connect to the agent at all, or if I even can/must connect to it to install docker on it.
I found also some logging on the agent:
[2022-11-05 17:07:49,729] INFO - rains.buildServer.AGENT.DOCKER - Failed to parse version: Docker version master-dockerproject-2022-03-26, build dd7397342a
[2022-11-05 17:07:49,729] INFO - rains.buildServer.AGENT.DOCKER - Docker client is not available. Check whether it has been installed and PATH environment variable contains path to it.
[2022-11-05 17:07:49,777] INFO - Server.powershell.agent.DETECT - Found through registry: PowerShell Desktop Edition v5.1.20348.1 64-bit(C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)
[2022-11-05 17:07:49,778] INFO - Server.powershell.agent.DETECT - Detecting PowerShell using CommandLinePowerShellDetector
[2022-11-05 17:07:50,125] INFO - rains.buildServer.AGENT.DOCKER - Docker-compose is not available. Check whether it has been installed and PATH environment variable contains path to it.
In the parameters of my agent I can find the path parameter, which includes 'C:\Program Files\Docker;' which makes me think it is indeed the docker installation of my windows server that matters, but I then fail to see what is going wrong exactly.
Since the agent was installed as a service, it uses the docker version of my windows server installation. I wanted to do a reinstall of docker to see what was going wrong, and I noticed that I couldn't uninstall it through for example control panel, windows seemed to have no idea that it was installed, even though docker info would specify both a client and a server that were running.
After hunting down all the 'hidden' docker files of the installation and reinstalling it on the host machine, these warnings went away.
I'm still not sure if it's possible to connect to the build agent though, but since it seems to use the resources on the host machine, that seems to not be necessary anyhow.

Can I run Docker Desktop on Windows without admin privileges?

I know I need admin rights to install Docker Desktop; but do I have to be an admin to run it? The documentation doesn't say that I do, and Googling doesn't suggest that either; but if I try to run it as a non-privileged user, the process is killed instantly and I get an event-log entry saying "Process requires elevated rights to run."
I'm running Windows 10 Enterprise in a corporate environment and we have non-privileged accounts. Is Docker Desktop not available in this situation or have I just installed it incorrectly somehow?
As of Docker Desktop 2.4 (possibly earlier, I haven't tested) this is supported. From the Windows installation instructions:
If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.
I have not tested it, but this article seems to indicate that you can.
TLDR;
Problem
The reason for requiring an admin session is that the Docker client in the default configuration uses a named pipe to connect to the Docker engine and that named pipe can only be accessed by administrators
Solution
To avoid this, you can simple allow your user FullControl access to that named pipe
Original author also provides a powershell tool with sources to help perform this admin task.
The answer appears to be "no". I couldn't understand how everyone else at work had avoided this problem; but then learnt that they had asked for admin rights over their local machines and been granted them! I've only been here for two and a half years ... :|
Latest version of Docker desktop allows this, but the user should be in docker-users group.
If you are using Windows 10 Home edition, then adding multiple groups to a normal users will be a pain, even you use 'netplwiz'.
To add a new group to user you can use the below command in Powershell.
Run the powershell as admin, then execute
net localgroup "docker-users" "<user_name>" /add
I am able to run Docker Desktop from a non-administrator account on my Windows 10 machine. I can also issue docker commands from a non-elevated command prompt or PowerShell prompt. Note that my non-administrator account is a member of the local group docker-users.
Initially, I installed it from my administrator account, and things worked as expected, but only if I stayed logged in as administrator. If I wasn't logged in as administrator, I would get the named pipe error that aboellinger described in his answer.
Simply launching C:\Program Files\Docker\Docker\Docker Desktop.exe from my non-administrator account fixed the issue (after waiting a few seconds for the process to start). It didn't even ask to elevate permissions.
The addition of my user account to group docker-users solved my problem. However, since I'm not running Win10 Pro, the GUI access to account control is not available. Instead I ran PowerShell as admin and added my user account to group docker-users there.
Docker is insecure by design, if a user can run docker command without admin rights (.i.e. belongs to docker group) this basically means that this user can escape the container and become admin on the host. No idea how exactly it can be done on Windows but it "just works" on Linux.
What is the Docker security risk of /var/run/docker.sock?

jenkins is not showing login page after new installation setup with ubuntu 16.04

I just installed Jenkins in my system OS ubuntu 16.04 and while set admin username password Jenkins is not showing anything on a webpage, please share the solution for that.
Try and make sure that Jenkins is up to date and restart while checking logs. The operating system does not matter in this scenario but the java version does. Make sure you are running Java 1.8

Erlang machine stopped instantly (distribution name conflict?). The service is not restarted as OnFail is set to ignore

I am using RabbitMQ. For some reason the rabbitMQ service stops as soon as you start it. I saw following error in the event log:
RabbitMQ: Erlang machine stopped instantly (distribution name conflict?). The service is not restarted as OnFail is set to ignore.
Someone told me to run this command: erl -sname rabbit
This command generates following output:
{(no error logger present")i neirtr otre: r"mEirnraotri nign ipnr odcoe_sbso o<
t0".,2{.b0a>d awrigt,h[ {eexrilt_p rviaml_uleo:a d{ebra,dcahregc,k[_{feirlle__pr
reismu_llto,a3d,e[r{,fcihleec,k"_efrill_e_prreismu_llto,a3d,e[r{.feirlle",}\,"{e
lriln_ep,r29i3m}_]l}o,a{dienri.te,rgle\t"_}b,o{olti,n1e,,[2{9f3i}l]e},,"{iinniit
t.,egrelt"_}b,o{olti,n1e,,[78{9f}i]l}e,,{\i"niinti,tg.eetr_lb\o"o}t,,{2l,i[n{ef,
i7l8e9,}"]i}n,i{ti.neirtl,"g}e,t{_lbionoet,,7762},][}{,f{iilnei,t\,"dion_ibto.oe
tr,l3\,"[}{,f{illien,e",i77n6i}t].}e,r{li"n}i,t{,ldion_eb,o74o3t},]3},][}{}f
ile,\"init.erl\"},{line,743}]}]}\n"
I am not sure how to interpret this output. I wonder the error is specific to RabbitMQ or erlang.
I have no idea how to procceed. Please suggest.
I have just run into this problem setting up RabbitMq as a service up on a new Windows server. The only thing I can think of that broke it for me is renaming the new windows box after installing the RabbitMq service, but before testing it for the first time.
First off I noticed it ran as an application fine. I solved it by installing the service again using the command from the manual install instructions:
rabbitmq-service install
Assuming that you have your path variables included for the RabbitMq sbin directory.
The only thing that worked for me was to clear the directory C:\Users\xxxxx\AppData\Roaming\RabbitMQ.
(cf. https://groups.google.com/forum/#!topic/rabbitmq-users/138RHzzsORU)
In my scenario, Two directories of Erlang under C:\Program Files with different versions were there, I uninstalled one of the version, also uninstalled RabbitMQ service from Windows services list - Restarted the system.
Again ran RabbitMQ setup - RabbitMQ service was setup successfully.
I ran into the same issue when installing RabbitMQ 3.7.17 via Chocolatey on a Windows Server 2016.
After trying most of the suggested solutions, the one that worked for me was:
rabbitmq-service remove
rabbitmq-service install
rabbitmq-service start
PS: if your PATH is not configured for RabbitMQ, this is the folder you need to run the commands from: C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.17\sbin (if your version is also 3.7.17).
For anyone else looking up this error: double check your config files and SSL files. I ran into this issue when I had specified the ssl_options.cacertfile with ca.pem but the file was mistyped as ca-pem in the directory. Unfortunately RabbitMQ wasn't smart enough to catch the missing file and was dumping with no logs.
I found a name conflict with an env-variable, I use since years - means, this was not a problem with the previous version.
I have "Logs" and apps will write into that directory, usually with their own subdirectories. RMQ uses the same variable name and means a plain filename.
So using: "C:\Users\rabbit\AppData\Roaming\RabbitMQ\log\log" made it working for me - this is in the rabbit's users private environment. So the global settings are now not seen by rabbit. Uff. And it looks like, this is really meant as a filename and after I changed it again to "rabbit#c4711-node.log", it writes like the earlier version. The service starts now for me - but this was really messy and I don't trust it at the moment ;-)
From my perspective, one should run such a service under its own account. If the service is already there, create a local user account - I've used "rabbit" and give it a password. The account I created, got admin right from me - but I currently just dont know, it this is needed. At least it should not - will see this later. If you have account/credentials, go to the service manager and click properties for the service. On the second tab ("log on"), check "this account" and enter username an password. If you have an account for the service you should be able to login with user.
Then you can specify environment variables with user scope.
To do this, logon with the user you created. Go to ControlPanel/System and click "advanced":
In the Environment UI, enter user specific variables
in the top panel:
Note: This was not my rabbit user, because I currently cannot login there. The variables, I entered - not guaranteed, it is correct - are the following:
RABBITMQ_BASE=C:\Users\rabbit\AppData\Roaming\RabbitMQ
RABBITMQ_CONFIG_FILE=C:\Users\rabbit\AppData\Roaming\RabbitMQ\rabbitmq
RABBITMQ_LOGS=C:\Users\rabbit\AppData\Roaming\RabbitMQ\log
RABBITMQ_LOG_BASE=C:\Users\rabbit\AppData\Roaming\RabbitMQ\log
RABBITMQ_NODE_IP_ADDRESS=192.168.26.3
This works for me.
The last time I installed it - some years ago - it was better to understand - this time, sorry, I dont .....
But made it workig.
According to RabbitMQ Install on Windows guide here
Troubleshooting When Running as a Service
In the event that the Erlang VM crashes whilst RabbitMQ is running as
a service, rather than writing the crash dump to the current directory
(which doesn't make sense for a service) it is written to an
erl_crash.dump file in the base directory of the RabbitMQ server (set
by the RABBITMQ_BASE environment variable, defaulting to
%APPDATA%\%RABBITMQ_SERVICENAME% - typically %APPDATA%\RabbitMQ
otherwise).
Basically it means to add a Environment Variable named RABBITMQ_BASE with value %APPDATA%\RabbitMQ
This fixed my problem.
I ran into this issue and the only way I could solve it was by unintalling RabbitMQ, unsintalling Erlang, rebooting the server and installing a clean Erlang and a clean RabbitMQ.
After all this, I could finally install and start the RabbitMQ instance as a windows service.
Tried all the solutions in this post and nothing worked.
Lucky for me it was in our development server, so the loss was acceptable.
The downside to this approach is that you loose all configs (all users, virtual hosts, etc).
It's all gone and you have to reconfigure the RabbitMQ instance from scratch.
Checking in from 2021:
None of this worked for me, the problem was actually that I had another instance of RabbitMQ running inside my WSL Ubuntu distro.
I had the same issue and I just downloaded the latested version of erlang and RabbitmQ and this resolved the issue for me.
While I got the same error, and the root cause for me seems related to Erlang cookie, I fixed it by doing:
Create a folder to store cookie, for example I am using C:\erl-23.2\home .
Add new system environment variable HOMEDRIVE, set the value to C:\
Add new system environment variable HOMEPATH, set the value to erl-23.2\home
This is making use of the rule:
%HOMEDRIVE%%HOMEPATH%.erlang.cookie (usually C:\Users%USERNAME%.erlang.cookie for user %USERNAME%) if both the HOMEDRIVE and HOMEPATH environment variables are set
Since I was doing a migration when the error popped up, I still had my original .erlang.cookie in C:\Users\Me, but the new installation generated a new .erlang.cookie during installation in C:\Windows\System32\config\systemprofile. After making them equal again and performing these steps from the sbin dir, it worked again.
rabbitmq-service remove
rabbitmq-service install
rabbitmq-service start
I had this today trying to install rabbitmq 3.8.0 with erlang 22.0 (64Bit).
Even completely re-installing both erlang and rabbit, deleteing all directories and registry did not help at all. Also i tried to set the needed PATH variables for erlang manually and re-installing the service each time.
The only solution working for me was installing another version of erlang. In my sepcific case i used erlang 21.3 in the 32bit version.
Doing that, no manually action was necessary and rabbit was up and running (after re-installing the service).

OpsCenter on AWS: No permission to create /mnt/cassandra/data

I installed latest OpsCenter (v5.0.0, through AMI 3cf7c979), found here) on EC2 m3.large. When adding new nodes through the admin interface (port 8888), I get this error:
Error: Start stage failed: Failed to start node [ip]: Timed out waiting for Cassandra to start.
The log on the individual server is:
CassandraDaemon.java (line 235) Directory /mnt/cassandra/data doesn't exist
CassandraDaemon.java (line 239) Has no permission to create /mnt/cassandra/data directory
How come new nodes don't have the permissions to create the /mnt/cassandra dir?
I generated a key/secret with all permissions for the "Amazon EC2 Credentials".
If I manually SSH every new instance, create the /mnt/cassandra dir, chown it and restart the service - it works. I expected it to happen automatically.
Opscenter 5.0.0 is configured with a default AMI version. When you attempt a cloud provision via the UI, you'll see an AMI version is already specified. This is the version to use with opscenter. There are newer AMIs (such as the versions you linked) but as yet they are not fully supported in opscenter, which is why there is an issue with provisioning when you attempt to use them.
With the document you linked, that is instructions for using AMIs via the EC2 console. That is a different provisioning experience than when you provision via opscenter. This is the difference you are experiencing.
As a future improvement to opscenter, I think possibly changing that field from a text box to a drop down to make it clear which AMIs are supported might clarify this sort of problem.
I ended up ditching the AMI. It was probably not up-to-date. I installed opscenter with apt-get on a fresh ubuntu machine and everything worked great.

Resources