Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1446713 - Satellite 6.2 Upgrade: katello:upgrades:2.4:import_distributions error
Satellite 6.2 Upgrade: katello:upgrades:2.4:import_distributions error
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Repositories (Show other bugs)
6.2.0
x86_64 Linux
high Severity high (vote)
: 6.2.10
: Unused
Assigned To: satellite6-bugs
jcallaha
: PrioBumpGSS, Reopened, Triaged
Depends On: 1425437
Blocks: CEE_Sat6_Top_BZs/GSS_Sat6_Top_Bugs Sat6_Upgrades
  Show dependency treegraph
 
Reported: 2017-04-28 12:24 EDT by pm-sat@redhat.com
Modified: 2017-06-20 13:23 EDT (History)
18 users (show)

See Also:
Fixed In Version: katello-installer-base-3.0.0.81-1
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1365223
Environment:
Last Closed: 2017-06-20 13:23:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1553 normal SHIPPED_LIVE Satellite 6.2.10 Async Bug Release 2017-06-20 17:19:07 EDT

  None (edit)
Comment 3 Mike McCune 2017-05-17 13:43:18 EDT
This will require testing by manually removing pulp distributions from the Pulp db to ensure this gets auto-corrected during a 6.1 -> 6.2.10 upgrade
Comment 4 Justin Sherrill 2017-05-30 14:30:43 EDT
Steps to reproduce:

1. Install Satellite 6.1
2. Create a repository, locate the repository ID, via the Repository details URL
3. Open the rails console:  
 # foreman-rake console
4. Delete the repo in pulp:
 > User.current = User.anonymous_api_admin
 > Katello.pulp_server.extensions.repository.delete(Katello::Repository.find(REPO_ID).pulp_id)
Replacing REPO_ID with the numeric ID found in step 2.

5. Upgrade to Satellite 6.2 without error
Comment 5 jcallaha 2017-05-30 17:05:53 EDT
Verified in Satellite 6.2.10 Snap 2. I performed te steps outlined in #4 on both RHEL 6 and RHEL 7 systems upgraded from 6.2.11. Both upgrades completed without issues. 


[root@ibm-x3650m4-01-vm-05 ~]# foreman-rake console
Loading production environment (Rails 3.2.8)
irb(main):001:0> User.current = User.anonymous_api_admin
2017-05-30 16:16:00 [D]   User Load (0.3ms)  SELECT "users".* FROM "users" WHERE "users"."lower_login" = 'foreman_api_admin' LIMIT 1
=> #<User id: 2, login: "foreman_api_admin", firstname: "API", lastname: "Admin", mail: nil, admin: true, last_login_on: nil, auth_source_id: 2, created_at: "2017-05-30 19:27:21", updated_at: "2017-05-30 19:27:21", password_hash: nil, password_salt: nil, locale: nil, helptips_enabled: true, page_size: 25, disabled: false, preferences: #<struct ActiveRecord::AttributeMethods::Serialization::Attribute coder=#<ActiveRecord::Coders::YAMLColumn:0x00000008a9a8c8 @object_class=Hash>, value="--- {}\n", state=:serialized>, remote_id: "admin", avatar_hash: nil, default_organization_id: nil, default_location_id: nil, lower_login: "foreman_api_admin", mail_enabled: true>
irb(main):002:0> Katello.pulp_server.extensions.repository.delete(Katello::Repository.find(3).pulp_id)
2017-05-30 16:16:53 [D]   Katello::Repository Load (0.8ms)  SELECT "katello_repositories".* FROM "katello_repositories" WHERE "katello_repositories"."id" = $1 ORDER BY katello_repositories.name ASC LIMIT 1  [["id", 3]]
=> {"spawned_tasks"=>[{"_href"=>"/pulp/api/v2/tasks/1708d70f-70e4-44e6-99a7-c27263b47bae/", "task_id"=>"1708d70f-70e4-44e6-99a7-c27263b47bae"}], "result"=>nil, "error"=>nil}



Upgrade Steps:

...

Upgrade Step: correct_repositories (this may take a while) ...
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.43/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.135/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here
Processing Repository 1/4: Red Hat Satellite 6.2 for RHEL 7 Server RPMs x86_64 (1)
Processing Repository 2/4: Red Hat Satellite 6.2 for RHEL 6 Server RPMs x86_64 (2)
Processing Repository 3/4: Red Hat Satellite 6.1 for RHEL 7 Server RPMs x86_64 (3)
Repository 3 Missing
Recreating 3
Processing Repository 4/4: Red Hat Satellite 6.1 for RHEL 6 Server RPMs x86_64 (4)

...

Upgrade Step: import_distributions (this may take a while) ...
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.43/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.135/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here
Importing distribution data into repositories

...
Comment 7 errata-xmlrpc 2017-06-20 13:23:53 EDT
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/RHBA-2017:1553

Note You need to log in before you can comment on or make changes to this bug.