Bug 1789911 - "foreman-rake katello:publish_unpublished_repositories" is referring to column which no longer exists in katello_repositories table.
Summary: "foreman-rake katello:publish_unpublished_repositories" is referring to colum...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.8.0
Assignee: James Jeffers
QA Contact: Bruno Rocha
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-10 17:16 UTC by Stefan Nemeth
Modified: 2023-09-07 21:25 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1851140 (view as bug list)
Environment:
Last Closed: 2020-10-27 12:59:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Hotfix RPM for Satellite 6.7.1 (10.86 MB, application/x-rpm)
2020-06-25 01:41 UTC, wclark
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28811 0 Normal Closed publish_unpublished_repositories tasks references column that was moved to another table 2021-02-10 18:59:25 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:00:13 UTC

Description Stefan Nemeth 2020-01-10 17:16:06 UTC
Description of problem:

#foreman-rake katello:publish_unpublished_repositories is referring to column which no longer exists in 6.5+. 

Foreman db table katello_repositories was split in 6.5 into smaller tables and some columns were moved. 

#foreman-rake katello:publish_unpublished_repositories 
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column katello_repositories.url does not exist
LINE 1: ..._repositories"."content_view_version_id" = $1 AND "katello_r...
                                                             ^
: SELECT  "katello_repositories".* FROM "katello_repositories" WHERE "katello_repositories"."content_view_version_id" = $1 AND "katello_repositories"."url" IS NOT NULL ORDER BY "katello_repositories"."id" ASC LIMIT $2
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:669:in `prepare'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:669:in `block in prepare_statement'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:664:in `prepare_statement'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:609:in `exec_cache'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `execute_and_clear'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:81:in `exec_query'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:469:in `select_prepared'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:55:in `select_all'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/querying.rb:41:in `find_by_sql'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:554:in `block in exec_queries'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:575:in `block in skip_query_cache_if_necessary'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/query_cache.rb:78:in `uncached'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/query_cache.rb:21:in `uncached'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:84:in `public_send'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:84:in `block in method_missing'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:281:in `scoping'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/delegation.rb:84:in `method_missing'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:574:in `skip_query_cache_if_necessary'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:541:in `exec_queries'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/association_relation.rb:34:in `exec_queries'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:414:in `load'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation.rb:200:in `records'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:224:in `block in in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:222:in `loop'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:222:in `in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:135:in `find_in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:69:in `find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.58/lib/katello/tasks/repository.rake:14:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:70:in `block (2 levels) in find_each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:70:in `each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:70:in `block in find_each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:136:in `block in find_in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:238:in `block in in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:222:in `loop'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:222:in `in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:135:in `find_in_batches'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/relation/batches.rb:69:in `find_each'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/querying.rb:11:in `find_each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.58/lib/katello/tasks/repository.rake:13:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'

Caused by:
PG::UndefinedColumn: ERROR:  column katello_repositories.url does not exist
LINE 1: ..._repositories"."content_view_version_id" = $1 AND "katello_r...
                                                             ^
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:669:in `prepare'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:669:in `block in prepare_statement'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:664:in `prepare_statement'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:609:in `exec_cache'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:592:in `execute_and_clear'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/postgresql/database_st

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


How reproducible:
100%

Steps to Reproduce:
1.install or upgrade to 6.5 or 6.6
2. execute #foreman-rake katello:publish_unpublished_repositories


Actual results:

rake fails

Expected results:

rake runs to publish repos which were synced never published since 

Additional info:

It is part of cronjob 

/etc/cron.d/katello

# Script for publishing unpublished repositories
00 23 * * *     root    foreman-rake katello:publish_unpublished_repositories RAILS_ENV=production >/dev/null 2>&1

Comment 5 wclark 2020-06-25 01:41:58 UTC
Created attachment 1698737 [details]
Hotfix RPM for Satellite 6.7.1

Comment 6 wclark 2020-06-25 01:43:55 UTC
HOTFIX is available for Satellite 6.7.1. Installation instructions:

1. Take a complete backup or snapshot of Satellite server before installing the hotfix

2. Download the hotfix RPM from this BZ and copy it to Satellite server

3. # yum install tfm-rubygem-katello-3.14.0.21-3.HOTFIXRHBZ1830403RHBZ1789911.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # systemctl restart httpd dynflowd

This HOTFIX additionally includes the fix for bz1830403

Comment 7 Bruno Rocha 2020-08-05 21:16:54 UTC
Verified

[root@dhcp-2-96 ~]# rpm -qa pulp-server satellite
pulp-server-2.21.2-1.el7sat.noarch
satellite-6.8.0-0.7.beta.el7sat.noarch
[root@dhcp-2-96 ~]# foreman-rake katello:publish_unpublished_repositories

Comment 10 errata-xmlrpc 2020-10-27 12:59:59 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 (Important: Satellite 6.8 release), 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-2020:4366


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