kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

ORA-28041: authentication protocol internal error #262

Closed Ethelom closed 3 months ago

Ethelom commented 3 months ago

Setup

Error

Although bundle install is successful, when trying to connect the following error occurs:

OCIError: ORA-28041: authentication protocol internal error
Help: https://docs.oracle.com/error-help/db/ora-28041/
from oci8.c:603:in oci8lib_250.bundle

Steps to reproduce

username = 'YOUR_USERNAME'
password = 'YOUR_PASSWORD'
dsn = 'HOST:PORT/SID'

OCI8.new(username, password, dsn)

# The above error occurs

FYI, the same error occurs whether the username + password combination is correct or not.

Notes

kosdiamantis commented 3 months ago

Hello and thanks @kubo (and the rest of the contributors) for your work!

It seems that Oracle has patched the latest instant client and now it works 🎉 🎉 🎉

I have installed instantclient-basic-macos.arm64-23.3.0.23.09-1 instead of instantclient-basic-macos.arm64-23.3.0.23.09 and everything works as expected 🚀 .

Steps to install oracle instantclient and ruby-oci8 (just in case someone find it usefull)

$ mkdir ~/oracle
$ cd ~/oracle

$ curl -O https://download.oracle.com/otn_software/mac/instantclient/233023/instantclient-basic-macos.arm64-23.3.0.23.09-1.dmg
$ curl -O https://download.oracle.com/otn_software/mac/instantclient/233023/instantclient-sdk-macos.arm64-23.3.0.23.09.dmg
$ curl -O https://download.oracle.com/otn_software/mac/instantclient/233023/instantclient-sqlplus-macos.arm64-23.3.0.23.09.dmg

$ hdiutil mount instantclient-basic-macos.arm64-23.3.0.23.09-1.dmg
$ hdiutil mount instantclient-sdk-macos.arm64-23.3.0.23.09.dmg
$ hdiutil mount instantclient-sqlplus-macos.arm64-23.3.0.23.09.dmg

$ sh /Volumes/instantclient-basic-macos.arm64-23.3.0.23.09/install_ic.sh

$ mv ~/Downloads/instantclient_23_3 ~/oracle/
$ echo 'export OCI_DIR="$HOME/oracle/instantclient_23_3"' >> ~/.zshrc
$ source ~/.zshrc

# cleanup
$ /usr/bin/hdiutil unmount /Volumes/instantclient-basic-macos.arm64-23.3.0.23.09
$ /usr/bin/hdiutil unmount /Volumes/instantclient-sdk-macos.arm64-23.3.0.23.09
$ /usr/bin/hdiutil unmount /Volumes/instantclient-sqlplus-macos.arm64-23.3.0.23.09
$ rm ~/oracle/instantclient*.dmg

$ gem install 'ruby-oci8'

@Ethelom can you approve that it also works for you?

mohits commented 3 months ago

Although you're not on MacOS, I'm adding a link to instructions to get OCI running on Windows also: https://notepad.onghu.com/2021/ruby-oracle-oci-windows-sequel/

Ethelom commented 3 months ago

@kosdiamantis It works fine on my Silicon M2 Mac, thanks!