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!
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
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
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
Version 1.0.6 is available on https://splunkbase.splunk.com/app/4355 that should resolve this issue
Tested v1.0.6 and confirmed as working. Thank you for the quick response.