All Apps and Add-ons

DB Connect is failing with an an exception during verify/save

lweber
Path Finder

while adding a new connection in DB Connect I get a waning message saying:
'thread._local' object has no attribute 'user_name'
and the connection cannot be validated.

the dbx2.log has the following entries:
2016-08-17T11:30:26+0200 [ERROR] [rh_connections.py], line 162: exception 'thread._local' object has no attribute 'user_name'
Traceback (most recent call last):
File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/rh_connections.py", line 158, in handleStatus
status = self.get_connection_status(dbx2, fdb)
File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/health_logger.py", line 278, in wrapper
return get_mdc(MDC_LOGGER).do_log(func, *args, **kwargs)
File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/health_logger.py", line 153, in do_log
self.pre_logging_hook()
File "/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/health_logger.py", line 204, in pre_logging_hook
logger.warn('health_logger action=user_have_no_permission_collect_health_info user=%s', mdc.user_name)
AttributeError: 'thread._local' object has no attribute 'user_name'

1 Solution

lweber
Path Finder

posting the answer myself for others having the same issue.

As a workaround, i changed the file: /opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/health_logger.py

Line 204 from:
logger.warn('health_logger action=user_have_no_permission_collect_health_info user=%s', mdc.user_name)
to:
logger.warn('health_logger action=user_have_no_permission_collect_health_info user=%s', self.username)

after that I can verify/save new connections. please consider this change for a future release...

This has been confirmed to be a bug by Splunk support and will be fixed in version 2.3.1

View solution in original post

lweber
Path Finder

posting the answer myself for others having the same issue.

As a workaround, i changed the file: /opt/splunk/etc/apps/splunk_app_db_connect/bin/dbx2/health_logger.py

Line 204 from:
logger.warn('health_logger action=user_have_no_permission_collect_health_info user=%s', mdc.user_name)
to:
logger.warn('health_logger action=user_have_no_permission_collect_health_info user=%s', self.username)

after that I can verify/save new connections. please consider this change for a future release...

This has been confirmed to be a bug by Splunk support and will be fixed in version 2.3.1

koshyk
Super Champion

did and worked. thanks for saving our upgrade

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...