Skip to content

Documentation for testing PubSub needs quotes changing #49

Open
@jervine-gogo

Description

@jervine-gogo

Describe the bug

The documentation for testing the Pub/Sub needs to be updated. The example:
gcloud pubsub topics publish stop-instance-event --project --message "{"command":"stop"}"

This is referring to an older topic name used (stop-instance-event) and should be changed to 'instance-scheduler-event'. The command also use double quotes to wrap the message and double quotes to wrap the JSON components. This causes syntax errors on the Cloud Function. The outer set of double quotes can be replaced with single quotes to resolve this.

Stacktrace Copy

Message[[123 99 111 109 109 97 110 100 58 115 116 111 112 125]] ... Could not decode subscribing data: invalid character 'c' looking for beginning of object key string

To Reproduce

Deploy the Cloud Function as described and try to push the PubSub message as per the documentation.

Expected behaviour

The PubSub message should be sent and the function triggered.

Known workaround

Rename the function used in the pubsub command, and replace outer double quotes with single quotes.

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions