Project

General

Profile

Actions

Bug #36217

closed

Upgrade from Foreman 3.5.2 to 3.6 shows class Certs::Puppet is already declared

Added by Matt Norwood about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
foreman-installer script
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

I have attempted the upgrade several times:

[root@prlforeman01 foreman]# foreman-maintain service status --brief
Running Status Services ================================================================================
Get status of applicable services:

Displaying the following service(s):
redis, postgresql, pulpcore-api, pulpcore-content, , , tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy | displaying redis [OK]
/ displaying postgresql [OK]
/ displaying pulpcore-api [OK]
/ displaying pulpcore-content [OK]
/ displaying [OK]
/ displaying [OK]
/ displaying tomcat [OK]
- displaying dynflow-sidekiq@orchestrator [OK]
- displaying foreman [OK]
- displaying httpd [OK]
- displaying puppetserver [OK]
- displaying dynflow-sidekiq@worker-1 [OK]
- displaying dynflow-sidekiq@worker-hosts-queue-1 [OK]
- displaying foreman-proxy [OK]
- All services are running [OK]
--------------------------------------------------------------------------------

[root@prlforeman01 foreman]# hammer status;hammer ping
Version: 3.5.2
API Version: v2
Database:
Status: ok
Server Response: Duration: 0ms
Plugins:
1) Name: foreman-tasks
Version: 7.1.1
2) Name: foreman_ansible
Version: 10.4.1
3) Name: foreman_openscap
Version: 5.2.2
4) Name: foreman_puppet
Version: 5.0.0
5) Name: foreman_remote_execution
Version: 8.2.0
6) Name: katello
Version: 4.7.4
Smart Proxies:
1) Name: prlforeman01.norwood-cs.com
Version: 3.5.2
Status: ok
Features:
1) Name: pulpcore
Version: 3.2.0
2) Name: openscap
Version: 0.9.2
3) Name: dynflow
Version: 0.9.0
4) Name: script
Version: 0.9.0
5) Name: ansible
Version: 3.5.4
6) Name: puppetca
Version: 3.5.2
7) Name: puppet
Version: 3.5.2
8) Name: logs
Version: 3.5.2
Compute Resources:

candlepin:
Status: ok
Server Response: Duration: 35ms
candlepin_auth:
Status: ok
Server Response: Duration: 44ms
candlepin_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
katello_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
pulp3:
Status: ok
Server Response: Duration: 764ms
pulp3_content:
Status: ok
Server Response: Duration: 576ms
foreman_tasks:
Status: ok
Server Response: Duration: 4ms

database:
Status: ok
Server Response: Duration: 0ms
candlepin:
Status: ok
Server Response: Duration: 32ms
candlepin_auth:
Status: ok
Server Response: Duration: 32ms
candlepin_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
katello_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
pulp3:
Status: ok
Server Response: Duration: 89ms
pulp3_content:
Status: ok
Server Response: Duration: 84ms
foreman_tasks:
Status: ok
Server Response: Duration: 2ms

[root@prlforeman01 ~]# dnf repolist
repo id repo name
appstream Rocky Linux 8 - AppStream
baseos Rocky Linux 8 - BaseOS
centos-ansible-29 CentOS Configmanagement SIG - ansible-29
extras Rocky Linux 8 - Extras
foreman Foreman 3.6
foreman-plugins Foreman plugins 3.6
katello Katello 4.8
katello-candlepin Candlepin: an open source entitlement management system.
powertools Rocky Linux 8 - PowerTools
pulpcore pulpcore: Fetch, Upload, Organize, and Distribute Software Packages.
puppet6 Puppet 6 Repository el 8 - x86_64
zabbix Zabbix Official Repository - x86_64
zabbix-non-supported Zabbix Official Repository non-supported - x86_64

Commands I run:
25313 Mar 22 11:47:41 hammer status;hammer ping
25314 Mar 22 11:48:07 foreman-rake katello:upgrade_check
25315 Mar 22 11:48:59 dnf update -y https://yum.theforeman.org/releases/3.6/el8/x86_64/foreman-release.rpm
25316 Mar 22 11:49:15 dnf update -y https://yum.theforeman.org/katello/4.8/katello/el8/x86_64/katello-repos-latest.rpm
25317 Mar 22 11:49:26 dnf module enable -y katello:el8 pulpcore:el8
25318 Mar 22 11:49:32 dnf clean all
25319 Mar 22 11:49:35 dnf -y update
25320 Mar 22 11:54:29 foreman-maintain service stop
25321 Mar 22 11:55:48 tail -100 /var/log/foreman-installer/katello.log
25322 Mar 22 11:56:02 foreman-installer

Error each time I attempt to upgrade:
2023-03-22 11:56:30 [ERROR ] [configure] Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Certs::Puppet] is already declared; cannot redeclare (file: /usr/share/foreman-installer/modules/foreman_proxy_content/manifests/init.pp, line: 407) (file: /usr/share/foreman-installer/modules/foreman_proxy_content/manifests/init.pp, line: 407, column: 7) on node prlforeman01.norwood-cs.com

From Foreman Installer:
[root@prlforeman01 ~]# foreman-installer
2023-03-22 12:00:31 [NOTICE] [root] Loading installer configuration. This will take some time.
2023-03-22 12:00:37 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2023-03-22 12:00:37 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2023-03-22 12:00:48 [NOTICE] [configure] Starting system configuration.
2023-03-22 12:00:57 [ERROR ] [configure] Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Certs::Puppet] is already declared; cannot redeclare (file: /usr/share/foreman-installer/modules/foreman_proxy_content/manifests/init.pp, line: 407) (file: /usr/share/foreman-installer/modules/foreman_proxy_content/manifests/init.pp, line: 407, column: 7) on node prlforeman01.norwood-cs.com
2023-03-22 12:00:57 [NOTICE] [configure] System configuration has finished.

There were errors detected during install.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.
The full log is at /var/log/foreman-installer/katello.log

Revert back to snapshot. Currently staying on 3.5.2 as it's stable.

Actions #1

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Project changed from Foreman to Installer
  • Category set to foreman-installer script
  • Target version set to 3.6.1
  • Found in Releases 3.6.0 added

That's odd, because I'm sure we had tested this in our pipelines. I missed one commit in our foreman_proxy_content module (https://github.com/theforeman/puppet-foreman_proxy_content/commit/12bbe7a90132c79fba7d7fe775a40b70da3e0e5a), which breaks things.

One thing to note is that Katello 4.8 is still a release candidate that isn't even officially announced. I've added that to the release announcement to clarify: https://community.theforeman.org/t/foreman-3-6-0-is-now-available/32890/2

Another is that it's safer to stop services and then run dnf update. This is because a dnf update may restart services using new code, which can lead to an inconsistent state. Looks like it's written this way in the manual, which is a bug so I've opened https://github.com/theforeman/foreman-documentation/pull/2086.

Actions #2

Updated by The Foreman Bot about 1 year ago

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

Updated by The Foreman Bot about 1 year ago

  • Fixed in Releases 3.6.1 added
Actions #4

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Subject changed from Upgrade from Formen 3.5.2 to 3.6 to Upgrade from Foremen 3.5.2 to 3.6 shows class Certs::Puppet is already declared
  • Status changed from Ready For Testing to Closed
  • Fixed in Releases 3.5.3 added
Actions #5

Updated by Matt Norwood about 1 year ago

I find it interesting that this issue has been closed. 3.6.0 which is all that is available in the 3.6 repo is still broken:
https://yum.theforeman.org/releases/3.6/el8/x86_64/

You pushed the fix/commit to 3.6.1, which isn't available in the repo yet, and in 3.5.3, which again, isn't available in the 3.5 repo:
https://yum.theforeman.org/releases/3.5/el8/x86_64/

It's supposedly fixed in 3.6.1, and 3.5.3, which neither I can get to, and this has been closed? What is more funny is https://theforeman.org/ still shows 3.6.0 as the latest "Stable" release for 3.6, which of course we know from this bug, is NOT fixed. Again, you pushed to 3.6.1, not 3.6.0. So shouldn't https://theforeman.org/ say that 3.5.2 is the latest working release that is available for us end users?

Of course, I could go to 3.7.0-develop, as it's working. But ya, no, 3.6.0 which is what is in the repo for me to upgrade to from 3.5.2, is "still" broken. So I guess the question would be, since you fixed it in 3.6.1, when will 3.6.1 be available at https://yum.theforeman.org/releases/3.6/el8/x86_64/? And again, shouldn't you fix the front page of theforeman.org website? You know, 3.6.0, is still broken and I can't get 3.6.1 yet.

Terrible documentation on theforeman.org. You could definitely do better.

Actions #6

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

Our process is defined that we set the Fixed in versions on future versions. Right now they aren't released yet, but they will be. Though technically Katello 4.8.0 (which you're upgrading to) is only a release candidate, so some bugs are to be expected. I know it's not great that Foreman 3.6.0 is GA, but Katello isn't.

For 3.6.1 I was waiting on resolving another bug (#36230) to avoid having to do two releases in a very short time. There are only so many hours in a day to get work done.

The latest version was also mentioned in https://community.theforeman.org/t/foreman-3-6-0-release-process/32879/3 and something I'll think about. In this case it was also a bit complicated because of one being GA while the other one isn't.

Actions #7

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Triaged changed from No to Yes
Actions #8

Updated by Matt Norwood about 1 year ago

The bug I reported had nothing to do with the RC of Katello 4.8. The bug I reported is with the foreman-installer in 3.6.0 which will not be fixed in 3.6.0 but is fixed in 3.6.1, but 3.6.1 does not currently have a release date. If you go to http://theforeman.org, read at the top of your site it says 3.6.0 is the latest stable release for foreman (again, not talking Katello). But in 3.6.0, the foreman installer is broken. I would think that you would want to remove the 3.6.0 reference on http://theforeman.org since the foreman installer is broken in 3.6.0. Again, I'm not talking the release candidate of Katello 4.8. I'm talking about the broken foreman installer in foreman 3.6.0.

Actions #9

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

The area you mention is specifically only used in Katello, so there was no option to test it prior to the release of Katello. It's in a module that's entirely unused in the regular Foreman installer so this bug simply can't be reproduced in a scenario without Katello.

By now I've also realized why our automated tests don't catch this. They perform a Katello installation (without Puppet) on 3.4, then upgrade it to 3.5, then upgrade it to 3.6 and then install Puppet. But the only way to trigger it is to install Puppet on a version prior to 3.6 and the upgrade.

You can follow the release process here: https://community.theforeman.org/t/foreman-3-6-1-release-process/33008

Actions #10

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Subject changed from Upgrade from Foremen 3.5.2 to 3.6 shows class Certs::Puppet is already declared to Upgrade from Foreman 3.5.2 to 3.6 shows class Certs::Puppet is already declared
Actions #11

Updated by Ewoud Kohl van Wijngaarden about 1 year ago

  • Fixed in Releases deleted (3.5.3)
Actions

Also available in: Atom PDF