All Apps and Add-ons

Splunk Db connect app running on Windows with python3 is not working

hanika001
New Member

Hi Splunkers,
We have the following environment:
• Splunk - 8.0.0
• OS – Windows server 2016
• Splunk db_connect_app – 3.2.0/3.3.1
• Python – python3
• Jre – 1.8
NOTE: Machine has timezone variable set (TZ)
With the above configurations splunk db_connect_app throws exception on the UI as “Not able to communicate with task server” and this is due to the fact that dbx_logging _formatter.py throws an exception while calling this line “os.unsetenv(‘TZ’)” and the exception is as follows:
“module ‘os’ has no attribute ‘unsetenv’”
After looking at python3 sdk, we found unsetenv method is not present in the os module. This particular piece of code has to be replaced by os.putenv(‘TZ’, None), when running with python3
Please let us know, if this is an issue or there is some work around. But we can not unset ‘TZ’ as a work around and we can not degrade python3 to python2

TIA
Hanika

Labels (2)
0 Karma

MaverickT
Communicator

I've managed to fix it, by changing TZ to our local timezone in dbx_logging _formatter.py.

From this:

 

if os.getenv('TZ'):
    os.unsetenv('TZ')

 

To this:

 

if os.getenv('TZ'):
    os.putenv('TZ', 'Europe/Ljubljana')

 

 

It should work until app is upgraded... 🙂 Thanks for this question, it directed me towards solution.

0 Karma

MaverickT
Communicator

We are also struggling with this issue. Did you already found a solution?

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...