You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Google Cloud Functions Cloud Datastore sample error #929
Example appears to not accept the sample JSON object in the function "gcloud functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}'".
The error below is given.
ERROR: (gcloud.functions.call) Invalid value for [--data]: Is not a valid JSON: No JSON object could be decoded
Yes the API is enabled, I have since successfully created some Cloud functions that read JSON data and create an entity in Datastore.
Here's a trace of the commands I used for the example: \nodejs-docs-samples-master\nodejs-docs-samples-master\functions\datastore gcloud functions deploy get --trigger-http gcloud functions deploy set --trigger-http gcloud functions deploy del --trigger-http gcloud functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}'
ERROR: (gcloud.functions.call) Invalid value for [--data]: Is not a valid JSON: No JSON object could be decoded
Activity
[-]Google Cloud Functions Cloud Datastore sample[/-][+]Google Cloud Functions Cloud Datastore sample error[/+]fhinkel commentedon Nov 26, 2018
Hi 👋 . Thanks for reporting the issue. I can't reproduce the error. Are you using the newest
gcloudversion (Google Cloud SDK 226.0.0)?jamie-chapman commentedon Nov 26, 2018
Hi! Yes I am using version 226.0.0
gcloud --version Google Cloud SDK 226.0.0 alpha 2018.11.09 bq 2.0.38 core 2018.11.16 gsutil 4.34Also using Node version v10.13.0 and Windows 10 version 1709, OS Build 16299.785
fhinkel commentedon Nov 26, 2018
Could you post the full command that you tried? Everything worked fine for me when I copied the instructions. Do you have the API enabled?
jamie-chapman commentedon Nov 29, 2018
Yes the API is enabled, I have since successfully created some Cloud functions that read JSON data and create an entity in Datastore.
Here's a trace of the commands I used for the example:
\nodejs-docs-samples-master\nodejs-docs-samples-master\functions\datastoregcloud functions deploy get --trigger-httpgcloud functions deploy set --trigger-httpgcloud functions deploy del --trigger-httpgcloud functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}'ERROR: (gcloud.functions.call) Invalid value for [--data]: Is not a valid JSON: No JSON object could be decodedfhinkel commentedon Nov 29, 2018
Strange, following the same example I can't reproduce the error. But you're able to create other cloud functions?
chore(main): release 5.0.3 (#929)
chore: release 2.3.7 (#929)
chore(main): release 5.0.3 (#929)