Skip to content

NameError (uninitialized constant ActiveRecord::ConnectionAdapters::SQLServerAdapter::ODBC): #475

@monteirobrena

Description

@monteirobrena

I've this error in one of my server and I can't understand the reason because I have two equals server and in just one occurred this error.

This error occurred eventually, when I restart the puma the connection works fine, but after sometime this happen again.

Plus, I'm not using ODBC instead I use tiny_tds.

FreeTDS

$ tsql -C

Compile-time settings (established with the "configure" script)
                            Version: freetds v0.95rc3
             freetds.conf directory: /usr/local/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: no
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.3
                              iODBC: no
                           unixodbc: no
              SSPI "trusted" logins: no
                           Kerberos: no
                            OpenSSL: yes
                             GnuTLS: no

Gemfile

gem 'tiny_tds', '~> 0.7.0'
gem 'activerecord-sqlserver-adapter', '~> 4.2.11'

config/database.yml

production:
  adapter: sqlserver
  host: my-db.database.secure.windows.net
  database: my-db
  username: user@my-db
  password: 12345678
  port: 1433
  azure: true

Log

NameError (uninitialized constant ActiveRecord::ConnectionAdapters::SQLServerAdapter::ODBC):
  activerecord-sqlserver-adapter (4.2.11) lib/active_record/connection_adapters/sqlserver_adapter.rb:136:in `rescue in active?'
  activerecord-sqlserver-adapter (4.2.11) lib/active_record/connection_adapters/sqlserver_adapter.rb:133:in `active?'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract_adapter.rb:328:in `verify!'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:456:in `block in checkout_and_verify'
  activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:455:in `checkout_and_verify'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
  /home/deploy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
  /home/deploy/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
  activerecord (4.2.3) lib/active_record/connection_handling.rb:113:in `retrieve_connection'
  activerecord (4.2.3) lib/active_record/connection_handling.rb:87:in `connection'
  activerecord (4.2.3) lib/active_record/query_cache.rb:31:in `call'
  activerecord (4.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  rack-timeout (0.4.2) lib/rack/timeout/core.rb:122:in `block in call'
  rack-timeout (0.4.2) lib/rack/timeout/support/timeout.rb:19:in `timeout'
  rack-timeout (0.4.2) lib/rack/timeout/core.rb:121:in `call'
  activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.3) lib/rails/engine.rb:518:in `call'
  railties (4.2.3) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/deflater.rb:35:in `call'
  puma (3.4.0) lib/puma/configuration.rb:224:in `call'
  puma (3.4.0) lib/puma/server.rb:569:in `handle_request'
  puma (3.4.0) lib/puma/server.rb:406:in `process_client'
  puma (3.4.0) lib/puma/server.rb:271:in `block in run'
  puma (3.4.0) lib/puma/thread_pool.rb:114:in `block in spawn_thread'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions