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

More graceful failure when oracle client library is not installed #158

Closed
ngoldbaum opened this issue Nov 5, 2018 · 6 comments
Closed

Comments

@ngoldbaum
Copy link

ngoldbaum commented Nov 5, 2018

Current if the oracle client library can't be located (for example, if someone installs easyaccess from pip but fails to install the oracle binaries), this happens:

$ easyaccess -s desdr

Error in DES_SERVICES config file, creating a new one...
File might not exists or is not configured correctly


Adding section db-desdr to des_service file

Enter username : ngoldbaum
Enter password :

DPI-1047: 64-bit Oracle Client library cannot be loaded: "dlopen(libclntsh.dylib, 1): image not found". See https://oracle.github.io/odpi/doc/installation.html#macos for help

While the error message does point to the installation instructions for the oracle client, this is such a common pitfall that the error message itself should try to explain what's going wrong in less technical language, something like "easyaccess was unable to load the oracle client library, please follow the installation instructions below:"

I would also encourage you to more prominently explain in the installation instructions in the readme that the oracle client library needs to be installed separately. I'm not sure offhand if that applies only to the pip installation (what I used) or to the conda installation as well.

See openjournals/joss-reviews#1022

@mgckind
Copy link
Owner

mgckind commented Nov 7, 2018

Thanks, It's true. That error comes directly from Oracle and can't be modified, we can add a test to check whether the library was properly installed (given that cx_Oracle is a requirement, it checks for the installation of the Oracle client first, but not whether is properly installed)

@ngoldbaum
Copy link
Author

Yeah, I'd suggest adding import guards around the cx_Oracle import, capture the exception, and then reraise with a better error message.

@mgckind
Copy link
Owner

mgckind commented Nov 12, 2018

The problem with that is that every Oracle Error is different, from syntax errors to connection errors, locks, etc. I have those guards and actually print the errors instead of raising an Exception. I can definitely add something regarding the first time running to make sure everything is ok.

@ngoldbaum
Copy link
Author

Makes sense, yes at least a mention in the readme would be good. It definitely confused me :)

@mgckind
Copy link
Owner

mgckind commented Nov 13, 2018

Will do

@mgckind
Copy link
Owner

mgckind commented Jan 14, 2019

I've updated the Readme with clear instructions and also added a FAQ

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