Bug 1376968

Summary: Restoring Red Hat Satellite from Backup fails
Product: Red Hat Satellite Reporter: Pradeep Kumar Surisetty <psuriset>
Component: Backup & RestoreAssignee: Christine Fouant <cfouant>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: high    
Version: 6.3.0CC: bbuckingham, chrobert, cwelton, greartes, jcallaha, jomitsch, ktordeur, psuriset
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1488590    
Bug Blocks:    

Description Pradeep Kumar Surisetty 2016-09-17 02:30:10 UTC
Description of problem:

 Restoring Red Hat Satellite from Backup fails on satellite 6.3 

katello-restore /home/backup/
/usr/bin/katello-restore:18:in `chop!': can't modify frozen String (RuntimeError)
	from /usr/bin/katello-restore:18:in `<main>'



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Back up Your Red Hat Satellite Server
2. Restore it from backup using katello-restore
3.

Actual results:

restore fails 
Expected results:
restore should pass

Additional info:

Comment 2 Christine Fouant 2016-10-04 19:39:46 UTC
(In reply to Pradeep Kumar Surisetty from comment #0)
> Description of problem:
> 
>  Restoring Red Hat Satellite from Backup fails on satellite 6.3 
> 
> katello-restore /home/backup/
> /usr/bin/katello-restore:18:in `chop!': can't modify frozen String
> (RuntimeError)
> 	from /usr/bin/katello-restore:18:in `<main>'
> 
I cannot reproduce this error. Was this error from katello-backup rather than katello-restore? There has never been a call to 'chop!' in katello-restore.

Comment 3 Christine Fouant 2016-10-04 19:40:57 UTC
My apologies Pradeep, I was able to reproduce. Thanks!

Comment 4 Christine Fouant 2016-10-04 19:53:32 UTC
Created redmine issue http://projects.theforeman.org/issues/16795 from this bug

Comment 5 Bryan Kearney 2016-10-05 16:16:31 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16795 has been resolved.

Comment 6 Chris Roberts 2017-09-06 16:21:11 UTC
[root@rhel7 ~]# katello-restore /tmp/backup/katello-backup-20170906161439/
WARNING: This script will drop and restore your database.
Your existing installation will be replaced with the backup database.
Once this operation is complete there is no going back.
Are you sure(Y/N)? y 
Starting restore from /tmp/backup/katello-backup-20170906161439/: 2017-09-06 16:19:12 +0000
Setting file security
Done.
Resetting Katello
yes | foreman-installer -v --reset --scenario katello
Failed 'yes | foreman-installer -v --reset --scenario katello'

Comment 7 John Mitsch 2017-09-06 17:34:46 UTC
This is blocked being verified by https://bugzilla.redhat.com/show_bug.cgi?id=1488590

Once that is resolved, we can verify this.

Comment 8 Lukas Pramuk 2017-11-02 17:39:52 UTC
VERIFIED.

@satellite-6.3.0-21.0.beta.el7sat.noarch
satellite-common-6.3.0-21.0.beta.el7sat.noarch


# satellite-restore /tmp/satellite-backup/satellite-backup-20171102104207
WARNING: This script will drop and restore your database.
Your existing installation will be replaced with the backup database.
Once this operation is complete there is no going back.
Are you sure(Y/N)? y
Starting restore from /tmp/satellite-backup/satellite-backup-20171102104207: 2017-11-02 10:56:08 -0400
Setting file security
Done.
Resetting Katello
yes | foreman-installer -v --reset --scenario satellite --disable-system-checks
...

  Success!
  * Satellite is running at https://<SATFQDN>

  * To install an additional Capsule on separate machine continue by running:

      capsule-certs-generate --foreman-proxy-fqdn "$CAPSULE" --certs-tar "/root/$CAPSULE-certs.tar"

  * To upgrade an existing 6.2 Capsule to 6.3:
      Please see official documentation for steps and parameters to use when upgrading a 6.2 Capsule to 6.3.

  The full log is at /var/log/foreman-installer/satellite.log
[ INFO 2017-11-02 11:04:15 verbose] pulp.conf is already present, skipping
[ INFO 2017-11-02 11:04:15 verbose] All hooks in group post finished
[ INFO 2017-11-02 11:04:15 verbose] Installer finished in 420.040311157 seconds
Done.
Stopping Katello services
Redirecting to /bin/systemctl stop foreman-tasks.service
Redirecting to /bin/systemctl stop httpd.service
Redirecting to /bin/systemctl stop pulp_celerybeat.service
Redirecting to /bin/systemctl stop foreman-proxy.service
Redirecting to /bin/systemctl stop pulp_streamer.service
Redirecting to /bin/systemctl stop pulp_resource_manager.service
Redirecting to /bin/systemctl stop smart_proxy_dynflow_core.service
Redirecting to /bin/systemctl stop pulp_workers.service
Redirecting to /bin/systemctl stop tomcat.service
Redirecting to /bin/systemctl stop squid.service
Redirecting to /bin/systemctl stop qdrouterd.service
Redirecting to /bin/systemctl stop qpidd.service
Redirecting to /bin/systemctl stop postgresql.service
Redirecting to /bin/systemctl stop mongod.service
Done.
Restoring Pulp data
Migrating pulp databases
Redirecting to /bin/systemctl start mongod.service
Redirecting to /bin/systemctl start qpidd.service
Redirecting to /bin/systemctl stop pulp_resource_manager.service
Redirecting to /bin/systemctl stop pulp_workers.service
Attempting to connect to localhost:27017
Attempting to connect to localhost:27017
Write concern for Mongo connection: {}
Loading content types.
Loading type descriptors []
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
Loading unit model: puppet_module = pulp_puppet.plugins.db.models:Module
Loading unit model: docker_blob = pulp_docker.plugins.models:Blob
Loading unit model: docker_manifest = pulp_docker.plugins.models:Manifest
Loading unit model: docker_image = pulp_docker.plugins.models:Image
Loading unit model: docker_tag = pulp_docker.plugins.models:Tag
Loading unit model: erratum = pulp_rpm.plugins.db.models:Errata
Loading unit model: distribution = pulp_rpm.plugins.db.models:Distribution
Loading unit model: srpm = pulp_rpm.plugins.db.models:SRPM
Loading unit model: package_group = pulp_rpm.plugins.db.models:PackageGroup
Loading unit model: package_category = pulp_rpm.plugins.db.models:PackageCategory
Loading unit model: iso = pulp_rpm.plugins.db.models:ISO
Loading unit model: package_environment = pulp_rpm.plugins.db.models:PackageEnvironment
Loading unit model: drpm = pulp_rpm.plugins.db.models:DRPM
Loading unit model: package_langpacks = pulp_rpm.plugins.db.models:PackageLangpacks
Loading unit model: rpm = pulp_rpm.plugins.db.models:RPM
Loading unit model: yum_repo_metadata_file = pulp_rpm.plugins.db.models:YumMetadataFile
Loading unit model: ostree = pulp_ostree.plugins.db.model:Branch
Loading auxiliary model: erratum_pkglists = pulp_rpm.plugins.db.models:ErratumPkglist
Updating the database with types []
Found the following type definitions that were not present in the update collection [puppet_module, docker_tag, ostree, docker_manifest, docker_blob, erratum, distribution, yum_repo_metadata_file, package_group, package_category, iso, package_environment, drpm, package_langpacks, rpm, srpm, docker_image]
Updating the database with types [puppet_module, drpm, ostree, package_langpacks, erratum, docker_blob, docker_manifest, yum_repo_metadata_file, package_group, package_category, iso, package_environment, docker_tag, distribution, rpm, srpm, docker_image]
Content types loaded.
Ensuring the admin role and user are in place.
Admin role and user are in place.
Beginning database migrations.
Migration package pulp.server.db.migrations is up to date at version 303
Migration package pulp_docker.plugins.migrations is up to date at version 300
Migration package pulp_puppet.plugins.migrations is up to date at version 5
Migration package pulp_rpm.plugins.migrations is up to date at version 304
Loading unit model: puppet_module = pulp_puppet.plugins.db.models:Module
Loading unit model: docker_blob = pulp_docker.plugins.models:Blob
Loading unit model: docker_manifest = pulp_docker.plugins.models:Manifest
Loading unit model: docker_image = pulp_docker.plugins.models:Image
Loading unit model: docker_tag = pulp_docker.plugins.models:Tag
Loading unit model: erratum = pulp_rpm.plugins.db.models:Errata
Loading unit model: distribution = pulp_rpm.plugins.db.models:Distribution
Loading unit model: srpm = pulp_rpm.plugins.db.models:SRPM
Loading unit model: package_group = pulp_rpm.plugins.db.models:PackageGroup
Loading unit model: package_category = pulp_rpm.plugins.db.models:PackageCategory
Loading unit model: iso = pulp_rpm.plugins.db.models:ISO
Loading unit model: package_environment = pulp_rpm.plugins.db.models:PackageEnvironment
Loading unit model: drpm = pulp_rpm.plugins.db.models:DRPM
Loading unit model: package_langpacks = pulp_rpm.plugins.db.models:PackageLangpacks
Loading unit model: rpm = pulp_rpm.plugins.db.models:RPM
Loading unit model: yum_repo_metadata_file = pulp_rpm.plugins.db.models:YumMetadataFile
Loading unit model: ostree = pulp_ostree.plugins.db.model:Branch
Loading auxiliary model: erratum_pkglists = pulp_rpm.plugins.db.models:ErratumPkglist
Database migrations complete.
Done.
Done.
Ensuring all Katello processes are started
Redirecting to /bin/systemctl start mongod.service
Redirecting to /bin/systemctl start postgresql.service
Redirecting to /bin/systemctl start qpidd.service
Redirecting to /bin/systemctl start qdrouterd.service
Redirecting to /bin/systemctl start squid.service
Redirecting to /bin/systemctl start tomcat.service
Redirecting to /bin/systemctl start pulp_workers.service
Redirecting to /bin/systemctl start smart_proxy_dynflow_core.service
Redirecting to /bin/systemctl start pulp_resource_manager.service
Redirecting to /bin/systemctl start pulp_streamer.service
Redirecting to /bin/systemctl start foreman-proxy.service
Redirecting to /bin/systemctl start pulp_celerybeat.service
Redirecting to /bin/systemctl start httpd.service
Redirecting to /bin/systemctl start foreman-tasks.service
Done.
Done with restore: 2017-11-02 11:05:49 -0400

>>> satellite has been restored successfully

Comment 9 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336