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

Dependent module libdb2.a(shr_64.o) could not be loaded #624

Closed
brittomoses opened this issue Apr 20, 2021 · 16 comments
Closed

Dependent module libdb2.a(shr_64.o) could not be loaded #624

brittomoses opened this issue Apr 20, 2021 · 16 comments

Comments

@brittomoses
Copy link

brittomoses commented Apr 20, 2021

Running from IBM i, On importing IBM_DB getting this error,
screenshot

@amukherjee28
Copy link
Member

Hi @brittomoses

Can you please confirm if you are running this on AIX system or on IBM i.

Thanks.

@imavo
Copy link
Contributor

imavo commented Apr 21, 2021

Looks like AIX. The LIBPATH environment variable needs to include the directory that contains libdb2.a.

We cannot tell from the question whether the clidriver is being used or a pre-existing Db2-client is being used.

If it is a pre-existing Db2-client, with a db2profile, normally the shell session (or shell startup script) would dot in the correct db2profile which would set all required environment variables, before running any program (like python) that tries to use Db2.

If using clidriver, you have to do it yourself (i.e. by editing the shell startup file to adjust LIBPATH appropriately).

@brittomoses
Copy link
Author

@amukherjee28 @imavo It is from IBM i not AIX

@imavo It is not a pre-existing Db2 Client, How do I check if clidriver is used?

@imavo
Copy link
Contributor

imavo commented Apr 21, 2021

Did you already have a Db2-client installed before installing python ibm_db ?

Did you set the IBM_DB_HOME environment to the pre-existing db2-client directory, before installing ibm_db?

Are there any db2 directories on your PATH ?

If the answer to all three questions is NO, then it may be using clidriver, and pip3 show ibm_db will show the site_packages directory location name, under which is 'clidriver/lib/' which should have all required libdb2* files.

You can put the fully-qualified-path of the clidriver/lib directory on the LIBPATH before running python.

@brittomoses
Copy link
Author

Added the clidriver to the LIBPATH, getting this error now
Traceback (most recent call last):
File "", line 1, in
ImportError: 0509-022 Cannot load module /QOpenSys/pkgs/lib/python3.6/site-packages/clidriver/lib/libdb2.a(shr_64.o).
0509-150 Dependent module libcfg.a(shr_64.o) could not be loaded.
0509-022 Cannot load module libcfg.a(shr_64.o).
0509-026 System error: A file or directory in the path name does not exist.
0509-022 Cannot load module /QOpenSys/pkgs/lib/python3.6/site-packages/ibm_db.so.
0509-150 Dependent module /QOpenSys/pkgs/lib/python3.6/site-packages/clidriver/lib/libdb2.a(shr_64.o) could not be loaded.

@amukherjee28
Copy link
Member

Mean while @kadler can you take a look at this once.

@kadler
Copy link
Contributor

kadler commented Apr 21, 2021

If you want to run ibm_db on IBM i, I suggest using our pre-build rpms: yum install python3-ibm_db or installing from our fork: https://github.com/kadler/python-ibmdb

@bimalkjha
Copy link
Member

@brittomoses It seems libcfg package is missing from your system. Probably you need to install aix-fileset-upgrade-aix-7_1-bos.rte.libcfg package: https://www.rapid7.com/db/vulnerabilities/aix-7_1-u847683/
If still facing issue, then please share complete output of ldd /QOpenSys/pkgs/lib/python3.6/site-packages/clidriver/lib/libdb2.a command. Probably you need to install xlc16 in your system by following this doc: https://www.ibm.com/support/pages/ibm-xl-cc-runtime-aix-161#DNLD
Thanks.

@brittomoses
Copy link
Author

@kadler I'm trying to use Django with that, with yum it installs the older package which gives out the error AttributeError: module 'ibm_db_dbi' has no attribute 'BOOLEAN'

@bimalkjha It is IBM i system not AIX, wont be able to install that PTF and not able to use ldd.

@amukherjee28
Copy link
Member

Hi @brittomoses

The BOOLEAN error on Django you are facing is from the latest django version 1.4.0.0 which requires boolean support from ibm_db to allow the migrations to happen. This fix has gone in the regular ibm_db latest release 3.0.4.

However on i-series when you are installing the ibm_db using the yum install command the boolean fix in that package might not be present and hence the error.

My suggestion to you would be to install ibm_db_django using the following set of commands

pip install django==2.0
pip install ibm_db_django==1.2.0.0

This combination should allow you to move forward with django migrations.

@kadler
Copy link
Contributor

kadler commented Apr 22, 2021

@bimalkjha there is no libcfg.a on IBM i.

@brittomoses we have started work on an IBM i-specific Django adapter at https://github.com/IBM/django-ibmi using the IBM i Access ODBC driver. That is probably your best bet in the long term.

@brittomoses
Copy link
Author

@amukherjee28 Installed the old versions, that did not give the Boolean error but gives me django.db.utils.InterfaceError: IBM i does not support DSN keywords 'HOSTNAME' error. I think i'll have to use just ibm_db and connect to database instead of connecting through django.

@kadler Sound good, do you know when this would be available?

@amukherjee28
Copy link
Member

Hi @brittomoses yes the current django adaptor is not supported for IBM i. You have to go with ibm_db connections for now and wait the django adaptor to come up on IBM i.

@kadler thank you for your help and providing us with the necessary information.

@brittomoses
Copy link
Author

Thanks everyone for the help

@amukherjee28
Copy link
Member

Can we close this issue then?

@brittomoses
Copy link
Author

@amukherjee28 yes, you can close this. Thanks.

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

5 participants