uyuni-project / uyuni

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

Bootstrap repo ubuntu-22.04-amd64 Error - Uyuni server 2024-02 #8355

Closed krakazyabra closed 2 months ago

krakazyabra commented 8 months ago

Problem description

This error connected with issues marked as resolved:

Behaviour is the same:

Creating bootstrap repo for ubuntu-22.04-amd64-uyuni Error: Too few arguments for command 'includedeb'! Syntax: reprepro [--delete] includedeb <.deb-file> There have been errors! Error creating bootstrap repo.


### Steps to reproduce

1. Fresh installation
2. `spacewalk-common-channels ubuntu-2204-pool-amd64-uyuni ubuntu-2204-amd64-main-uyuni ubuntu-2204-amd64-main-updates-uyuni ubuntu-2204-amd64-main-security-uyuni`
3. wait for syncing
4. create bootstrap repo
```shell
ccm:/var/log/rhn # mgr-create-bootstrap-repo -c ubuntu-22.04-amd64-uyuni

Creating bootstrap repo for ubuntu-22.04-amd64-uyuni
Error: Too few arguments for command 'includedeb'!
Syntax: reprepro [--delete] includedeb <distribution> <.deb-file>
There have been errors!
Error creating bootstrap repo.

Uyuni version

ccm:/var/log/rhn # zypper info Uyuni-Server-release
Loading repository data...
Reading installed packages...

Information for package Uyuni-Server-release:
---------------------------------------------
Repository     : uyuni-server-stable
Name           : Uyuni-Server-release
Version        : 2024.02-230900.213.1.uyuni3
Arch           : x86_64
Vendor         : obs://build.opensuse.org/systemsmanagement:Uyuni
Support Level  : Level 3
Installed Size : 1.4 KiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : Uyuni-Server-release-2024.02-230900.213.1.uyuni3.src
Summary        : Uyuni Server
Description    :
    Uyuni lets you efficiently manage physical, virtual,
    and cloud-based Linux systems. It provides automated and cost-effective
    configuration and software management, asset management, and system
    provisioning.

Uyuni proxy version (if used)

No response

Useful logs

No response

Additional information

At first I've checked reprepro version

ccm:/var/log/rhn # zypper info reprepro

Information for package reprepro:
---------------------------------
Repository     : Main Repository
Name           : reprepro
Version        : 5.4.1-bp155.1.6
Arch           : x86_64
Vendor         : openSUSE
Installed Size : 1.2 MiB
Installed      : Yes (automatically)
Status         : up-to-date
Source package : reprepro-5.4.1-bp155.1.6.src
Upstream URL   : https://salsa.debian.org/debian/reprepro
Summary        : Debian repository metadata generator
Description    :
    reprepro is a tool to manage a repository of Debian packages (.deb).  It
    stores files either being injected manually or downloaded from some other
    repository (partially) mirrored into one pool/ hierarchy.  Managed packages
    and files are stored in a Berkeley DB, so no database server is needed.
    Checking signatures of mirrored repositories and creating signatures of the
    generated Package indexes is supported.

It was from Main Repo

ccm:/var/log/rhn # zypper search -s reprepro
Loading repository data...
Reading installed packages...

S | Name     | Type    | Version          | Arch   | Repository
--+----------+---------+------------------+--------+--------------------
i | reprepro | package | 5.4.1-bp155.1.6  | x86_64 | Main Repository
v | reprepro | package | 5.4.0-3.4.uyuni3 | x86_64 | uyuni-server-stable

I downgraded it to Uyuni's version

zypper install --oldpackage reprepro-5.4.0-3.4.uyuni3.x86_64

restart server, check again

ccm:/var/log/rhn # mgr-create-bootstrap-repo
1. ubuntu-22.04-amd64-uyuni
Enter a number of a product label: 1

Creating bootstrap repo for ubuntu-22.04-amd64-uyuni
Error: Too few arguments for command 'includedeb'!
Syntax: reprepro [--delete] includedeb <distribution> <.deb-file>
There have been errors!
Error creating bootstrap repo.

After I took upstream mgr_bootstrap_data.py from github and replace my /usr/share/susemanager/mgr_bootstrap_data.py Nothing changed.

Also I noticed that in /srv/www/htdocs/pub/repositories/ appeared new directory:

ccm:/var/log/rhn # tree /srv/www/htdocs/pub/repositories/
/srv/www/htdocs/pub/repositories/
└── ubuntu
    └── 22
        └── 4
            └── bootstrap.tmp
                ├── conf
                │   └── distributions
                └── debs

6 directories, 1 file

For it's strange that bootstrap repo has extension .tmp

cFabij commented 8 months ago

There is actually no need to manually create the bootstrap repository. When spacewalk-repo-sync finishes syncing the common channels the bootstrap repository will also be created.

Neither is it necessary to downgrade or replace any packages for Uyuni to work (as far as I know).

I would recommend

  1. Restoring or re-installing Uyuni server to its default installation status
  2. (If not already happened through re-installing Uyuni server) Deleting the Ubuntu 22.04 channels via spacewalk-remove-channel -a ubuntu-22.04-pool-amd64-uyuni
  3. Adding the common channels again via spacewalk-common-channels ubuntu-2204-pool-amd64-uyuni ubuntu-2204-amd64-main-uyuni ubuntu-2204-amd64-main-updates-uyuni ubuntu-2204-amd64-main-security-uyuni ubuntu-2204-amd64-uyuni-client
  4. Immediately synchronize the channels via spacewalk-repo-sync -p ubuntu-2204-pool-amd64-uyuni (this also prints the relevant output - bootstrap repository creation included - on the console)

After that, please check /srv/www/htdocs/pub/repositories/22/4/bootstrap again.

If the bootstrap repository problem persist, please provide the following logs:

Teamspeak5 commented 8 months ago

INTRODUCTION

Hi everyone! I've been recently looking into issues I had on my production Uyuni server. To remove any doubts about the configuration I had there because I didn't make everything from zero there, I've recently re-made one in a laboratory environment.

STEPS TAKEN

So I've done the following: 1) Clean installation of Uyuni [2024.02] 2) Created and synced the channels for Ubuntu using the following command: spacewalk-common-channels ubuuni ubuntu-2204-amd64-main-uyuni ubuntu-2204-amd64-main-updates-uyuni ubuntu-2204-amd64-main-security-uyuni ubuntu-2204-amd64-uyuni-client The sync seems to have gone successfully, since I see all the packages in the Uyuni webUI.

P.S. The command, if I'm not mistaken, should also try to generate its bootstrap automatically

3) Re-try to generate the bootstrap using the following command: mgr-create-bootstrap-repo The command seems to have also finished successfully

Result :

Uyuni01:/ # mgr-create-bootstrap-repo
1. ubuntu-22.04-amd64-uyuni
Enter a number of a product label: 1

Creating bootstrap repo for ubuntu-22.04-amd64-uyuni
copy 'venv-salt-minion-3006.0-24.2.uyuni.amd64-deb'
Skipping inclusion of 'venv-salt-minion' '3006.0-24.2.uyuni' in 'bootstrap|main|amd64', as this version already exists.
Exporting indices...
Uyuni01:/ #

4) I then tried to search for the bootstrap.sh file to put on the VMs that should be located at /srv/www/htdocs/pub/bootstrap/ but the folder is empty

QUESTIONS

Q1 Am I doing something wrong? Q2 What should I do to get the bootstrap to install venv-salt-minion on the clients I would like to connect to Uyuni?

CONCLUSION

Any feedback is more than welcome. Have a great day !

Teamspeak5 commented 8 months ago

...

QUESTIONS

Q1 Am I doing something wrong? Q2 What should I do to get the bootstrap to install venv-salt-minion on the clients I would like to connect to Uyuni?

CONCLUSION

Any feedback is more than welcome. Have a great day !

I troubleshooted the problem further and solved it. I just needed to use the following command : mgr-bootstrap --script=bootstrap-<EDITED_NAME>.sh

I'm gradually learning more and more Please do not hesitate to correct me if I'm doing anything wrong!

After doing that, I began to also take a look into Virtual Host Manager in Uyuni, I'm trying to add two ESXi hosts to Uyuni. I can't wait to see if I'll be successful at it! 😄

~ Rei

cFabij commented 8 months ago

Hi @Teamspeak5!

Congratulations on staying with your problem and solving it : ) Though I guess in the future it would be better to open your own issue instead of writing in someone else's.

Some remarks on your problem:

  1. spacewalk-common-channels does indead create the bootstrap repository. You can see that after mgr-create-bootstrap-repo the log states (emphasis mine)

Skipping inclusion of 'venv-salt-minion' '3006.0-24.2.uyuni' in 'bootstrap|main|amd64', as this version already exists.

  1. There are multiple ways to onboard clients (the first two need the bootstrap repository created by spacewalk-common-channels) .

Happy learning : )

Teamspeak5 commented 8 months ago

My bad, @cFabij. I hope this didn't seem rude. I've never created an issue on GitHub, but I'll follow your advice to divide discussions for their pertinent purposes. I wrote here because I have been trying to ask for help several times on the Uyuni IRC chat for so long. It has only happened once in four/five times (different problems) that I have received a reply or feedback from the people present and active.

Thanks so much for your feedback. I see that GitHub is more active. Forgive me again, maybe for the offhand behavior, but I am also new to GitHub.

Have a great day everyone ❤️

mbussolotto commented 2 months ago

@krakazyabra is there anything else we can do? if no, can you please close the issue? Thanks