python-cx_Oracle icon indicating copy to clipboard operation
python-cx_Oracle copied to clipboard

Error: DPI-1047 using Instant Client on macOS Catalina 10.15

Open nchillal opened this issue 7 years ago • 63 comments

I recently upgrade my mac to Mac OS Catalina Beta version. After that cx-Oracle is not working. Fails with error message below.

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

Version Python 3.7.4 cx-Oracle 7.2.0

This looks to me due to Apple dropping support of 32-bit apps. Can you confirm?

nchillal avatar Aug 01 '19 17:08 nchillal

@cjbj - this is a nightmare right now. Do you want me to raise a separate issue?

olly-writes-code avatar Oct 11 '19 21:10 olly-writes-code

I ran into the same issue with the 19.1 client, but downgrading to an older client (I tried 12.1) worked after trusting each lib in System Preferences.

NathanAtSafe avatar Oct 11 '19 21:10 NathanAtSafe

@kindjacket I'll just reopen this issue. You should reach out to your Oracle sales contacts to let them know too.

cjbj avatar Oct 12 '19 04:10 cjbj

yeah the app needs to notarized. Instructions here - https://developer.apple.com/documentation/xcode/notarizing_your_app_before_distribution/customizing_the_notarization_workflow?language=objc#3087734

olly-writes-code avatar Oct 14 '19 03:10 olly-writes-code

I've found a workaround (based on this answer here - https://github.com/Jackett/Jackett/issues/5589#issuecomment-508560798). It's not pretty.. You have to manually set the quarantine flag the dylib

First you need to run this - xattr -p com.apple.quarantine libclntsh.dylib

That should return something like this - 0081;5d1bec70;Safari;0622FF31-4499-4EBA-954A-EDC879E4010A

You then need to run the below code. With the return string from above but replacing 0081 with 00c1

xattr -w com.apple.quarantine "00c1;5d1bec70;Safari;0622FF31-4499-4EBA-954A-EDC879E4010A" *.dylib

The real fix, however, is Oracle notarizing the instant client.

olly-writes-code avatar Oct 14 '19 16:10 olly-writes-code

A workaround I found when prompted with "...cannot be opened opened because the developer cannot be verified" is to navigate to Security & Privacy -> General. There, you should see the file you were just told you cannot open listed and an "Open anyway" button. https://support.apple.com/el-gr/guide/mac-help/mh40616/mac

I had to repeat this about 4 times for 4 different files, but my oracle instant client is now working fine.

chkeno avatar Oct 15 '19 22:10 chkeno

@chkeno Good info.

I'm not sure when I will be able to upgrade to Catalina to test it all myself. There are other (3rd party) tools I need that also aren't yet supported on it.

cjbj avatar Oct 15 '19 22:10 cjbj

I had a similar with Catalina, trying to delete the oracle libs, but resolved the issue running the following line in terminal, sudo spctl --master-disable. Apparently Oracle is not classified as an approved developer and MacOS gets upset when you try to run a py script against the libs. Hope this helps.

cawoodjm avatar Oct 25 '19 21:10 cawoodjm

I've found a workaround (based on this answer here - Jackett/Jackett#5589 (comment)). It's not pretty.. You have to manually set the quarantine flag the dylib

First you need to run this - xattr -p com.apple.quarantine libclntsh.dylib

That should return something like this - 0081;5d1bec70;Safari;0622FF31-4499-4EBA-954A-EDC879E4010A

You then need to run the below code. With the return string from above but replacing 0081 with 00c1

xattr -w com.apple.quarantine "00c1;5d1bec70;Safari;0622FF31-4499-4EBA-954A-EDC879E4010A" *.dylib

The real fix, however, is Oracle notarizing the instant client.

I had also to do xattr -w com.apple.quarantine "00c1;5da44079;Opera;B38C0F6F-252F-4CC7-8A2D-236BAD20C035" *.dylib.*

And now everything works perfectly. Thx.

pdelporte avatar Dec 02 '19 12:12 pdelporte

Thanks for sharing.

anthony-tuininga avatar Dec 02 '19 16:12 anthony-tuininga

A workaround I found when prompted with "...cannot be opened opened because the developer cannot be verified" is to navigate to Security & Privacy -> General. There, you should see the file you were just told you cannot open listed and an "Open anyway" button. https://support.apple.com/el-gr/guide/mac-help/mh40616/mac

I had to repeat this about 4 times for 4 different files, but my oracle instant client is now working fine.

This was actually a quick easy fix for me. Tried several times (4 or 5 times) and then it is working fine now.

Behrad3d avatar Dec 03 '19 20:12 Behrad3d

I forced mac to "open the files" in iTerm, it asked for confirmation for opening the files. after saying yes to all the files it worked

dales avatar Dec 10 '19 19:12 dales

I managed to solve the problem using the link: https://support.apple.com/el-gr/guide/mac-help/mh40616/mac

hugoabe avatar Dec 13 '19 10:12 hugoabe

A workaround I found when prompted with "...cannot be opened opened because the developer cannot be verified" is to navigate to Security & Privacy -> General. There, you should see the file you were just told you cannot open listed and an "Open anyway" button. https://support.apple.com/el-gr/guide/mac-help/mh40616/mac I had to repeat this about 4 times for 4 different files, but my oracle instant client is now working fine.

This was actually a quick easy fix for me. Tried several times (4 or 5 times) and then it is working fine now.

This worked for me too. Had to retry severally but it finally worked

Sdcrow avatar Feb 20 '20 10:02 Sdcrow

xattr: libclntsh.dylib: No such xattr: com.apple.quarantine

taoruifu avatar Mar 01 '20 14:03 taoruifu

@taoruifu is that a statement or a question?

cjbj avatar Mar 01 '20 23:03 cjbj

I have been disable sip in my macos catalina. Its worked for me.

akurnosov avatar Mar 05 '20 09:03 akurnosov

I would do it this way:

To test: ls lib*.dylib | while read f ; do n=$(xattr -p com.apple.quarantine $f | perl -pe "s/00c1/0081/"); echo xattr -w com.apple.quarantine $n $f; done

To actually perform: ls lib*.dylib | while read f ; do n=$(xattr -p com.apple.quarantine $f | perl -pe "s/00c1/0081/"); echo "F: $f, N:$n"; xattr -w com.apple.quarantine $n $f; done

To verify: xattr -p com.apple.quarantine lib*.dylib

appersonj avatar Apr 02 '20 22:04 appersonj

None of these workarounds seem to work for me on 10.15.2. Are there plans from Oracle to get the clients notarized? As of right now, I can't connect to our Oracle databases, and I'm not wild about moving everything to docker.

jseabold avatar Apr 15 '20 21:04 jseabold

It's a known request, but no ETA.

cjbj avatar Apr 15 '20 22:04 cjbj