Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-5933

System cannot log SQL queries with Oracle DB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.9.1 ER1, 2.9.1 GA
    • 2.8 GA
    • System
    • None
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started
    • Not Started

      System component running with Oracle DB may crash when RAILS_LOG_LEVEL is set to debug.

      unexpected invocation: #<ActiveSupport::Logger:0x76a5688>.error('Could not log \'sql.active_record\' event. TypeError: wrong argument type NilClass (must respond to :each) [\'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/log_subscriber.rb:37:in `zip'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/log_subscriber.rb:37:in `sql'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/subscriber.rb:95:in `finish'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/log_subscriber.rb:83:in `finish'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/notifications/fanout.rb:102:in `finish'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/notifications/fanout.rb:46:in `block in finish'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/notifications/fanout.rb:46:in `each'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/notifications/fanout.rb:46:in `finish'\', \'/opt/app-root/src/project/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.2/lib/active_support/notifications/instrumenter.rb:42:in `finish_with_state'\', 
      [...]
      

      Dev note

      This has started in 3scale 2.8, when Rails was upgraded to v5.x. The signature of the method ActiveRecord::ConnectionAdapters::AbstractAdapter#log[1] changed, making it no longer compatible with an override[2] done by the version of the oracle-enhanced adapter we use.

      [1] https://github.com/rails/rails/blob/c4d3e202e10ae627b3b9c34498afb45450652421/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L582
      [2] https://github.com/rsim/oracle-enhanced/blob/6797d4e1611d557cb6b60f400fedaac10d0996d1/lib/active_record/connection_adapters/oracle_enhanced_adapter.rb#L1283

            Unassigned Unassigned
            mcassola Guilherme Cassolato
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: