Problem: After upgrading katello 4.0 to 4.1.3 kickstart installations of CentOS8 is not working and fails with the same error message as the headline
Expected outcome: A working kickstart installation of CentOS8
Foreman and Proxy versions: 2.5.3
Foreman and Proxy plugin versions: 2.5.3
Distribution and version: CentOS7.9+ latest patches
Other relevant data: I think that the problem is because .treeinfo file from BaseOS point out the AppStream repo relative from BaseOS repo. e.g: “repository = AppStream”
This looks similar to my case but based on pulp2: Cannot kickstart CentOS 8
Thank you for this @Thulium-Drake. So if I understand the solution correctly it is to name the appstream repo --name AppStream. In Katello 4.0 it worked for me with --name centos-8-appstream-x86_64. Since I already rolled back to 4.0 I don’t know when I have the opportunity to test this.
Well not exactly, the fix I tried actually generates a repo for anaconda to use that is actually named AppStream. But the issue is that it tries to retrieve AppStream as a subdirectory of my BaseOS repo, where AppStream does not exist.
I think the actual fix is something along the lines where Pulp sees the request coming in and redirects it to the proper AppStream repository.
And it did work for CentOS8 earlier (Katello 4.0 IIRC), but I’m running on Rocky8 as our client decided to no longer use CentOS8. So we’re exploring issues there, and this is the only one I found so far
Well, it seems you are right, I just updated my repo name from Rocky8-AppStream to AppStream. Afterwards I published a new version of the affected CVs, rebooted a client to install and presto!
From what I was able to figure out, the bug was already fixed for CentOS by adding this block:
<% if rhel_compatible && @host.operatingsystem.name.downcase.include?("centos") && os_major >= 8 && medium[:url] && medium[:url].include?("AppStream") -%>
<% appstream_present = true -%>
# renamed from "<%= medium[:url] %>" for CentOS Anaconda to work
repo --name AppStream --baseurl <%= medium[:url] %>
<% else -%>
repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %><%= proxy_string %>
<% end -%>
<% end -%>
<% if rhel_compatible && @host.operatingsystem.name.downcase.include?("centos") && os_major >= 8 && medium_uri && medium_uri.to_s.include?("BaseOS") && !appstream_present -%>
# repository added using BaseOS to AppStream string replacement
repo --name AppStream --baseurl <%= medium_uri.to_s.gsub("BaseOS", "AppStream") %>
<% end -%>
But it only matches CentOS and not the derivatives that use the same repo structure. But as how the rhel_compatible variable already sorts out which derivatives are using the same repo structure, I removed matching CentOS specifically here:
<% if rhel_compatible && os_major >= 8 && medium[:url] && medium[:url].include?("AppStream") -%>
<% appstream_present = true -%>
# renamed from "<%= medium[:url] %>" for CentOS Anaconda to work
repo --name AppStream --baseurl <%= medium[:url] %>
<% else -%>
repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %><%= proxy_string %>
<% end -%>
<% end -%>
<% if rhel_compatible && os_major >= 8 && medium_uri && medium_uri.to_s.include?("BaseOS") && !appstream_present -%>
# repository added using BaseOS to AppStream string replacement
repo --name AppStream --baseurl <%= medium_uri.to_s.gsub("BaseOS", "AppStream") %>
<% end -%>
And that did fix the kickstarting issues in my environment
Great please file a PR many thanks! Yeah this is a difference between Anaconda in RHEL and in CentOS and clones. Let’s talk in the PR how to properly solve this because this would probably break RHEL installations.
Hi I tried again with the upgrade and with the same result. It seems my issue is related to how pulp generates the .treeinfo file for BaseOS. It points to AppStream as relative to BaseOS.
[variant-AppStream]
id = AppStream
name = AppStream
packages = AppStream/Packages
repository = AppStream
type = variant
uid = AppStream
It should instead point to: ../AppStream since the repository is located there and not under BaseOS repo.
Can anyone help me with a workaround or fix. For example is it possible to edit the .treeinfo file and put the correct info into the file?
AH, this is what I am seeing as well. I just noticed that pulp3 is generating its OWN incorrect .treeinfo different from the one in the actual upstream repo servers .treeinfo file.
Which has:
[variant-AppStream]
id = AppStream
name = AppStream
type = variant
uid = AppStream
packages = ../../../AppStream/x86_64/os/Packages
repository = ../../../AppStream/x86_64/os/
I managed to work around this issue with the following. Change ‘CentOS8/BaseOS’ to whatever product/reponame you are using.
sed -i "s#repository = AppStream#repository = ../AppStream#" $(sudo -u postgres /bin/psql pulpcore -t -c "select file from core_artifact where pulp_id=(select artifact_id from core_contentartifact where pulp_id = (select content_artifact_id from core_publishedartifact where publication_id=(select publication_id from core_distribution where base_path like '%CentOS8/BaseOS') and relative_path like '.treeinfo'))" 2>/dev/null | xargs | sed -e "s#^ *#/var/lib/pulp/media/#")
It would be really nice to get a proper fix for this though. Anyone knows who to poke?
I wrote the fix in my previous post. Updating the database will probably break your installation in the long run. If you update the provisioning template as mentioned, it will fix Kickstart for now
Hey everyone, please do not try any hacks or database changes. This seems to be working fine in the newer releases of pulp_rpm (such as 3.14.z), so the proper fix would be either upgrading or backporting the patch to the version used by this older version of Katello.
I am in conversation with Pulp engineers and management about this. It looks like only Pulp 3 was fixed, I am trying to get to an agreement to fix Pulp 2 using some workaround if possible.