Skip to content

scheduleinstance error  #1451

Closed
Closed

Description

@harryliu123

git clone https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git
cd nodejs-docs-samples/functions/scheduleinstance/
gcloud functions deploy startInstancePubSub
--trigger-topic start-instance-event
--runtime nodejs8

test functions error

gcloud functions call startInstancePubSub --data '{"data":"eyJ6b25lIjphc2lhLWVhc3QxLWMsImluc3RhbmNlIjoic2NhbGVvdXQtam9idm0ifQo="}'
error: |-
Error: function execution failed. Details:
Unexpected token a in JSON at position 8

Activity

  1. fhinkel commented on Sep 1, 2019

    @fhinkel
    Contributor

    @harryliu123 👋 Thanks for reporting the issue!

    @djmailhot Could you please have a look at this? Seems like there's a problem with the functions/scheduleinstance sample. Thank you.

  2. assigned and unassigned on Sep 1, 2019
  3. ace-n commented on Sep 3, 2019

    @ace-n
    Contributor
  4. fhinkel commented on Oct 3, 2019

    @fhinkel
    Contributor
  5. added
    🚨This issue needs some love.
    triage meI really want to be triaged.
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    and removed
    triage meI really want to be triaged.
    on Oct 3, 2019
  6. djmailhot commented on Oct 4, 2019

    @djmailhot
    Contributor

    @harryliu123, the data encoding string you used has a JSON formatting error.

    yours:
    encoded - eyJ6b25lIjphc2lhLWVhc3QxLWMsImluc3RhbmNlIjoic2NhbGVvdXQtam9idm0ifQo=
    decoded - {"zone":asia-east1-c,"instance":"scaleout-jobvm"}

    corrected:
    decoded - {"zone":"asia-east1-c","instance":"scaleout-jobvm"}
    encoded - eyJ6b25lIjoiYXNpYS1lYXN0MS1jIiwiaW5zdGFuY2UiOiJzY2FsZW91dC1qb2J2bSJ9

    Additionally, this code sample has been updated to use resource labels instead of instance names. See the instance scheduling tutorial to learn how to use resource labels with this code sample.

  7. added
    status: will not fixInvalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap.
    on Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.status: will not fixInvalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap.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