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

scheduleinstance error #1451

Closed
harryliu123 opened this issue Aug 15, 2019 · 4 comments
Closed

scheduleinstance error #1451

harryliu123 opened this issue Aug 15, 2019 · 4 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. status: will not fix Invalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@harryliu123
Copy link

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

@fhinkel
Copy link
Contributor

fhinkel commented Sep 1, 2019

@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.

@fhinkel fhinkel assigned ace-n and djmailhot and unassigned ace-n Sep 1, 2019
@ace-n
Copy link
Contributor

ace-n commented Sep 3, 2019 via email

@fhinkel
Copy link
Contributor

fhinkel commented Oct 3, 2019

Ping @djmailhot

@JustinBeckwith JustinBeckwith added 🚨 This issue needs some love. triage me I really want to be triaged. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Oct 3, 2019
@djmailhot
Copy link
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.

@djmailhot djmailhot added the status: will not fix Invalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap. label Oct 4, 2019
This was referenced Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. status: will not fix Invalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

5 participants