How to fix errors after deploy

I’m studying deploy for the first time, so please understand.

There are two issues I can’t solve.
I used json related to firebase admin sdk in the back end in the environment variable called GOOGLE_APPLICATION_CREDENTIALS, and it worked well locally, but I haven’t been able to find GOOGLE_APPLICATION_CREDENTIALS since I deployed it. I think it’s a natural result, but I don’t know how to solve this.
The other thing is that I get an error called failed to connect to machine: give up after 15 attempts (in 20.232591309s). I think it’s the result of my misconfiguration, but I don’t know what the hell is wrong.

const app = express();

const { MONGO_URI, GOOGLE_APPLICATION_CREDENTIALS } = process.env;
const PORT = process.env.PORT || 8080;

const serviceAccount = require(GOOGLE_APPLICATION_CREDENTIALS);

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
});

const hostname = '0.0.0.0';
app.listen(PORT, hostname);

Part of my backend app.js code.
If anyone knows, please help. Thank you.

Try:

fly secrets set GOOGLE_APPLICATION_CREDENTIALS=...

Replace ... with the credentials.

See: fly secrets set · Fly Docs

I tried it. But couldn’t find the module maybe because it’s the file path on my local.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.