Today, I have tried to upgrade my content proxy to katello 4.0. It kind of ended up in a complete disaster and for now I reverted back.
During the yum update I have noticed an error for foreman-installer:
/etc/foreman-installer/scenarios.d/katello.migrations/200605154320-dont-use-pulpcore-rpm-on-upgrades.rb:9:in `block (2 levels) in load_migrations': undefined method `[]' for true:TrueClass (NoMethodError)
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migrations.rb:25:in `instance_eval'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migrations.rb:25:in `block (2 levels) in load_migrations'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migration_context.rb:10:in `instance_eval'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migration_context.rb:10:in `execute'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migrations.rb:38:in `block in run'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migrations.rb:35:in `each'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/migrations.rb:35:in `run'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/configuration.rb:324:in `run_migrations'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/kafo_configure.rb:115:in `initialize'
from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `new'
from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.2.1/lib/kafo/kafo_configure.rb:50:in `run'
from /sbin/foreman-installer:8:in `<main>'
warning: %post(foreman-installer-katello-1:2.4.0-1.el7.noarch) scriptlet failed, exit status 1
Non-fatal POSTIN scriptlet failure in rpm package 1:foreman-installer-katello-2.4.0-1.el7.noarch
After the package update, I stopped all service and reran the installer as I did during my previous upgrades:
# foreman-maintain service stop
# foreman-installer
I also cleaned up following the commands of this:
# foreman-maintain content remove-pulp2
i.e. manually running/adjusting the commands listed as it would otherwise remove python-ldap which I need for our ipa-client.
The installer didn’t complain, but afterwards none of my clients was able to access the repositories anymore.
For any repository (e.g during yum repolist) I just got a message like this:
https://foreman-proxy.example.com/pulp/repos/ORG/Production/centos7-epel7/custom/centos7/extras_x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
I guess it’s the same issue I have seen before after the pulp3 switchover on my main server, but as I have removed the old pulp2 directories everything went missing instead of being outdated.
I thought running an optimized sync on the proxy might fix this. However, the sync showed new issues: the sync task got stuck at ~70% and it already showed a couple of errors:
Task canceledTask canceledTask canceledTask canceledTask canceledduplicate key value violates unique constraint "rpm_variant_variant_id_uid_name_type_764da894_uniq"
DETAIL: Key (variant_id, uid, name, type, packages, distribution_tree_id)=(AppStream, AppStream, AppStream, variant, Packages, 5e279f89-9fd6-40b6-8985-69cabafa8db8) already exists.
Task canceledduplicate key value violates unique constraint "rpm_variant_variant_id_uid_name_type_764da894_uniq"
DETAIL: Key (variant_id, uid, name, type, packages, distribution_tree_id)=(AppStream, AppStream, AppStream, variant, Packages, 5e279f89-9fd6-40b6-8985-69cabafa8db8) already exists.
Task canceledTask canceledTask canceledduplicate key value violates unique constraint "rpm_variant_variant_id_uid_name_type_764da894_uniq"
DETAIL: Key (variant_id, uid, name, type, packages, distribution_tree_id)=(AppStream, AppStream, AppStream, variant, Packages, 5e279f89-9fd6-40b6-8985-69cabafa8db8) already exists.
duplicate key value violates unique constraint "rpm_image_name_path_platforms_dist_188721ef_uniq"
DETAIL: Key (name, path, platforms, distribution_tree_id)=(boot.iso, images/boot.iso, x86_64, b038687d-acf9-4894-a753-664413a8b4b1) already exists.
Task canceledTask canceledduplicate key value violates unique constraint "rpm_image_name_path_platforms_dist_188721ef_uniq"
DETAIL: Key (name, path, platforms, distribution_tree_id)=(boot.iso, images/boot.iso, x86_64, b038687d-acf9-4894-a753-664413a8b4b1) already exists.
Eventually, I canceled the task and reverted the proxy to the snapshot before the upgrade. Everything is fine at the moment but of course, this is kind of a dead end.