INVALID_ARGUMENT: Invalid resource name given – Google Cloud API Error


When invalid argument values are passed to the Google Cloud APIs, INVALID_ARGUMENT: Invalid resource name given error is returned.

IoT Cloud Tester  application will return this if the any of the field values that are passed to Google Cloud API is incorrect.

In the below example, the topic name value is not valid since it has space in the name of the topic.

Following error message is returned by Google Cloud API.

INVALID_ARGUMENT: Invalid resource name given (name=projects/second-inquiry-315605/topics/topic invalid). Refer to https://cloud.google.com/pubsub/docs/admin#resource_names for more information.

To fix this error, pass valid values to Google API arguments,

  • Check the values of the arguments passed to Google APIs.
  • Refer to https://cloud.google.com/pubsub/docs/admin#resource_names