Comments (11)
Happy to! Never heard of it though so I'd appreciate any documentation references for how it is used and when it applies 😄
from cloud-functions-runtime-config.
Created a PR for the throwing a new error #9
from cloud-functions-runtime-config.
I guess GOOGLE_CLOUD_PROJECT
is the new variable to be used and GCLOUD_PROJECT
is being deprecated?
from cloud-functions-runtime-config.
See Jon Skeet's comment in googleapis/gax-dotnet#218
from cloud-functions-runtime-config.
In what context is this environment variable used? That seem to be the .NET extensions whereas this is nodejs. Is this value always available in the CF environment?
from cloud-functions-runtime-config.
Great question. Does this answer it -
Oddly, they favored GCLOUD_PROJECT over GOOGLE_CLOUD_PROJECT for some reason? Any ideas?
Here are the examples I was looking at for you -
https://github.com/search?l=JavaScript&q=org%3AGoogleCloudPlatform+GOOGLE_CLOUD_PROJECT&type=Code
from cloud-functions-runtime-config.
Interesting! Thanks for providing the references, I'll have a look!
from cloud-functions-runtime-config.
What was the context where you needed to provide the value and what error (if any) did you run into?
from cloud-functions-runtime-config.
Ah good question.
I never ran gcloud auth application-default login
or glcoud init
since I downloaded service account .json
credentials.
So, when I ran your code it tried to use undefined
in the URL.
You get this exception -
(node:40972) UnhandledPromiseRejectionWarning: Error: Permission denied on resource project undefined.
at createError (webpack:////Users/junger/dev/pencilled/node_modules/axios/lib/core/createError.js?:16:15)
at settle (webpack:////Users/junger/dev/pencilled/node_modules/axios/lib/core/settle.js?:18:12)
at IncomingMessage.handleStreamEnd (webpack:////Users/junger/dev/pencilled/node_modules/axios/lib/adapters/http.js?:201:11)
at IncomingMessage.emit (events.js:165:20)
at endReadableNT (_stream_readable.js:1101:12)
at process._tickCallback (internal/process/next_tick.js:152:19)
(node:40972) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:40972) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
from cloud-functions-runtime-config.
Perfect, thanks for this!
Seeing that the variable doesn't seem to be documented in any of the official Cloud Functions docs and that the backing libraries throw an exception anyway I'm inclined to not enforce it but rather add this info to the README as you suggest. Either a section for "How to run locally/outside GCP" or "Troubleshooting" for when the above error presents itself. A reminder to run gcloud auth application-default login
, gcloud init
or to set GCLOUD_PROJECT
in cases where it is expected.
What do you think?
from cloud-functions-runtime-config.
Sounds good to me.
from cloud-functions-runtime-config.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-functions-runtime-config.