All Apps and Add-ons

Getting a status code 400 (Bad Request) when trying to restore a object of type dashboard. VersionControl For Splunk v1.0.5.

chris_barrett
SplunkTrust
SplunkTrust

We're experimenting with "v1.0.5 VersionControl For Splunk" https://splunkbase.splunk.com/app/4355 and experiencing an error when attempting to restore an object.

ERROR name=<dashboard> with URL=https://<splunkserver>:8089/servicesNS/<user>/<app>/data/ui/views/<dashboard> statuscode=400 reason=Bad Request, response="<?xml version="1.0" encoding="UTF-8"?>
<response>
<message>
<msg type="ERROR">Argument "version" is not supported by this handler.</msg>
</message>
</response>", in app=<app>, owner=<user>

The backup component works correctly, however the restore feature fails. Please help!

1 Solution

gjanders
SplunkTrust
SplunkTrust

Thanks for reporting this, I did a quick check in my environment and while the dashboard I tested did not have a "version" on it, another dashboard did have it.

So the way the app works is I pull all attributes via a GET command on the REST API, and then POST back the required data. Unfortunately there are various attributes which you cannot submit via a POST request.

In this particular case, line 582 of the splunkversioncontrol_backup_class.py had:

ignoreList = [ "disabled", "eai:appName", "eai:digest", "eai:userName", "isDashboard", "isVisible", "label", "rootNode", "description" ]

I will update that to:

ignoreList = [ "disabled", "eai:appName", "eai:digest", "eai:userName", "isDashboard", "isVisible", "label", "rootNode", "description", "version" ]

I've put a pull request here:
https://github.com/gjanders/SplunkVersionControl/pull/9/files

If you want to restore a dashboard that has been backed up before this fix you can delete the "version" attribute from within the xml dictionary...(or a temporary hack could be put into the restore code if required).
Future backups will not include the version attribute so this will not be an issue going forward...

Once I have tested the above further I will release a new version of the app on SplunkBase

View solution in original post

0 Karma

gjanders
SplunkTrust
SplunkTrust

Thanks for reporting this, I did a quick check in my environment and while the dashboard I tested did not have a "version" on it, another dashboard did have it.

So the way the app works is I pull all attributes via a GET command on the REST API, and then POST back the required data. Unfortunately there are various attributes which you cannot submit via a POST request.

In this particular case, line 582 of the splunkversioncontrol_backup_class.py had:

ignoreList = [ "disabled", "eai:appName", "eai:digest", "eai:userName", "isDashboard", "isVisible", "label", "rootNode", "description" ]

I will update that to:

ignoreList = [ "disabled", "eai:appName", "eai:digest", "eai:userName", "isDashboard", "isVisible", "label", "rootNode", "description", "version" ]

I've put a pull request here:
https://github.com/gjanders/SplunkVersionControl/pull/9/files

If you want to restore a dashboard that has been backed up before this fix you can delete the "version" attribute from within the xml dictionary...(or a temporary hack could be put into the restore code if required).
Future backups will not include the version attribute so this will not be an issue going forward...

Once I have tested the above further I will release a new version of the app on SplunkBase

0 Karma

gjanders
SplunkTrust
SplunkTrust

Tested locally and it worked if I deleted the .pyc file with the same name (could be a temporary/environment issue for me), I'll release a new version soon

0 Karma

gjanders
SplunkTrust
SplunkTrust
0 Karma

chris_barrett
SplunkTrust
SplunkTrust

Tested v1.0.6 and confirmed as working. Thank you for the quick response.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...