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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...