rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
545 stars 308 forks source link

Upgrade from 5.2.8 to 6.1.4 - Error when database config attribute "username" leverages proxy auth format #2297

Closed coreypmurphy-regions closed 1 year ago

coreypmurphy-regions commented 2 years ago

Steps to reproduce

Can't provide executable test case due to company policy.

  1. Create new rails application OR use existing one
  2. Configure database to allow proxy authentication for specific user and schema
  3. Configure database.yml file and set "username" attribute according to RubyOCI-8 proxy authentication format: 'proxy_user_name[end_user_name]'
  4. rake db:migrate OR any other database operation via application

Expected behavior

Normal database access/operations should occur

Actual behavior

Error encountered: ActiveRecord::ConnectionAdapters::OracleEnhanced::ConnectionException: "DESC schema_migrations" failed; does it exist?

Error is generated by "connection.rb" on line 65 as it attempts to execute a query against the first table (SCHEMA_MIGRATIONS) and the result returned is "nil" instead of a result set. Important to note that a connection IS successfully established with the database using the proxy auth user credentials prior to the error via "oci-connection.rb" line 342 so the issue isn't one of authentication.

System configuration

6.1.3.1

Oracle enhanced adapter version: 6.1.4

Ruby version: 2.7.2

Oracle Database version: 19

This worked without issue in Oracle enhanced adapter version 5.2.8.

coreypmurphy-regions commented 1 year ago

Solved by adding the "schema" attribute to my database.yml in conjunction with the "username" attribute leveraging the proxy auth format "username[schema_name]".