Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing #27

Open
leongwaikay opened this issue Jun 10, 2020 · 7 comments
Open
Labels
bug Something isn't working

Comments

@leongwaikay
Copy link

@andrei-tatar Got my heroku installation working previously, but suddenly I got the error Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail, and seems that my database is empty, resulting in login: { error: password authentication failed for user "ohubflebemtayr"

Traced the error to line 61 of login.ts:
await this.userRepository.value.createUserRecordIfNotExists(decoded.uid);

Inspected my postgres db on Heroku and gasp it is empty!

@andrei-tatar
Copy link
Owner

@leongwaikay yup, unfortunately a lot of things are missing from the description. I'll try to run through them and update any missing things.

Also the code (currently) does not automatically create the table on the 1st run. Will need to update that as well.

@andrei-tatar andrei-tatar added the bug Something isn't working label Jun 10, 2020
@nicandris
Copy link
Contributor

@leongwaikay the exact same thing happened to me 2days ago for some reason. this happened:

login: { error: password authentication failed for user "ohubflebemtayr" and its because of this in config.ts:

export const postgres = { connectionString: 'postgres://ohubflebemtayr:798e58067843da246bd9e3016c16b1e91e8429ed1f835bc028b4654905476c4b@ec2-79-125-26-232.eu-west-1.compute.amazonaws.com:5432/d971p7nrn8fnsv', ssl: ssl, max: (isLocal ? local.postgresMax : ~~getCfg('POSTGRES_MAX')) || 5, idleTimeoutMillis: (isLocal ? local.postgresIdleTimeoutMills : ~~getCfg('POSTGRES_IDLETIMEOUTMILLS')) || 4 * this.HOUR, connectionTimeoutMillis: (isLocal ? local.postgressConnectionTimeoutMills : ~~getCfg('CONNECTIONTIMEOUTMILLIS')) || 2000 };

i mention the line to edit to create the table in the guide btw, but i have to apologize for anything missing in there. @andrei-tatar let me know when you edit the tutorial so i can test it for you from scratch

@nicandris
Copy link
Contributor

ah sorry, forgot the fix 😂 change
connectionString: 'postgres://ohubflebemtayr:798e58067843da246bd9e3016c16b1e91e8429ed1f835bc028b4654905476c4b@ec2-79-125-26-232.eu-west-1.compute.amazonaws.com:5432/d971p7nrn8fnsv'

to connectionString: getCfg(DATABASE_URL)

@leongwaikay
Copy link
Author

to connectionString: getCfg(DATABASE_URL)

Shoud be connectionString: getCfg('DATABASE_URL')

So you mean previously we were connecting to someone else postgres?!

@leongwaikay
Copy link
Author

Also the code (currently) does not automatically create the table on the 1st run. Will need to update that as well.

Seems like @nicandris has added the code in user.repository.ts

@rockstar2020
Copy link

Hey guys,
Is this issue resolved yet?
At first run looks like still the necessary database/tables are not created.
Not sure if it's related but when I try to add my project in Google Home app I can now authenticate successfully but nothing happens after that. I mean no project is added to my Google Home app.
Any hints to fix the issue is highly appreciated.
Cheers

@jerom87
Copy link

jerom87 commented Jan 18, 2021

Hi, is it correct that the change connectionString: getCfg('DATABASE_URL') must be made in the config.ts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants