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

"No shared library is found to hook." with Oracle 18c #1754

Closed
yahonda opened this issue Aug 13, 2018 · 6 comments
Closed

"No shared library is found to hook." with Oracle 18c #1754

yahonda opened this issue Aug 13, 2018 · 6 comments

Comments

@yahonda
Copy link
Collaborator

yahonda commented Aug 13, 2018

Steps to reproduce

  1. Install Oracle client installed by using alien command:
- oracle-instantclient18.3-basic-18.3.0.0.0-1.x86_64.rpm
- oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.x86_64.rpm
- oracle-instantclient18.3-devel-18.3.0.0.0-1.x86_64.rpm
  1. Install Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production

  2. Execute Oracle enhanced adapter unit test as follows

$ git clone https://github.com/rsim/oracle-enhanced.git
$ cd oracle-enhanced
$ bundle
$ rspec ./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:12

Expected behavior

It should pass.

Actual behavior

$ bundle exec rspec ./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:12
==> Loading config from ENV or use default
==> Running specs with MRI version 2.5.1
==> Effective ActiveRecord version 6.0.0.alpha
Run options: include {:locations=>{"./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb"=>[12]}}
F

Failures:

  1) OracleEnhancedAdapter emulate OracleAdapter should be an OracleAdapter
     Failure/Error: OCI8.properties[:tcp_keepalive_time] = 600

     RuntimeError:
       No shared library is found to hook.
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/ruby-oci8-20b02fa15045/lib/oci8/properties.rb:74:in `__set_prop'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/ruby-oci8-20b02fa15045/lib/oci8/properties.rb:74:in `[]='
     # ./lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:309:in `new_connection'
     # ./lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:364:in `initialize'
     # ./lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:31:in `new'
     # ./lib/active_record/connection_adapters/oracle_enhanced/oci_connection.rb:31:in `initialize'
     # ./lib/active_record/connection_adapters/oracle_enhanced/connection.rb:11:in `new'
     # ./lib/active_record/connection_adapters/oracle_enhanced/connection.rb:11:in `create'
     # ./lib/active_record/connection_adapters/oracle_enhanced_adapter.rb:70:in `oracle_enhanced_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:809:in `new_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `checkout_new_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:832:in `try_to_checkout_new_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:793:in `acquire_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:521:in `checkout'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:380:in `connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:1008:in `retrieve_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_handling.rb:122:in `retrieve_connection'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/rails-ba1dab1e3b32/activerecord/lib/active_record/connection_handling.rb:94:in `connection'
     # ./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:14:in `block (2 levels) in <top (required)>'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:254:in `instance_exec'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:254:in `block in run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:500:in `block in with_around_and_singleton_context_hooks'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:457:in `block in with_around_example_hooks'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:466:in `block in run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:604:in `run_around_example_hooks_for'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:466:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:457:in `with_around_example_hooks'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:500:in `with_around_and_singleton_context_hooks'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:251:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:628:in `block in run_examples'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:624:in `map'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:624:in `run_examples'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:590:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block (3 levels) in run_specs'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `map'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block (2 levels) in run_specs'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1926:in `with_suite_hooks'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:113:in `block in run_specs'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:79:in `report'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:112:in `run_specs'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:87:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:45:in `invoke'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/exe/rspec:4:in `<top (required)>'
     # /home/yahonda/.rbenv/versions/2.5.1/bin/rspec:23:in `load'
     # /home/yahonda/.rbenv/versions/2.5.1/bin/rspec:23:in `<top (required)>'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `load'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/cli/exec.rb:28:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/cli.rb:424:in `exec'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/cli.rb:27:in `dispatch'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/cli.rb:18:in `start'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle:30:in `block in <top (required)>'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
     # /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.3/exe/bundle:22:in `<top (required)>'
     # /home/yahonda/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
     # /home/yahonda/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'

Finished in 0.00311 seconds (files took 0.79172 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:12 # OracleEnhancedAdapter emulate OracleAdapter should be an OracleAdapter

Coverage report generated for RSpec to /home/yahonda/git/oracle-enhanced/coverage. 579 / 1774 LOC (32.64%) covered.
$

System configuration

Rails version: master branch

Oracle enhanced adapter version: master branch

Ruby version:

$ ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]

Oracle Database version:

Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
@yahonda
Copy link
Collaborator Author

yahonda commented Aug 13, 2018

@kubo It would be appreciated if you have a chance to take a look at this "No shared library is found to hook." error to support Oracle 18c database and client.

@kubo
Copy link
Contributor

kubo commented Aug 14, 2018

It is easily fixed by adding "libclntsh." SO_EXT ".18.1" here. However it is ad-hoc. It doesn't work with Oracle 19, which will be released at 2019. I'll change it in order not to depend on version number suffix.
I'll try to release the next ruby-oci8 version at the next weekend.

@yahonda
Copy link
Collaborator Author

yahonda commented Aug 14, 2018

Thanks for the useful information. Agreed not to implement ad-hoc fixes.

@kubo
Copy link
Contributor

kubo commented Aug 19, 2018

The next ruby-oci8 release will delay a few days. My build environment for Windows binary gem packaging was broken and it has not been recovered yet.

kubo added a commit to kubo/ruby-oci8 that referenced this issue Aug 19, 2018
@kubo
Copy link
Contributor

kubo commented Aug 22, 2018

@yahonda
Ruby-oci8 2.2.6 was released. Could you try it?

@yahonda
Copy link
Collaborator Author

yahonda commented Aug 22, 2018

I have confirmed ruby-oci 2.2.6 addresses this error.

$ bundle exec rspec ./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:12
==> Loading config from ENV or use default
==> Running specs with MRI version 2.5.1
==> Effective ActiveRecord version 6.0.0.alpha
Run options: include {:locations=>{"./spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb"=>[12]}}
.

Finished in 0.13151 seconds (files took 1.03 seconds to load)
1 example, 0 failures

Coverage report generated for RSpec to /home/yahonda/git/oracle-enhanced/coverage. 614 / 1774 LOC (34.61%) covered.
$ bundle info ruby-oci8
  * ruby-oci8 (2.2.6 0875986)
	Summary: Ruby interface for Oracle using OCI8 API
	Homepage: http://www.rubydoc.info/github/kubo/ruby-oci8
	Path: /home/yahonda/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/bundler/gems/ruby-oci8-087598668922
$

Thanks for the fix and release.

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

2 participants