uyuni-project / uyuni

Source code for Uyuni
https://www.uyuni-project.org/
GNU General Public License v2.0
428 stars 179 forks source link

`mgradm status` reports "Error: failed to get status of the server service: exit status 4" for containerized Uyuni 2024.05 #9023

Open gabjef opened 2 months ago

gabjef commented 2 months ago

Problem description

mgradm status reports "Error: failed to get status of the server service: exit status 4" for containerized Uyuni 2024.05

Steps to reproduce

  1. Run mgradm status
  2. Note stderr message about failing to get status of server service

Uyuni version

Information for package Uyuni-Server-release:
---------------------------------------------
Repository     : @System
Name           : Uyuni-Server-release
Version        : 2024.05-230900.217.1.uyuni3
Arch           : x86_64
Vendor         : obs://build.opensuse.org/systemsmanagement:Uyuni
Installed Size : 1.4 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : Uyuni-Server-release-2024.05-230900.217.1.uyuni3.src
Summary        : Uyuni Server

"Podman server"


# grep PRETTY_NAME /etc/os-release
PRETTY_NAME="openSUSE Leap Micro 5.5"

# uname -r
5.14.21-150500.55.68-default

# mgradm -v
mgradm version 0.1.9 (Master 612f54e)

# mgrctl -v
mgrctl version 0.1.9 (Master 612f54e)

# podman --version
podman version 4.9.5

Uyuni proxy version (if used)

N/A

Useful logs

# mgradm status > /dev/null
Unit uyuni-server-attestation.service could not be found.
Error: failed to get status of the server service: exit status 4


### Additional information

_No response_
rjmateus commented 2 months ago

do you have the server already deployed? What is the output of podman ps?

gabjef commented 2 months ago

@rjmateus Yes we have a server deployed:

uyuni-lab-micro-suse-migration:~ # podman ps
CONTAINER ID  IMAGE                                      COMMAND               CREATED      STATUS                PORTS

                          NAMES
8172bfbeb538  registry.opensuse.org/uyuni/server:latest  /usr/lib/systemd/...  9 hours ago  Up 9 hours (healthy)  0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:4505-4506->4505-4506/tcp, 0.0.0.0:5432->5432/tcp, 0.0.0.0:5556-5557->5556-5557/tcp, 0.0.0.0:9100->9100/tcp, 0.0.0.0:9187->9187/tcp, 0.0.0.0:9800->9800/tcp, 0.0.0.0:25151->25151/tcp, 0.0.0.0:69->69/udp  uyuni-server
rjmateus commented 2 months ago

Is this your production server? Can you run the install command again? First try to just run the install again. If that doesn't solve the issue. Please run uninstall (DO NOT PRUNE VOLUMES to keep the data you already have) then run the install command again. Then let us know if that solve the issue. That service was added after your installation, and the service file is not present.

gabjef commented 2 months ago

@rjmateus Thanks for the feedback... This is a "lab" server so I can experiment here. The Uyuni instance here was created from a migration not a fresh install. Should I still try running an install?

gabjef commented 2 months ago

Here are the results of an install attempt:

uyuni-lab-micro-suse-migration:~ # mgradm install podman
6:11PM INF Welcome to mgradm
6:11PM INF Executing command: podman
Password for the CA key to generate:
Administrator password:
Administrator's email: jeff.gabel@tierpoint.com

Error: failed to compute server FQDN: exit status 1
gabjef commented 2 months ago

@rjmateus Tried to do uninstall and then install. Did not work.

Note that the podman Uyuni server instance in question here was created using mgradm migrate podman and was not a net new installation

uyuni-lab-micro-suse-migration:~ # mgradm uninstall --force
6:17PM INF Welcome to mgradm
6:17PM INF Executing command: uninstall
6:17PM INF Disable uyuni-server service
6:17PM INF Remove /etc/systemd/system/uyuni-server.service
6:17PM INF Container already removed
6:17PM INF Network removed

uyuni-lab-micro-suse-migration:~ # mgradm install podman
6:18PM INF Welcome to mgradm
6:18PM INF Executing command: podman
Password for the CA key to generate:
Administrator password:
Administrator's email: jeff.gabel@tierpoint.com

Error: failed to compute server FQDN: exit status 1
rjmateus commented 2 months ago

Thank you for the report. The initial issue with the error regarding Unit uyuni-server-attestation.service could not be found. should be fixed in the next version. The last error you have, does the machine has the proper hostname set? If can pass the FQDN as last parameter of install command.

gabjef commented 2 months ago

Thank you for the report. The initial issue with the error regarding Unit uyuni-server-attestation.service could not be found. should be fixed in the next version. The last error you have, does the machine has the proper hostname set? If can pass the FQDN as last parameter of install command.

@rjmateus Which machine hostname are you referring to, the Podman server or the Uyuni container instance?

Podman host:

uyuni-lab-micro-suse-migration:~ # hostnamectl hostname
uyuni-lab-micro-suse-migration.lab.tierpoint.com

Container:

uyuni-server:/ # hostnamectl hostname
uyuni-server.mgr.internal

The source server (the one we migrated from) was uyuni-lab-linux-mgmt.lab.tierpoint.com. The IP for uyuni-lab-linux-mgmt.lab.tierpoint.com is resolved via DNS.

rjmateus commented 2 months ago

during installation it runs the command hostname -f on the HOST os server, and it looks like it's failing to compute it. If you run a migrate command, it will no use this and just connect to the old server and copy all data.

mbussolotto commented 1 month ago

I think this has the same root cause of https://github.com/uyuni-project/uyuni/issues/9024 . Please try to run hostname -f on the host as suggested by Ricardo and let us know

aric89 commented 1 week ago

I had this issue upgrading from 2024.07 to 2024.08 with podman. I had migrated from Legacy to 2024.07.

It looks like it worked by running the commands listed above.

mgradm uninstall --force

mgradm install podman

It did throw an error that it took too long to start, but after checking the service and logging into the web GUI, it seems to be working.

Error: cannot wait for system start: server didn't start within 60s. Check for the service status

systemctl status uyuni-server

mbussolotto commented 1 week ago

server-attestation problem should be fixed once this will be merged https://github.com/uyuni-project/uyuni-tools/pull/445