Troubleshoot IBM Db2 data source issues
This document provides solutions to common issues you might encounter when configuring or using the IBM Db2 data source. For configuration instructions, refer to Configure the IBM Db2 data source.
Connection errors
These errors occur when Grafana cannot connect to the IBM Db2 database.
“Database instance not reachable”
Symptoms:
- Save & test fails with “Database instance not reachable”
- Queries fail with connection errors
Possible causes and solutions:
“DB2 instance not reachable”
Symptoms:
- Save & test fails with “DB2 instance not reachable”
- Error messages containing SQL30081N or SQLSTATE=08001
Solutions:
- Verify the Db2 server is running and accepting connections.
- Check that the database manager is started on the Db2 server.
- Confirm the port number is correct (default is 50000).
- Test connectivity:
nc -zv <host> 50000
“Missing resource bundle” (ERRORCODE=-4222)
Symptoms:
- Error message:
[jcc]Missing resource bundle: A resource bundle could not be found in the com.ibm.db2.jcc package ERRORCODE=-4222, SQLSTATE=08001
Solutions:
This error typically indicates a connectivity issue, not a missing driver.
- Verify the Db2 server is running.
- Test network connectivity to the Db2 host and port.
- Check that the database manager is initialized and accepting connections.
- If using Docker, verify the container is running:
docker ps | grep db2
“Connection timeout”
Symptoms:
- Save & test times out
- Error message mentions “timeout” or “timed out”
Possible causes and solutions:
“Cannot resolve database hostname”
Symptoms:
- Error message mentions “unknown host” or “name resolution”
Solutions:
- Verify the hostname is spelled correctly in the Host URL.
- Check DNS resolution from the Grafana server:
nslookup <hostname> - If using an IP address, ensure it’s correct and reachable.
- For internal hostnames, verify the Grafana server can resolve them.
Authentication errors
These errors occur when credentials are invalid or the user lacks required permissions.
“Authentication failed” or “Access denied”
Symptoms:
- Save & test fails with authentication errors
- Error messages mention “authentication”, “access denied”, or “login failed”
Possible causes and solutions:
Query errors
These errors occur when executing queries against the database.
Empty results or “No data”
Symptoms:
- Query executes without error but returns no data
- Panels show “No data” message
Possible causes and solutions:
Unsupported data type errors
Symptoms:
- Error message: “unsupported conversion from arrow to sdk type”
- Specific types mentioned: DECIMAL128, TIME32, DATE32
Solutions:
Some Db2 data types may not be fully supported. Workarounds:
DECIMAL columns: Cast to a supported numeric type:
SELECT CAST(decimal_column AS DOUBLE) AS value FROM tableTIME columns: Cast to VARCHAR or extract components:
SELECT VARCHAR(time_column) AS time_string FROM tableDATE columns: Cast to TIMESTAMP:
SELECT TIMESTAMP(date_column) AS time FROM table
Query syntax errors
Symptoms:
- Error message indicates SQL syntax error
- Query fails immediately after execution
Solutions:
- Verify your SQL syntax is valid for IBM Db2.
- Check that all table and column names exist.
- Ensure string values are enclosed in single quotes.
- For time series queries, verify the
timecolumn contains valid timestamp values.
SSL/TLS errors
SSL connection failures
Symptoms:
- Connection fails when SSL is enabled
- Error messages mention SSL, TLS, or certificate issues
Solutions:
- Verify your Db2 server is configured for SSL connections.
- Try disabling SSL in the data source configuration to test basic connectivity.
- Check that the Db2 server’s SSL certificate is valid and not expired.
Performance issues
Slow queries
Symptoms:
- Queries take a long time to execute
- Dashboard panels load slowly
Solutions:
- Add appropriate indexes to your Db2 tables.
- Limit the result set using
FETCH FIRST n ROWS ONLY. - Narrow the time range in your dashboard.
- Optimize your SQL query (avoid SELECT *).
- Check Db2 server resources and performance.
Get additional help
If you’ve tried the solutions above and still encounter issues:
- Check the Grafana community forums for similar issues.
- Review the plugin’s GitHub issues for known bugs.
- Consult the IBM Db2 documentation for database-specific guidance.
- Contact Grafana Support if you have a Grafana Cloud or Enterprise subscription.
When reporting issues, include:
- Grafana version
- Plugin version
- Error messages (redact sensitive information)
- Steps to reproduce the issue
- Relevant query examples (redact sensitive data)



