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

Query exporter not able to connect with IBM DB2 #147

Open
manvitha9347 opened this issue May 2, 2023 · 1 comment
Open

Query exporter not able to connect with IBM DB2 #147

manvitha9347 opened this issue May 2, 2023 · 1 comment
Labels

Comments

@manvitha9347
Copy link

manvitha9347 commented May 2, 2023

I am trying to connect the query exporter to ibm db2, and facing the following error in logs

2023-05-02 13:02:01,876 - ERROR - query-exporter - error from database "db1": (ibm_db_dbi.OperationalError) ibm_db_dbi::OperationalError: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "". Communication function detecting the error: "recv". Protocol specific error code(s): "104", "*", "0". SQLSTATE=08001 SQLCODE=-30081

config.yaml:
databases:
db1:
dsn: db2+ibm_db://uname:pass@ip:50000/DSODB
keep-connected: true
autocommit: false
labels:
app: app1

metrics:
  all_entries_last_hr:
    type: gauge
    description: all_entries_last_hr

queries:
query1:
interval: 100
databases: [db1]
metrics: [all_entries_last_hr]
sql: >
select count(*)
from
DSODB.JOBRUN JR,DSODB.JOBEXEC JE,DSODB.HOST H
where
JR.JOBID=JE.JOBID
AND H.HOSTID=JE.HOSTID
AND RUNSTARTTIMESTAMP BETWEEN current timestamp - 60 minutes and
current timestamp

I am using python 3.10 dev and venv for this, and I also tried the troubleshoot options specified in
#96
#14

  1. adding libxml2
  2. adding venv related environment variable
  3. kept sql alchemy version at 1.3.24
  4. kept aiohttp version at 3.7.4.post0
    but nothing worked

I also tried having dsn as
dsn: db2+ibm_db://uname:pass@ip:50000/DSODB
dsn: db2+ibm_db_sa://uname:pass@ip:50000/DSODB
dsn: db2://uname:pass@ip:50000/DSODB
but nothing worked

tried varying query params for ibm db2
added DB2COMM=tcpip
DB2TCP_CLIENT_CONTIMEOUT=0
DB2TCP_CLIENT_RCVTIMEOUT=0
but nothing worked

Connection Details:
Query exporter deployed in Kubernetes pod built with ubuntu image
Firewall has been enabled between source and destination

And do we need DB2Client to connect with IBM DB2?

Could you please help me understand what's going wrong here?
Thanks

@albertodonato
Copy link
Owner

Does this still happen with newer releases? If so, can you provide what version (including whether it's virtualenv, snap or docker) and the exact configuration being used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants