Skip to content
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
This repository was archived by the owner on Mar 17, 2026. It is now read-only.

Duplicate subscription names silently fail #122

Description

@jasonwilson

Environment details

  • OS: OSX 10.13.3
  • Node.js version: v8.9.1
  • npm version: 5.6.0
  • @google-cloud/pubsub version: 0.18.0

Steps to reproduce

  1. Create topic foo
  2. Create topic bar
  3. Create subscription quix on topic foo
  4. Create subscription quix on topic bar (this is successful?)

If a subscription name already exists for a topic the client doesn't ensure it matches the same topic for the existing resource.

This check allows the subscription to appear to be created successfully despite <topic, name> pair not matching the original resource:
https://github.com/googleapis/nodejs-pubsub/blob/master/src/index.js#L249

Error caught internally:

err is:  { Error: Resource already exists in the project (resource=quix).
    at /tmp/test/grpc/src/client.js:554:15
  code: 6,
  metadata: Metadata { _internal_repr: {} },
  note: 'Exception occurred in retry method that was not classified as transient' }

Ideally createSubscription would fail when the topic name doesn't match the existing resource.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

🚨This issue needs some love.api: pubsubIssues related to the googleapis/nodejs-pubsub API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions