RedHatSatellite / satellite-clone

Utility to assist cloning an existing Satellite 6 server to a new host
GNU General Public License v3.0
37 stars 31 forks source link

Fixes #31763 - Stop removing postgresql.conf unecessarily #384

Closed mccun934 closed 2 years ago

mccun934 commented 3 years ago

The removal of this file is causing problems cloning Satellites as the file gets re-created with the installer as root:root and is managed by Puppet which it was not done in previous older versions of Satellite.

sthirugn commented 3 years ago

ah thank you for catching up @mccun934

lgtm, but I am going to request @johnpmitsch @chris1984 @anandkumaragrawal to review because these changes were added intentionally recently.

chris1984 commented 3 years ago

If tests pass with dolly, I am fine with acking it. I am sure @mccun934 has tested it :)

anandkumaragrawal commented 3 years ago

The reason for removing this file is, while cloning below error was seen:

Error: rh-postgresql12-postgresql-syspaths conflicts with postgresql-9.2.24-4.el7_8.x86_64

Later when removing the postgresql-9.2, another error was seen as below:

/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/creates: Checking that 'creates' path '/var/opt/rh/rh-postgresql12/lib/pgsql/data/PG_VERSION' exists

Then after removing the file '/var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.conf' and running the installer again fixed the issue.

But if your reproducer works well, We are fine with acking it.

johnpmitsch commented 3 years ago

Thanks @mccun934 running the dolly tests now!

johnpmitsch commented 3 years ago

Dolly isn't succeeding, the 4 clones failed, looks like similar errors on the first install:

[DEBUG 2021-02-01T14:47:53 main] 
[DEBUG 2021-02-01T14:47:53 main] 
[DEBUG 2021-02-01T14:47:53 main] Running locking of package versions
[DEBUG 2021-02-01T14:47:53 main] ================================================================================
[DEBUG 2021-02-01T14:47:53 main] Lock packages:                                                        ESC[32mESC[1m[OK]ESC[0m
[DEBUG 2021-02-01T14:47:53 main] --------------------------------------------------------------------------------
[DEBUG 2021-02-01T14:47:53 main] 
[DEBUG 2021-02-01T14:47:53 main] foreman-maintain packages lock --assumeyes finished successfully!
[DEBUG 2021-02-01T14:47:53 main] Hook /usr/share/foreman-installer/katello/hooks/post/99-version_locking.rb returned true
[ INFO 2021-02-01T14:47:53 main] All hooks in group post finished
[DEBUG 2021-02-01T14:47:53 main] Exit with status code: 6 (signal was 6)
[ERROR 2021-02-01T14:47:53 main] Errors encountered during run:
[ERROR 2021-02-01T14:47:53 main] foreman-maintain packages is-locked --assumeyes failed! Check the output for error!
[ERROR 2021-02-01T14:47:53 main]  '/usr/bin/initdb --pgdata '/var/opt/rh/rh-postgresql12/lib/pgsql/data'' returned 1 instead of one of [0]
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:157:in `fail'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/exec.rb:183:in `sync'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:241:in `sync'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:136:in `sync_if_needed'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:90:in `block in perform_changes'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:89:in `each'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:89:in `perform_changes'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:21:in `evaluate'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:267:in `apply'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:287:in `eval_resource'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:191:in `call'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:191:in `block (2 levels) in evaluate'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:521:in `block in thinmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:520:in `thinmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:191:in `block in evaluate'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:122:in `traverse'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:178:in `evaluate'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:240:in `block (2 levels) in apply'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:521:in `block in thinmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:520:in `thinmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:239:in `block in apply'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:161:in `with_destination'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:146:in `as_logging_destination'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:238:in `apply'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:185:in `block (2 levels) in apply_catalog'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:521:in `block in thinmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:520:in `thinmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:184:in `block in apply_catalog'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:233:in `block in benchmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:232:in `benchmark'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:183:in `apply_catalog'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:387:in `run_internal'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:227:in `block in run'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:290:in `override'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:210:in `run'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:343:in `apply_catalog'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:260:in `block (2 levels) in main'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:290:in `override'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:243:in `block in main'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:290:in `override'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:207:in `main'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/apply.rb:177:in `run_command'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:382:in `block in run'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:710:in `exit_on_fail'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:382:in `run'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:143:in `run'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
[ERROR 2021-02-01T14:47:53 main]  /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: change from 'notrun' to ['0'] failed: '/usr/bin/initdb --pgdata '/var/opt/rh/rh-postgresql12/lib/pgsql/data'' returned 1 instead of one of [0]
[ERROR 2021-02-01T14:47:53 main]  /Stage[main]/Candlepin::Database::Postgresql/Postgresql::Server::Db[candlepin]/Postgresql::Server::Role[candlepin]/Postgresql_psql[CREATE ROLE candlepin ENCRYPTED PASSWORD ****]: Could not evaluate: Error evaluating 'unless' clause, returned pid 9514 exit 2: 'psql: error: could not connect to server: No such file or directory
[ERROR 2021-02-01T14:47:53 main]        Is the server running locally and accepting
[ERROR 2021-02-01T14:47:53 main]        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
[ERROR 2021-02-01T14:47:53 main] '
[ERROR 2021-02-01T14:47:53 main] /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:157:in `fail'
[ERROR 2021-02-01T14:47:53 main] /usr/share/foreman-installer/modules/postgresql/lib/puppet/type/postgresql_psql.rb:40:in `matches'

@mccun934 I can give you access to the boxes or we can look further into the backup that you originally saw the error. Since we haven't seen this issue before afaik, it would be interesting to find out what the difference is.

mccun934 commented 3 years ago

@johnpmitsch ping me the box info, happy to look

ekohl commented 3 years ago

I ran into problems where postgresql refused to start up because this file was missing. While the installer will create it again, it doesn't have the right SELinux labels which causes problems. This will be fixed in 6.10, but that doesn't help any customers today and cherry picking the fix to the installer is complex.

ekohl commented 3 years ago

This will be fixed in 6.10, but that doesn't help any customers today and cherry picking the fix to the installer is complex.

https://bugzilla.redhat.com/show_bug.cgi?id=1817176 was just changed to VERIFIED so I can really say it's fixed in 6.10 :)

evgeni commented 2 years ago

Given there has been no movement on this, and it's fixed in 6.10 by other means.

Should we just close it?