elishaterada / heroku-google-application-credentials-buildpack Goto Github PK
View Code? Open in Web Editor NEWGenerates a Google credential file based on an environment variable
License: MIT License
Generates a Google credential file based on an environment variable
License: MIT License
what is with the ENVVAR name here having @Q
at end? it is very random seems to have come from the last PR merge.
A few days ago, #1 was merged, and the compile script uses the syntax ${GOOGLE_CREDENTIALS@Q}
which was introduced in bash 4.4.
The heroku-16 stack has bash 4.3.48, so this buildpack no longer works there (but on heroku-18 it works fine).
Hello, I followed the instructions on how to install the buildpack, but I get this error in the heroku console when I try to invoke google cloud storage functions:
2022-12-13T20:32:28.601333+00:00 app[web.1]: ERROR SyntaxError: Unexpected end of JSON input
2022-12-13T20:32:28.601354+00:00 app[web.1]: at JSON.parse (<anonymous>)
2022-12-13T20:32:28.601354+00:00 app[web.1]: at ReadStream.<anonymous> (/app/node_modules/google-auth-library/build/src/auth/googleauth.js:346:39)
2022-12-13T20:32:28.601355+00:00 app[web.1]: at ReadStream.emit (node:events:513:28)
2022-12-13T20:32:28.601368+00:00 app[web.1]: at endReadableNT (node:internal/streams/readable:1359:12)
2022-12-13T20:32:28.601369+00:00 app[web.1]: at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
I ran $ heroku run cat google-credentials.json
and the output was empty:
What should I do to debug this problem? Thank you so much!
During compile phase, when I read google-credentials.json
, the file is empty. After further reading I found out that google-credential.sh
only contain echo > /app/google-credentials.json
.
Referencing Build Pack API Documentation, turns out build pack should have read env value from $ENV_DIR
instead from env directly.
Hi,
I have a add the two variables GOOGLE_CREDENTIALS
and GOOGLE_APPLICATION_CREDENTIALS
.
I am getting this error:
google.auth.exceptions.DefaultCredentialsError: ('File google-credentials.json is not a valid json file.', JSONDecodeError('Expecting value: line 2 column 1 (char 1)',))
my json file looks like this:
{ "type": "service_account", "project_id": "324", "private_key_id": "4edf183b0221", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhSkAgEAAoIBAQC3z3HICSRreEIv\nV3v0O4j/N+vjhmLrSpAXaeLHAkFk/RsYmzR\neHiRSTtP0YFfxAXzLsDAN82z5cWY\ny4p0QuNro8685K73P\n-----END PRIVATE KEY-----\n", "client_email": "starting.com", "client_id": "114229", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/sa.gserviceaccount.com" }
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.