Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"invalid resource name" error with + in pubsub topic name #10386

Closed
aahventures opened this issue Mar 10, 2020 · 5 comments
Closed

"invalid resource name" error with + in pubsub topic name #10386

aahventures opened this issue Mar 10, 2020 · 5 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. external This issue is blocked on a bug with the actual product. type: question Request for information or clarification. Not an issue.

Comments

@aahventures
Copy link

aahventures commented Mar 10, 2020

Trying to create a pubsub topic with a plus symbol +, although a valid name, does not work. I could not find a place to file issues against the gcloud SDK, so I thought I'd try here because the CLI just uses the googleapis anyways (although I'm not sure which language).

my-deployment.yaml

resources:
  # topics
- name: my-topic
  type: pubsub.v1.topic
  properties:
    topic: my-topic+suffix
$ gcloud deployment-manager deployments create my-deployment --config my-deployment.yaml

Error message:

- code: RESOURCE_ERROR
  location: /deployments/my-deployment/resources/my-topic
  message: '{"ResourceType":"pubsub.v1.topic","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"message":"Invalid
    resource name given (name=projects/{project name}/topics/my-topic suffix).
    Refer to https://cloud.google.com/pubsub/docs/admin#resource_names for more information.","status":"INVALID_ARGUMENT","details":[],"statusMessage":"Bad
    Request","requestPath":"https://pubsub.googleapis.com/v1/projects/{project name}/topics/my-topic+suffix","httpMethod":"PUT"}}'

It seems like the google apis is interpreting the + as a space. Although the documentation for valid pubsub resource names seem to indicate it should work:

The special characters in the above list can be used in resource names without URL-encoding... This is particularly important for REST calls.

Seems like I found an issue and pull request here: googleapis/google-http-java-client#398

$ gcloud --version
Google Cloud SDK 283.0.0
beta 2019.05.17
bq 2.0.54
core 2020.02.28
gsutil 4.48
pubsub-emulator 2019.09.27
@busunkim96
Copy link
Contributor

@aaronhong Thanks for filing an issue!

@hongalex Does this seem like a Pub/Sub issue or a gcloud issue?

@hongalex
Copy link
Member

So I tried gcloud pubsub create topic test+Topic and that seems to work. Similarly, the REST API seems to work fine as well.

This means the issue is probably related to the deployment manager. @busunkim96 Do you know where we can route this to?

@busunkim96
Copy link
Contributor

Ah I see. Thanks for investigating!

@aaronhong would you mind filing an issue on Deployment Manager's public issue tracker? I can also open one on your behalf if you would prefer that.

@busunkim96 busunkim96 added the external This issue is blocked on a bug with the actual product. label Mar 10, 2020
@aahventures
Copy link
Author

Thanks, created an issue there: https://issuetracker.google.com/u/1/issues/151168541

I tried it in the API explorer and it works, but what baffles me is it seems like the Deployment Manager is using the REST API also, no?

From what I see, it's doing a PUT with the same and correct request path:

"requestPath":"https://pubsub.googleapis.com/v1/projects/{project name}/topics/my-topic+suffix"

And the error message (that shows the incorrect resource name) is also from said API?

Invalid resource name given (name=projects/{project name}/topics/my-topic suffix). Refer to https://cloud.google.com/pubsub/docs/admin#resource_names for more information.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 11, 2020
@busunkim96
Copy link
Contributor

Hi @aaronhong, I unfortunately don't know the internals of Deployment Manager. You'll get the best answers by communicating with the person on the issuetracker.google.com issue.

Closing this issue as it is tracked in https://issuetracker.google.com/u/1/issues/151168541.

@busunkim96 busunkim96 added type: question Request for information or clarification. Not an issue. api: pubsub Issues related to the Pub/Sub API. and removed triage me I really want to be triaged. labels Mar 11, 2020
@busunkim96 busunkim96 self-assigned this Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. external This issue is blocked on a bug with the actual product. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants