Project

General

Profile

Bug #34161

Katello 4.2 to 4.3 upgrade doesn't trigger apipie:cache:index, breaking some new hammer commands

Added by Evgeni Golov 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:

Description

In Katello 4.2 hammer gained new parameters to "capsule content synchronize": --content-view and --repository.

However, for that to work, hammer needs a fresh apidoc, and it seems that wasn't generated.

From the upgrade log:

# grep -i 'Foreman::Rake.apipie:cache' /var/log/foreman-installer/katello.log
2021-12-16 10:45:57 [DEBUG ] [configure] Adding relationship from Foreman::Rake[db:seed] to Foreman::Rake[apipie:cache:index] with 'notify'
2021-12-16 10:45:57 [DEBUG ] [configure] Adding relationship from Package[tfm-rubygem-foreman-tasks] to Foreman::Rake[apipie:cache:index] with 'notify'
2021-12-16 10:45:57 [DEBUG ] [configure] Adding relationship from Package[tfm-rubygem-katello] to Foreman::Rake[apipie:cache:index] with 'notify'
2021-12-16 10:45:57 [DEBUG ] [configure] Adding relationship from Package[tfm-rubygem-foreman_puppet] to Foreman::Rake[apipie:cache:index] with 'notify'
2021-12-16 10:45:57 [DEBUG ] [configure] Adding relationship from Package[tfm-rubygem-foreman_remote_execution] to Foreman::Rake[apipie:cache:index] with 'notify'
2021-12-16 10:45:58 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/notify: notify to Foreman::Rake[apipie:cache:index]
2021-12-16 10:45:58 [DEBUG ] [configure] /Stage[main]/Foreman::Plugin::Tasks/Foreman::Plugin[tasks]/Package[tfm-rubygem-foreman-tasks]/notify: notify to Foreman::Rake[apipie:cache:index]
2021-12-16 10:45:58 [DEBUG ] [configure] /Stage[main]/Katello::Application/Foreman::Plugin[katello]/Package[tfm-rubygem-katello]/notify: notify to Foreman::Rake[apipie:cache:index]
2021-12-16 10:45:58 [DEBUG ] [configure] /Stage[main]/Foreman::Plugin::Puppet/Foreman::Plugin[puppet]/Package[tfm-rubygem-foreman_puppet]/notify: notify to Foreman::Rake[apipie:cache:index]
2021-12-16 10:45:58 [DEBUG ] [configure] /Stage[main]/Foreman::Plugin::Remote_execution/Foreman::Plugin[remote_execution]/Package[tfm-rubygem-foreman_remote_execution]/notify: notify to Foreman::Rake[apipie:cache:index]
2021-12-16 10:45:58 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Adding autorequire relationship with User[foreman]
2021-12-16 10:46:44 [DEBUG ] [configure] Foreman::Rake[apipie:cache:index]: Starting to evaluate the resource (1274 of 1894)
2021-12-16 10:46:44 [DEBUG ] [configure] Foreman::Rake[apipie:cache:index]: Evaluated in 0.00 seconds
2021-12-16 10:46:44 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Starting to evaluate the resource (1284 of 1894)
2021-12-16 10:46:44 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: '/usr/sbin/foreman-rake apipie:cache:index' won't be executed because of failed check 'refreshonly'
2021-12-16 10:46:44 [DEBUG ] [configure] /Stage[main]/Foreman/Foreman::Rake[apipie:cache:index]/Exec[foreman-rake-apipie:cache:index]: Evaluated in 0.00 seconds
2021-12-16 10:46:44 [DEBUG ] [configure] Foreman::Rake[apipie:cache:index]: Starting to evaluate the resource (1285 of 1894)
2021-12-16 10:46:44 [DEBUG ] [configure] Foreman::Rake[apipie:cache:index]: Evaluated in 0.00 seconds

I would expect to see the following line:

[DEBUG ] [configure] Executing with uid=foreman: '/usr/sbin/foreman-rake apipie:cache:index'

Environment:
  • CentOS 7
  • puppet-agent-6.25.1-1.el7.x86_64
Steps to reproduce:
  • Install Katello 4.2
  • yum localinstall https://yum.theforeman.org/releases/3.1/el7/x86_64/foreman-release.rpm https://yum.theforeman.org/katello/4.3/katello/el7/x86_64/katello-repos-latest.rpm
  • foreman-maintain service stop
  • yum upgrade
  • foreman-installer
  • hammer --reload-cache capsule content synchronize --help → no --content-view
  • foreman-rake apipie:cache:index
  • hammer --reload-cache capsule content synchronize --help--content-view now present
katello-4.3.log.gz katello-4.3.log.gz 134 KB Evgeni Golov, 12/16/2021 11:25 AM

Associated revisions

Revision a293e008 (diff)
Added by Ewoud Kohl van Wijngaarden 5 months ago

Fixes #34161 - Run apipie:cache:index after db:migrate

With Puppet you can write:

Class['A'] ~> Class['B'] ~> Class['C']

This implies Class['A'] ~> Class['C'] and rspec-puppet actually will
tell you that chaining is there, but it doesn't actually happen. This
was reported in https://github.com/rodjek/rspec-puppet/pull/821.

In this particular case it means that if DB seeding doesn't happen then
the apipie caches indexes aren't refreshed. By chaining it to db:migrate
there's a much bigger chance it actually happens.

Normally apipie:cache:index needs to run after a package is updated so
ideally this would actually be done in packaging, but this is the
workaround we've been using for a long time.

History

#1 Updated by Evgeni Golov 5 months ago

  • Subject changed from Katello 4.2 to 4.2 upgrade doesn't trigger apipie:cache:index, breaking some new hammer commands to Katello 4.2 to 4.3 upgrade doesn't trigger apipie:cache:index, breaking some new hammer commands

#2 Updated by The Foreman Bot 5 months ago

  • Assignee set to Ewoud Kohl van Wijngaarden
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/puppet-foreman/pull/1010 added

#3 Updated by The Foreman Bot 5 months ago

  • Fixed in Releases 3.2.0 added

#4 Updated by Ewoud Kohl van Wijngaarden 5 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Ewoud Kohl van Wijngaarden 4 months ago

  • Target version set to 3.1.1
  • Category set to Foreman modules

This is affecting Foreman 3.1 and blocking Katello 4.3's pipelines. It should be cherry picked.

#6 Updated by Ewoud Kohl van Wijngaarden 4 months ago

  • Triaged changed from No to Yes
  • Fixed in Releases 3.1.1 added

Also available in: Atom PDF