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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...