Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6.1 gives errors when active record is enabled #56

Closed
johan-smits opened this issue Dec 16, 2020 · 5 comments
Closed

Rails 6.1 gives errors when active record is enabled #56

johan-smits opened this issue Dec 16, 2020 · 5 comments

Comments

@johan-smits
Copy link
Contributor

johan-smits commented Dec 16, 2020

This happens because spec is removed.

  Rails.application.config.xray = {
        name: "#{ENV['LC_LWS_ENV']}_#{Rails.application.class.name}",
        patch: %I[net_http aws_sdk],
        active_record: true,
        daemon_address: '127.0.0.1:2000',
        context_missing: 'LOG_ERROR'
    }
NoMethodError (undefined method `spec' for #<ActiveRecord::ConnectionAdapters::ConnectionPool:0x00007feeb1d0f708>
Did you mean?  inspect):

/var/app/current/vendor/bundle/ruby/2.7.0/gems/aws-xray-sdk-0.11.5/lib/aws-xray-sdk/facets/rails/active_record.rb:20:in `record'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/aws-xray-sdk-0.11.5/lib/aws-xray-sdk/facets/rails/active_record.rb:68:in `block in <top (required)>'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/notifications/fanout.rb:186:in `finish'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/notifications/fanout.rb:63:in `block in finish'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/notifications/fanout.rb:63:in `each'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/notifications/fanout.rb:63:in `finish'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/notifications/instrumenter.rb:45:in `finish_with_state'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/notifications/instrumenter.rb:30:in `instrument'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:688:in `log'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:691:in `exec_cache'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:657:in `execute_and_clear'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:53:in `exec_query'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:536:in `select_prepared'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:67:in `select_all'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `block in select_all'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:118:in `block in cache_sql'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.0/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:109:in `cache_sql'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/connection_adapters/abstract/query_cache.rb:101:in `select_all'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/querying.rb:47:in `find_by_sql'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/statement_cache.rb:150:in `execute'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/core.rb:359:in `find_by'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/dynamic_matchers.rb:66:in `find_by_token'
/var/app/current/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.0/lib/active_record/dynamic_matchers.rb:20:in `method_missing'
@sisisin
Copy link
Contributor

sisisin commented Jan 13, 2021

Hi, thank you for support Rails 6.1!

I'm using aws-xray-sdk-ruby with Rails 6.1 and ActiveRecord is enabled.
But, xray-sdk will give the following deprecation warning when run my application.

DEPRECATION WARNING: DatabaseConfig#config will be removed in 6.2.0 in favor of DatabaseConfigurations#configuration_hash which returns a hash with symbol keys (called from record at /Users/****/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/aws-xray-sdk-ruby-e6bbe200666b/lib/aws-xray-sdk/facets/rails/active_record.rb:24)

This warning caused by this PR's changes.
https://github.com/aws/aws-xray-sdk-ruby/pull/57/files#diff-d4f370d0fa2cb316a0ff51f25fa67093305353d0af7cbf061bcd6dc7c8a09baaR24

@seuros
Copy link

seuros commented May 6, 2021

is this issue still current for you ? I see that master has support for 6.1 !

@willarmiros
Copy link
Contributor

@johan-smits @sisisin same question, are you still experiencing this issue? It seems like this issue should be fixed in the latest release (0.12.0).

@sisisin
Copy link
Contributor

sisisin commented May 11, 2021

This issue resolved when #58 merged, so I think it should be closed

@johan-smits
Copy link
Contributor Author

@willarmiros here all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants