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!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...