Undefined method `repository_href' for nil:NilClass

when i try to sync repo i see this error

undefined method `repository_href’ for nil:NilClass

whats the work around to fix it ?

foreman 2.2.0
katello 3.17

it was working fine and suddenly stop working

It sounds like you are hitting: Bug #31247: “NoMethodError: undefined method `repository_href’ for nil:NilClass” when syncing yum repos - Katello - Foreman

but this was fixed in 3.17.1. What version of katello is installed?

  rpm -q tfm-rubygem-katello

tfm-rubygem-katello-3.17.0-0.2.rc2.2.el7.noarch

I upgrade to

rpm -q tfm-rubygem-katello
tfm-rubygem-katello-3.17.1-1.el7.noarch

still same issue.

undefined method `repository_href’ for nil:NilClass