google-cloudsearch / connector-sdk

Google Cloud Search Connector SDK
Apache License 2.0
51 stars 23 forks source link

Stale version number specified. #36

Open Sylvain-Assemat-DGC opened 4 years ago

Sylvain-Assemat-DGC commented 4 years ago

Hi

How can i delete an item when "Stale version number specified." error incoming ?

Request failed with error {"code":400,"errors":[{"domain":"global","message":"Stale version number specified. ","reason":"failedPrecondition"}],"message":"Stale version number specified. ","status":"FAILED_PRECONDITION"}

cjohnson78 commented 4 years ago

Find the version of the item in the index. Submit your delete request with incrementing the version to be one larger in value (alphanumerically). If version is 1000, submit delete request with 1001.

Note: you will have to base64 decode, then increment, then encode.

-Chad

On Fri, May 1, 2020 at 8:34 AM Sylvain-Assemat-DGC notifications@github.com wrote:

Hi

How can i delete an item when "Stale version number specified." error incoming ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google-cloudsearch/connector-sdk/issues/36, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKUTYEU2LUTO5224OMCLH3RPLMY7ANCNFSM4MXEJPNQ .

Sylvain-Assemat-DGC commented 4 years ago

Hi chad

Thanks for your help

I made a mistake when i set the version (i dont know how i could make it)

My version looks like a timestamp : 1588341947842000 (not encoded as you can see) I try +1 or anything else but no result.

Other document have a good version (encoded like : MTU4ODM0NTcxMzAwMA==)

i can not find how to correct / modify / delete / index ... this document Nothing work

Sylvain-Assemat-DGC commented 4 years ago

I tried your advise It seems to work. I will close the issue after some check

Thanks Chad

Sylvain-Assemat-DGC commented 4 years ago

Chad , do you know how to clearly delete a datasource item and queue in order to start indexing like first time (with NEW ITEM) ? I dont want to create a new datasrouce each time, but it seems that i have doc or item in queue even if the LIST API say {} (empty) and after deleteQueueItems What im missing ?