Project

General

Profile

Actions

Bug #22926

closed

foreman-rake foreman_tasks:cleanup fails due to PG::UndefinedFunction: ERROR: operator does not exist: character varying = uuid

Added by Lukas Pramuk about 6 years ago. Updated about 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Originally caught during "Upgrade Step: remove_registration_tasks..."
But even simple foreman_tasks:cleanup task trigger the issue.

foreman-1.18.0-0.develop.201803121639gitb9ec31b.el7.noarch
katello-3.7.0-1.nightly.el7.noarch
tfm-rubygem-foreman-tasks-0.12.1-1.fm1_18.el7.noarch

# foreman-rake foreman_tasks:cleanup
/opt/theforeman/tfm/root/usr/share/gems/gems/sequel-4.20.0/lib/sequel/database/schema_generator.rb:19: warning: constant ::Fixnum is deprecated
/opt/theforeman/tfm/root/usr/share/gems/gems/sequel-4.20.0/lib/sequel/database/schema_generator.rb:19: warning: constant ::Bignum is deprecated
/usr/share/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/usr/share/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
/usr/share/foreman/lib/core_extensions.rb:182: warning: already initialized constant ActiveSupport::MessageEncryptor::DEFAULT_CIPHER
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/message_encryptor.rb:22: warning: previous definition of DEFAULT_CIPHER was here
The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.

You should use PG::Connection, PG::Result, and PG::Error instead, respectively.

Called from /opt/theforeman/tfm/root/usr/share/gems/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
rake aborted!
ActiveRecord::StatementInvalid: PG::UndefinedFunction: ERROR:  operator does not exist: character varying = uuid
LINE 1: ...cations" LEFT JOIN foreman_tasks_tasks ON task_id = foreman_...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT COUNT(*) FROM "job_invocations" LEFT JOIN foreman_tasks_tasks ON task_id = foreman_tasks_tasks.id WHERE (task_id IS NOT NULL and foreman_tasks_tasks.id IS NULL)
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:614:in `async_exec'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:614:in `block (2 levels) in exec_no_cache'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:46:in `block in permit_concurrent_loads'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/concurrency/share_lock.rb:185:in `yield_shares'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/dependencies/interlock.rb:45:in `permit_concurrent_loads'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:613:in `block in exec_no_cache'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract_adapter.rb:612:in `block (2 levels) in log'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract_adapter.rb:611:in `block in log'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract_adapter.rb:603:in `log'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:612:in `exec_no_cache'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:599:in `execute_and_clear'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:79:in `exec_query'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:371:in `select'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/database_statements.rb:42:in `select_all'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/connection_adapters/abstract/query_cache.rb:97:in `select_all'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/relation/calculations.rb:253:in `execute_simple_calculation'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/relation/calculations.rb:209:in `perform_calculation'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/relation/calculations.rb:118:in `calculate'
/opt/rh/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.4/lib/active_record/relation/calculations.rb:41:in `count'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.4.5/app/models/concerns/foreman_remote_execution/foreman_tasks_cleaner_extensions.rb:17:in `delete'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.12.1/lib/foreman_tasks/cleaner.rb:21:in `block in run'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.12.1/lib/foreman_tasks/cleaner.rb:20:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.12.1/lib/foreman_tasks/cleaner.rb:20:in `run'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-0.12.1/lib/foreman_tasks/tasks/cleanup.rake:37:in `block (3 levels) in <top (required)>'

Related issues 2 (0 open2 closed)

Related to Foreman Remote Execution - Bug #22807: db:migrate still fails at 20160113162007_expand_all_template_invocations.rbClosedAdam Ruzicka03/07/2018Actions
Related to Katello - Refactor #22701: Use UUID column type instead of VARCHAR(36) for columns storing task uuids where possibleClosedAdam Ruzicka02/16/2018Actions
Actions #1

Updated by Lukas Pramuk about 6 years ago

  • Related to Bug #22807: db:migrate still fails at 20160113162007_expand_all_template_invocations.rb added
Actions #2

Updated by Lukas Pramuk about 6 years ago

  • Related to Refactor #22701: Use UUID column type instead of VARCHAR(36) for columns storing task uuids where possible added
Actions #3

Updated by Lukas Pramuk about 6 years ago

We can close this. I was missing other REX migrations and new 1.4.6 gem resolved the issue

# gem install foreman_remote_execution
Fetching: foreman_remote_execution-1.4.6.gem (100%)
Successfully installed foreman_remote_execution-1.4.6

# foreman-rake db:migrate
...
== 20180226095631 ChangeTaskIdToUuid: migrating ===============================
-- change_table(:job_invocations, {})
   -> 0.0710s
-- change_table(:template_invocations, {})
   -> 0.0357s
== 20180226095631 ChangeTaskIdToUuid: migrated (0.1070s) ======================
...

# foreman-rake foreman_tasks:cleanup
Actions #4

Updated by Ivan Necas about 6 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF