Skip to content
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

Vault counts for Drive corpus fails with 400 Bad Request #238

Closed
jay-eleven opened this issue Feb 4, 2022 · 7 comments
Closed

Vault counts for Drive corpus fails with 400 Bad Request #238

jay-eleven opened this issue Feb 4, 2022 · 7 comments

Comments

@jay-eleven
Copy link
Collaborator

When requesting a Vault count for corpus drive, gam fails with ERROR: 400: invalidArgument - Corpus type DRIVE is not supported.

Redacted trace logs:

$ gam config debug_level 1 print vaultcounts matter test corpus drive accounts a@d.com
connect: (vault.googleapis.com, 443)
send: b'GET /$discovery/rest?version=v1 [...]
reply: 'HTTP/1.1 200 OK\r\n'
send: b'GET /v1/matters?view=BASIC [...]
reply: 'HTTP/1.1 200 OK\r\n'
send: b'POST /v1/matters/xx:count?prettyPrint=true&alt=json [...]
send: b'{"view": "ALL", "query": {"dataScope": "ALL_DATA", "corpus": "DRIVE", "searchMethod": "ACCOUNT", "accountInfo": {"emails": ["a@d.com"]}}}'
reply: 'HTTP/1.1 400 Bad Request\r\n'

ERROR:  JSON: {'error': {'code': 400, 'message': 'Corpus type DRIVE is not supported.', 'status': 'INVALID_ARGUMENT'}}
ERROR: 400: invalidArgument - Corpus type DRIVE is not supported.

Gam documentation says:

The required argument corpus specifies whether Gmail mailbox data or Google Groups archives are queried.

But gam's command syntax says:

gam print vaultcounts [todrive <ToDriveAttributes>*]
        matter <MatterItem> corpus drive|mail|groups|hangouts_chat|voice

The drive corpus is indeed supported when exporting from Vault.

There's no indication in the reference documentation that drive is not supported when counting:
https://developers.google.com/vault/reference/rest/v1/matters/count
https://developers.google.com/vault/reference/rest/v1/Query

Some kind of bug on their end?

@taers232c
Copy link
Owner

taers232c commented Feb 4, 2022 via email

@jay-eleven
Copy link
Collaborator Author

Hi Ross!

Yes, counting drive files from the Vault console, does work:

image

I don't think gam is the culprit here, the API requests look good to me.

I'll open a ticket in Google's issue tracker.

Thanks Ross!!

@jay-eleven
Copy link
Collaborator Author

For completeness, issue created: https://issuetracker.google.com/issues/217910338

@taers232c
Copy link
Owner

taers232c commented Feb 6, 2022 via email

@jay-eleven
Copy link
Collaborator Author

Yes, the Vault API guide mentions only MAIL and GROUPS corpus are available for counting. It's the reference documentation that's a bit misleading.

Ah! You beat me to the punch updating gam command line options to mention only mail and groups is available. Good job!

@jay-eleven
Copy link
Collaborator Author

Google confirmed this is the intended behaviour. Only mail and groups are suggested.

@taers232c
Copy link
Owner

taers232c commented Feb 12, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants