Can't publish or remote content view (Katello 4.0)

I can’t publish or promote a content view after upgrading to Katello 4.0

Foreman and Proxy versions:

  • foreman-proxy-2.4.1-1.el7.noarch
  • foreman-release-2.4.1-1.el7.noarch
  • katello-4.0.3-1.el7.noarch

Distribution and version:
RHEL 7.9

I get the following error
Error message: the server returns an error
HTTP status code: 400
Response headers: {“date”=>“Wed, 08 Jun 2022 02:04:47 GMT”, “server”=>“gunicorn/20.0.4”, “content-type”=>“application/json”, “vary”=>“Accept,Cookie”, “allow”=>“GET, POST, HEAD, OPTIONS”, “x-frame-options”=>“SAMEORIGIN”, “content-length”=>“62”, “correlation-id”=>“8867f6256a34438ab47cd2b6ae2512ca”, “access-control-expose-headers”=>“Correlation-ID”, “via”=>“1.1 puppetmaster-prod-01”, “connection”=>“close”}
Response body: {“publication”:[“Invalid hyperlink - Object does not exist.”]}

Additionally if I try promoting an older content view I get the following error
undefined method `>’ for nil:NilClass

I’m trying to get this system back into a clean state so I can continue upgrading to a supported version of Katello

Could you resync / regenerate metadata of the repositories in the CV. That should create the missing publications.

Unfortunately regenerating or re-sycing the repository didn’t work

I did figure out it was related to one of the repositories that I have been unable to sync. I deleted that repository from the content view and I was able to publish it but I need to figure out a way to publish that repo otherwise it breaks our build process (Puppet 6 agent repo)

I posted about it here: