R
Railway•11mo ago
DM

Firebase/Firestore access errors

e9489f6a-7b0a-45d9-8268-5cd182f9c22c Flask app. Deployed a function which runs correct normally, but fails when deployed to production. Failure point appears to be trying to retrieve data from firebase firestore. I've already validated that I'm not simply missing the key (json access file is stored in the repo) Any idea what the issue could be?
29 Replies
Percy
Percy•11mo ago
Project ID: e9489f6a-7b0a-45d9-8268-5cd182f9c22c
DM
DMOP•11mo ago
Also I should be on the pro plan. Not sure why my flair shows otherwise.
Brody
Brody•11mo ago
is the json file present in the container when deployed to railway?
DM
DMOP•11mo ago
Not running docker 😮
Brody
Brody•11mo ago
wdym?
DM
DMOP•11mo ago
What do you mean json file is present in container? It's present in the repo. Let me look. Something weird - in the process of debugging I said 'fuck it' and pasted the json string into the production file for testing. Still not working
Brody
Brody•11mo ago
the container that is running your app on railway
DM
DMOP•11mo ago
Doesn't look like that's the issue :/
Brody
Brody•11mo ago
so the file has made it into the container?
DM
DMOP•11mo ago
Not sure how to check. But I'm skipping the file and keeping the string in my main app.py file directly Basically hardcoded the access token into the function I'm running.
Brody
Brody•11mo ago
doesnt the gcp sdk need to read a json file from disk based on the location set by an environment variable
DM
DMOP•11mo ago
It does. But you can bypass that and just paste the json from it in as a string. It's bad practice for the same reason you don't want to put api_key = 12345 into your code. But it does narrow down the issue to something else. Googling further.
Brody
Brody•11mo ago
is there some whitelisting you need to do?
DM
DMOP•11mo ago
Good idea. Let me try to do some more troubleshooting on my own. I hate that it's this convoluted *** firebase
Brody
Brody•11mo ago
thats firebase for you just use supabase lol
DM
DMOP•11mo ago
Too late. Everything tied into Firebase 😦 The hilarious thing is I already have a script that pushes firebase to supabase just so I can do any sort of analytics on it. Alright so it looks like I'm connecting to firebase. But whatever docs I pull just aren't working on the online version. I wonder if google is just refusing me access to the full docs.
Brody
Brody•11mo ago
strange
DM
DMOP•11mo ago
Somewhere at line 611-612 it fails 😦
No description
Brody
Brody•11mo ago
any helpfull error messages?
DM
DMOP•11mo ago
None, sadly
No description
Brody
Brody•11mo ago
should this opperation take longer than 30 seconds?
DM
DMOP•11mo ago
Nope. I'm putting like 10 rows of data "documents" Locally this takes a split second. Ditching the stream function in favor of .get()
Brody
Brody•11mo ago
looks like the stream doesnt come through and times out the worker
DM
DMOP•11mo ago
Yup. The question is whyyyyyyyy. .get is still fucked. Mhmhmmhmhmh @Brody dumb question - how do I check which packages have been installed? Wondering if that's the discrepancy.
Brody
Brody•11mo ago
the packages you have defined in your requirements.txt file but individual package versions installed in your container could be different if you aren't pinning the packages to the same version you have installed locally
DM
DMOP•11mo ago
Aite. Going to leave out the firebase component for a bit while I debug.
DM
DMOP•11mo ago
Last question while we're here. Railway seems to mark all API responses I get from Azure as errors (marks them as red). This doesn't create any real problems, but it does reduce observability. Any tips on how to fix?
No description
Brody
Brody•11mo ago
that's because your app is sending those logs to stderr, logs sent to stderr will be coloured red
DM
DMOP•11mo ago
thanks
Want results from more Discord servers?
Add your server