splunk-sdk-python icon indicating copy to clipboard operation
splunk-sdk-python copied to clipboard

some kvstore.data methods fail if _key has '/'

Open pmeyerson opened this issue 5 years ago • 5 comments

Describe the bug If record key has "/" the update method fails, but insert, query, and delete methods succeed.

This doesn't seem like it should be expected but let me know if it is.

To Reproduce Steps to reproduce the behavior:

service.kvstore.create("test")
col = service.kvstore['test']
bad_key = "01:/i-001"
record = json.dumps({"_key":bad_key, "foo":"bar"})
record_update = json.dumps({"foo":"baz"})
query_key=json.dumps({"_key": bad_key})

# insert succeeds
col.data.insert(record)

# update fails
col.data.update(bad_key, record_update)

# query_by_id fails with 404
col.data.query_by_id(bad_key)

# regular query succeeds
col.data.query(query_key)

# delete_by_id fails with 404
col.data.delete_by_id(bad_key)

# delete succeeds
col.data.delete(query_key)
print(col.data.query())

Expected behavior

To my understanding all these calls should succeed - the inconsistency is very confusing. None of these calls should return HTTP 404 All statements succeed if bad_key does not contain "/"

Splunk (please complete the following information):

  • Version: 8.0.7
  • Docker Image 1d4750df3f5d
  • Deployment: single-instance

SDK (please complete the following information):

  • Version: 1.6.14
  • Language Runtime Version: Python 3.7
  • OS: Mac 10.15.7

pmeyerson avatar Dec 09 '20 19:12 pmeyerson

I believe this is the issue initially reported by syrad #232

pmeyerson avatar Dec 09 '20 19:12 pmeyerson

Greetings @pmeyerson Thanks for bringing it up We have fixed the issue, and the changes will be available in the next release. Reference to PR

vmalaviya-splunk avatar Sep 28 '21 09:09 vmalaviya-splunk

Thanks, looking forward to checking it out!

pmeyerson avatar Sep 29 '21 00:09 pmeyerson

Hi @pmeyerson , we have a new SDK release 1.6.17 with the fix. Would request you to try with the latest SDK version. Let us know in case if you still face the issue.

ashah-splunk avatar Nov 03 '21 18:11 ashah-splunk

confirm working as expected, thank you!

pmeyerson avatar Nov 04 '21 18:11 pmeyerson