Bug 1748450

Summary: there are exceptions "rescue in type_cast" in logs in global and remote region appliances
Product: Red Hat CloudForms Management Engine Reporter: Ievgen Zapolskyi <izapolsk>
Component: ReplicationAssignee: Yuri Rudman <yrudman>
Status: CLOSED CURRENTRELEASE QA Contact: Sudhir Mallamprabhakara <smallamp>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.11.0CC: dmetzger, obarenbo, simaishi, yrudman
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.12.0Flags: mfeifer: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1767790 (view as bug list) Environment:
Last Closed: 2020-10-26 15:59:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1767790    
Attachments:
Description Flags
appliance logs none

Description Ievgen Zapolskyi 2019-09-03 15:51:55 UTC
Created attachment 1611213 [details]
appliance logs

Description of problem:
When I look thru logs in global/remote region appliances, I see the following 
often see the following backtrace. I haven't noticed any consequences related to this exception but I don't  it's ok to have it in logs.


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

How reproducible:
100%

Steps to Reproduce:
1. Set up two appliances one in global region and one in remote one
2. Add subscription from global region to remote region appliance
3. Add one or two providers to remote region appliance and leave appliances to work for some time

Actual results:
below exception in logs appears

Expected results:
no such exception or readable message in logs instead of such exception

Additional info:

[----] E, [2019-09-03T11:23:08.016901 #3314:2b2281efd124] ERROR -- : There was an exception - TypeError(can't cast Hash)
[----] E, [2019-09-03T11:23:08.017163 #3314:2b2281efd124] ERROR -- : /opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/quoting.rb:45:in `rescue in type_cast'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/quoting.rb:31:in `type_cast'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/quoting.rb:167:in `block in type_casted_binds'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/quoting.rb:167:in `map'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/quoting.rb:167:in `type_casted_binds'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:621:in `exec_no_cache'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql_adapter.rb:611:in `execute_and_clear'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:79:in `exec_query'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:371:in `select'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:42:in `select_all'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/query_cache.rb:95:in `block in select_all'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
/usr/share/ruby/monitor.rb:226:in `mon_synchronize'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/query_cache.rb:104:in `cache_sql'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/connection_adapters/abstract/query_cache.rb:95:in `select_all'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/querying.rb:39:in `find_by_sql'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/relation.rb:678:in `exec_queries'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/relation.rb:546:in `load'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/relation.rb:255:in `records'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/relation/finder_methods.rb:508:in `find_take'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/relation/finder_methods.rb:100:in `take'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/relation/finder_methods.rb:78:in `find_by'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/querying.rb:7:in `find_by'
/opt/rh/cfme-gemset/gems/activerecord-5.1.7/lib/active_record/core.rb:203:in `find_by'
/var/www/miq/vmdb/app/channels/application_cable/connection.rb:14:in `find_verified_user'
/var/www/miq/vmdb/app/channels/application_cable/connection.rb:6:in `connect'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/connection/base.rb:167:in `handle_open'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker.rb:58:in `block in invoke'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker.rb:39:in `block in work'
/opt/rh/cfme-gemset/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker/active_record_connection_management.rb:14:in `block in with_database_connections'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/connection/tagged_logger_proxy.rb:24:in `tag'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker/active_record_connection_management.rb:14:in `with_database_connections'
/opt/rh/cfme-gemset/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/engine.rb:60:in `block (4 levels) in <class:Engine>'
/opt/rh/cfme-gemset/gems/activesupport-5.1.7/lib/active_support/execution_wrapper.rb:85:in `wrap'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/engine.rb:55:in `block (3 levels) in <class:Engine>'
/opt/rh/cfme-gemset/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:117:in `instance_exec'
/opt/rh/cfme-gemset/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/opt/rh/cfme-gemset/gems/activesupport-5.1.7/lib/active_support/callbacks.rb:135:in `run_callbacks'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker.rb:38:in `work'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker.rb:56:in `invoke'
/opt/rh/cfme-gemset/gems/actioncable-5.1.7/lib/action_cable/server/worker.rb:51:in `block in async_invoke'
/opt/rh/cfme-gemset/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
/opt/rh/cfme-gemset/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
/opt/rh/cfme-gemset/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
/opt/rh/cfme-gemset/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
/opt/rh/cfme-gemset/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
/opt/rh/cfme-gemset/gems/concurrent-ruby-1.1.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'

Comment 3 CFME Bot 2019-09-12 16:00:35 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/f8889cff696b50fa271e668d86dbfc338349f83a
commit f8889cff696b50fa271e668d86dbfc338349f83a
Author:     Yuri Rudman <yrudman>
AuthorDate: Tue Sep  3 14:43:47 2019 -0400
Commit:     Yuri Rudman <yrudman>
CommitDate: Tue Sep  3 14:43:47 2019 -0400

    in some situation empty Hash returned from TokenManager#token_get_info() and User.find_by(:user=>{}) would raise TypeCast error in that case.
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1748450

 app/channels/application_cable/connection.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 4 Yuri Rudman 2019-10-07 11:24:40 UTC
*** Bug 1758562 has been marked as a duplicate of this bug. ***