Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Document AI get suggestions error

We've import 2K documents using autolabelling and are trying to get suggestions on which ones to label first. However, 'get suggested documents' gives 'failed to get suggested documents'.

In the network tab I see the following http response:
```
[
{
"results": [
{
"data": {
"sampleDocuments": {
"name": "projects/500809854407/locations/eu/operations/18317091772090531111",
"done": false,
"result": "resultNotSet",
"response": {},
"metadata": {
"@type": "type.googleapis.com/google.cloud.documentai.uiv1beta3.SampleDocumentsMetadata",
"commonMetadata": {
"state": "RUNNING",
"createTime": "2025-05-06T09:14:45.537105Z",
"updateTime": "2025-05-06T09:14:45.537105Z",
"resource": "projects/500809854407/locations/eu/processors/7a187fb6d8657a36/dataset"
}
},
"error": {
"code": 0,
"message": "",
"details": []
}
}
},
"path": []
}
],
"responseContext": {
"eti": "AZSnT/PaRa95/JSOyAvu1WCqdTKcOUdN//OCbXybqPgWb5ucArn5Gb4UiPb84s8tpKgEXilnNpyep6XQx+oCXiUPJ0OcCw+hww1MNSTuqUlcDUqfOajyHq8VYJ6qReIk/fG5weIGAMnoY9GZ11hBDtnhZdbWny7rbaFa7+VjTiKHDppy+x3HN38="
}
}
]
```

So some operation is running, and it has been going for 2 weeks already. I haven't been able to cancel the long running operation using the API (I get a 403) to make it restart.

0 1 22
1 REPLY 1

Hi @joostvd ,

It looks like your get suggested documents call is stuck because a long-running operation (sampleDocuments) is still marked as RUNNING, and it’s blocking new suggestions.

Try this:
-Check IAM permissions — you likely need roles/documentai.editor or similar to cancel operations.
-Use the projects.locations.operations.cancel API to stop the operation — but you need the right permissions to avoid the 403 error.
-If canceling via API fails, I recommend opening a Google Cloud Support ticket to force-cancel or clean up the stale operation from the backend.