New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error deleteing a client #49

Closed
c0ndor opened this Issue Nov 4, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@c0ndor
Copy link

c0ndor commented Nov 4, 2014

Trying to delete a client and all it's data from GRR. Sync=False is trying to be passed to the DeleteSubject function but there is no sync argument for that function.
https://github.com/google/grr/blob/master/lib/data_store.py#L159

In [7]: token = access_control.ACLToken(username="Me", reason="Removing test clients")

In [8]: aff4.FACTORY.Delete(rdfvalue.ClientURN("C.ebb1a9185cd7b5e3 "))
INFO:2014-11-04 20:10:46,294 aff4:722] Found 117 objects to remove when removing aff4:/C.ebb1a9185cd7b5e3

DEBUG:2014-11-04 20:10:46,311 aff4:730] Removing aff4:/C.ebb1a9185cd7b5e3

TypeError Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/grr/tools/console.py in ()
----> 1 aff4.FACTORY.Delete(rdfvalue.ClientURN("C.ebb1a9185cd7b5e3 "))

/usr/lib/python2.7/dist-packages/grr/lib/aff4.pyc in Delete(self, urn, token, limit)
734 except KeyError:
735 pass
--> 736 data_store.DB.DeleteSubject(urn_to_delete, token=token, sync=False)
737
738 # Ensure this is removed from the cache as well.

TypeError: DeleteSubject() got an unexpected keyword argument 'sync'

@scudette

This comment has been minimized.

Copy link
Contributor

scudette commented Nov 4, 2014

Thanks this is a bug in the data store implementations. The Mongo datastore takes this parameter, but mysql and sqlite do not. They should just discard it (since they are already synchronized).

You can just fix it but adding the sync=False parameter to the implementation you are using (either sqlite or mysql).

@c0ndor

This comment has been minimized.

Copy link

c0ndor commented Nov 4, 2014

This also affects deleting artifacts in the artifact manager. This isn't terribly surprising as it also uses the DeleteSubject function.

@grrrrrrrrr

This comment has been minimized.

Copy link
Contributor

grrrrrrrrr commented Dec 3, 2014

Sorry for leaving this bug open for so long. I just pushed a change that should fix these issues:
bdde13c

@grrrrrrrrr grrrrrrrrr closed this Dec 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment