UnicodeDecodeError: don't know how to handle UnicodeDecodeError in error callback
I am trying to create a saved search (type alert) on Splunk using python-sdk.
The problem I am facing is the alert gets created with the proper fields but it still throws an error
UnicodeDecodeError: don't know how to handle UnicodeDecodeError in error callback.
To Reproduce Steps to reproduce the behavior:
- Install python-sdk and write a python code for creating saved search following README.md of python-sdk
- Create a saved search having below values
alert_content = {
"name": "Test Alert",
"search": "QUERY",
"alert_type": "number of events",
"is_scheduled": "true",
"cron_schedule": "0 9 * * 1",
"alert_comparator": "greater than",
"alert_threshold": 0,
"app": "search",
"actions": "email",
"action.email": 1,
"action.email.to": "[email protected]",
}
- It would look something like this
self.service.saved_searches.create(**alert_content)
- It creates the alert with proper fields and values but it also throws a below-given error.
UnicodeDecodeError: don't know how to handle UnicodeDecodeError in error callback
Expected behavior Alert should be created without throwing an error.
Splunk (please complete the following information):
- Version: [e.g. 9.1.0.2]
- OS: [e.g. centos 7.9.2009]
- Deployment: [e.g. cluster]
SDK (please complete the following information):
- Version: [e.g. 1.7.3]
- Language Runtime Version: [e.g. Python 3.11]
- OS: [e.g. MacOS 13.6]
Additional context
I have backtracked the functions where it is throwing error from
So far I found that _load_atom in https://github.com/splunk/splunk-sdk-python/blob/master/splunklib/client.py#L205C5-L205C15 is throwing the error.
Hi @faizanmansuri , we are unable to reproduce the issue. So can you please share other details such as Cluster configurations, as well as the response body that is received from the Splunk Enterprise. Also could you confirm if the issue exists only for the saved-search APIs or all the other APIs as well. Thanks!
Hi @ashah-splunk, Thanks for looking into it. I found that there is an issue with other APIs response as well in our specific Splunk environment So I don't think it is a SDK problem.