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

Google Cloud Functions Cloud Datastore sample error #929

Closed
jamie-chapman opened this issue Nov 23, 2018 · 5 comments
Closed

Google Cloud Functions Cloud Datastore sample error #929

jamie-chapman opened this issue Nov 23, 2018 · 5 comments

Comments

@jamie-chapman
Copy link

The tutorial in https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/master/functions/datastore

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

@jamie-chapman jamie-chapman changed the title Google Cloud Functions Cloud Datastore sample Google Cloud Functions Cloud Datastore sample error Nov 23, 2018
@fhinkel
Copy link
Contributor

fhinkel commented Nov 26, 2018

Hi 👋 . Thanks for reporting the issue. I can't reproduce the error. Are you using the newest gcloud version (Google Cloud SDK 226.0.0)?

gcloud functions call set --data '{"kind":"Task","key":"sampletask1","value":{"description":"Buy milk"}}'
executionId: **********
result: Entity Task/sampletask1 saved.

@jamie-chapman
Copy link
Author

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

Also using Node version v10.13.0 and Windows 10 version 1709, OS Build 16299.785

@fhinkel
Copy link
Contributor

fhinkel commented 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
Copy link
Author

jamie-chapman commented 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\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

@fhinkel
Copy link
Contributor

fhinkel commented Nov 29, 2018

Strange, following the same example I can't reproduce the error. But you're able to create other cloud functions?

@fhinkel fhinkel closed this as completed Dec 14, 2018
ace-n pushed a commit that referenced this issue Nov 16, 2022
🤖 I have created a release *beep* *boop*
---


## [5.0.3](googleapis/nodejs-speech@v5.0.2...v5.0.3) (2022-09-22)


### Bug Fixes

* Preserve default values in x-goog-request-params header ([#928](googleapis/nodejs-speech#928)) ([ea654b5](googleapis/nodejs-speech@ea654b5))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
telpirion pushed a commit that referenced this issue Nov 16, 2022
🤖 I have created a release \*beep\* \*boop\*
---
### [2.3.7](https://www.github.com/googleapis/nodejs-vision/compare/v2.3.6...v2.3.7) (2021-07-21)


### Bug Fixes

* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#928](https://www.github.com/googleapis/nodejs-vision/issues/928)) ([f5cddc5](https://www.github.com/googleapis/nodejs-vision/commit/f5cddc5086a96ddc4255017366422df40a6efaf5))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
ace-n pushed a commit that referenced this issue Nov 17, 2022
🤖 I have created a release *beep* *boop*
---


## [5.0.3](googleapis/nodejs-speech@v5.0.2...v5.0.3) (2022-09-22)


### Bug Fixes

* Preserve default values in x-goog-request-params header ([#928](googleapis/nodejs-speech#928)) ([ea654b5](googleapis/nodejs-speech@ea654b5))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants