Skip to content

Could not find object on role create #484

@conor-f

Description

@conor-f

When trying to create a role and assign default properties, the response is: splunklib.binding.HTTPError: HTTP 404 Not Found -- Could not find object id=XXXXXXXX

However, the role appears to have been created correctly.

To Reproduce

>>> import splunklib.client as client
>>> service = client.connect(host="XXXXXXXX", port=8089, username="XXXXXXXX", password="XXXXXXXX", token=None, app="search")
>>> service.roles.create("bugreport-role-name", imported_roles=["XXXXXXXX"], srchIndexesAllowed=["XXXXXXXX"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/client.py", line 3510, in create
    response = self.get(name)
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/client.py", line 1668, in get
    return super(Collection, self).get(name, owner, app, sharing, **query)
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/client.py", line 766, in get
    **query)
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/binding.py", line 290, in wrapper
    return request_fun(self, *args, **kwargs)
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/binding.py", line 71, in new_f
    val = f(*args, **kwargs)
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/binding.py", line 686, in get
    response = self.http.get(path, all_headers, **query)
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/binding.py", line 1194, in get
    return self.request(url, { 'method': "GET", 'headers': headers })
  File "/home/conor/Code/splunk/.env_python3.6/lib/python3.6/site-packages/splunklib/binding.py", line 1255, in request
    raise HTTPError(response)
splunklib.binding.HTTPError: HTTP 404 Not Found -- Could not find object id=bugreport-role-name

Expected behavior
No error and the Role is returned.

Splunk:

  • Version: 8.0.3
  • OS: Ubuntu 20.04
  • Deployment: Distributed

SDK:

  • Version: 1.6.14
  • Language Runtime Version: Python 3.6
  • OS: Ubuntu 20.04

Additional context
Pretty sure this also happens when creating users too. And some other resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions