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
Path Finder

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

Alerts for Splunk Admins https://splunkbase.splunk.com/app/3796/
Version Control for Splunk https://splunkbase.splunk.com/app/4355/

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

Alerts for Splunk Admins https://splunkbase.splunk.com/app/3796/
Version Control for Splunk https://splunkbase.splunk.com/app/4355/

View solution in original post

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

Alerts for Splunk Admins https://splunkbase.splunk.com/app/3796/
Version Control for Splunk https://splunkbase.splunk.com/app/4355/
0 Karma

gjanders
SplunkTrust
SplunkTrust

Version 1.0.6 is available on https://splunkbase.splunk.com/app/4355 that should resolve this issue

Alerts for Splunk Admins https://splunkbase.splunk.com/app/3796/
Version Control for Splunk https://splunkbase.splunk.com/app/4355/
0 Karma

chris_barrett
Path Finder

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

0 Karma
Take the 2021 Splunk Career Survey

Help us learn about how Splunk has
impacted your career by taking the 2021 Splunk Career Survey.

Earn $50 in Amazon cash!