googlecodelabs / gcp-marketplace-integrated-saas

Apache License 2.0
19 stars 22 forks source link

Getting "Precondition check failed." while approving entitlement #10

Closed jp9573 closed 3 years ago

jp9573 commented 4 years ago

When ENTITLEMENT_ACTIVATION_REQUESTED comes, it fails with the following message:

File "/srv/account.py", line 140, in approve_entitlement request.execute() File "/env/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper return wrapped(*args, **kwargs) File "/env/lib/python3.7/site-packages/googleapiclient/http.py", line 856, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 400 when requesting https://cloudcommerceprocurement.googleapis.com/v1/providers/DEMO-dev-id/entitlements/98e15ffd-c538-428f-b92e-2cda2be98223:approve?alt=json returned "Precondition check failed.">

Please help me with it, this is a major stopper. Thanks in advance.

P.S. My code has the same implementation of approve_entitlement function.

KishoreNamala commented 4 years ago

The account needs to be in "APPROVED" sign up status before you approve an entitlement. Can you check ?

jp9573 commented 4 years ago

Yes, that was the issue, seems that account approval request took place earlier and it failed due to some reasons and afterward I'm getting entitlement request only.

I manually hit the approval endpoint and it works like a charm. Thanks

NivOclear commented 7 months ago

this happen to me as well, and my account is approved