python-ibmdb: ibm-db broken for many users

We have a tool called detect-secrets that depends on ibm-db. Many of our users can’t properly install/import it right now, and are experiencing the error below (including myself). We’ve had to pull the ibm-db dependency from our installation and make it an optional feature, but we’d prefer to see this fixed permanently at the source. It’s not the first time we’ve seen a similar bug. Thank you!

OS (and OS of all users seeing the bug, so far): Mac OS

Traceback (most recent call last):
  File "/Users/justineyster/.pyenv/versions/3.8.6/bin/detect-secrets", line 33, in <module>
    sys.exit(load_entry_point('detect-secrets==0.13.1+ibm.29.dss', 'console_scripts', 'detect-secrets')())
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/main.py", line 40, in main
    plugins = initialize.from_parser_builder(
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/common/initialize.py", line 38, in from_parser_builder
    from_plugin_classname(
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/common/initialize.py", line 181, in from_plugin_classname
    klass = import_plugins(plugin_filenames)[plugin_classname]
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/common/util.py", line 46, in import_plugins
    module = import_module('detect_secrets.plugins.{}'.format(module_name))
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/db2.py", line 17, in <module>
    raise ie
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/db2.py", line 7, in <module>
    import ibm_db
ImportError: dlopen(/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/ibm_db.cpython-38-darwin.so, 2): Symbol not found: ___cxa_throw_bad_array_new_length
  Referenced from: /Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/clidriver/lib/libdb2.dylib
  Expected in: /usr/lib/libstdc++.6.dylib
 in /Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/clidriver/lib/libdb2.dylib
Justins-MBP:whitewater-detect-secrets justineyster$ detect-secrets scan --update .secrets.baseline --db2-scan
Traceback (most recent call last):
  File "/Users/justineyster/.pyenv/versions/3.8.6/bin/detect-secrets", line 33, in <module>
    sys.exit(load_entry_point('detect-secrets==0.13.1+ibm.29.dss', 'console_scripts', 'detect-secrets')())
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/main.py", line 40, in main
    plugins = initialize.from_parser_builder(
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/common/initialize.py", line 38, in from_parser_builder
    from_plugin_classname(
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/common/initialize.py", line 181, in from_plugin_classname
    klass = import_plugins(plugin_filenames)[plugin_classname]
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/common/util.py", line 46, in import_plugins
    module = import_module('detect_secrets.plugins.{}'.format(module_name))
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/db2.py", line 17, in <module>
    raise ie
  File "/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/detect_secrets/plugins/db2.py", line 7, in <module>
    import ibm_db
ImportError: dlopen(/Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/ibm_db.cpython-38-darwin.so, 2): Symbol not found: ___cxa_throw_bad_array_new_length
  Referenced from: /Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/clidriver/lib/libdb2.dylib
  Expected in: /usr/lib/libstdc++.6.dylib
 in /Users/justineyster/.pyenv/versions/3.8.6/lib/python3.8/site-packages/clidriver/lib/libdb2.dylib

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 24 (9 by maintainers)

Most upvoted comments

We had a recent upgrade of the clidriver and look the old issue is haunting us again. I will check on the at the earliest and come back with an update.

Thanks.

Looks like we have check the library being shipped and check on the packaging again.

I will work on this and have an update at the earliest.

Thanks.

Hi,

This issue is caused due to the version mismatch of the libstdc++.6.dylib library.

The clidriver downloaded along with the ibm_db driver has a dependency on this particular library. So we are shipping this library along the clidriver for mac in order to resolve the dependency. However for few users this library dependency in met from a different path /usr/lib.

Now this causes the dependency to break and hence the error.

So my suggestion is to try out the following options.

  1. rename the library in /usr/lib so that clidriver picks up the dependency from the shipped library along with clidriver.
  2. setting DYLD_LIBRARY_PATH environmental variable to clidriver/lib folder to allow the driver to pick up the library dependency form the mentioned PATH.

Please let me know if this could be worked out.

Thanks.

Hi,

After considering every options possible we have updated the clidriver from our end to include the new library where the loading path of libstdc++.so.6 has been updated.

@rredburn @drewmullen @justineyster @craigcurtin @jaykodeveloper can you please uninstall the ibm_db driver and install again to allow the new clidriver to be downloaded and test your applications.

This time you should not get the error as the library is now loaded with new dependency path and has been corrected.

Please let me know your observations on the same.

Thanks.

I had a similar issue when I was trying to install the ibm_db. I had to spend many days digging into it but no luck and finally reached to here. I hope this issue get solved as soon as possible!

Hi @amukherjee28, I have same issue when trying to install the ibm_db package. I’m on Python 3.8 Please advise how to work around this lib issue to install the ibm_db package for the short term, assuming there is a longer term fix. I’ve had some colleagues auggest “$ brew install db2” first … is this correct? How does one install python3-devl on mac-os ? Thanks, Craig

I helped a user fix this by exporting DYLD_LIBRARY_PATH as suggested, thanks.

in .zshrc/.bashrc/etc. (modify for your path):
export DYLD_LIBRARY_PATH=/usr/local/lib/python3.9/site-packages/clidriver/lib:$DYLD_LIBRARY_PATH

I tried using it with multiple versions of Python using pyenv and saw similar results.