Recently I was trying to get the status of an operation calling operation.get on API explorer in GCP https://cloud.google.com/resource-manager/reference/rest/v1/operations/get
The request throws:
field [name] has issue [invalid operation name]
I tried the same request using node Lib for GCP and got the same result.
Operation name used is in format as below:
operations/operation-1552901443197-5845b0ae4997f-496bcbdb-xxxxxx
Did someone encounter this error before?
The issue is caused because the operation you are trying to fetch is from a different resource from the API that you are calling.
Most Cloud APIs have their own APIs, and each one performs its own operations under their own resource.
In this case you are trying to get your operation in the Resource Manager API, as a Resource Management resource, while it is from the Compute Engine resource, and this API (or this one if the operation is global to your project) should be used instead. Using this API instead would solve this issue.
I agree that the response message could be improved in order to point users to which is the actual issue, when facing issues like the one in this question.
That's why I have opened a feature request that you can see in the following link. You can star it in order to give it more visibility and notifications on the updates made there, and add comments here if you have any additional information you might add to this improvement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With