R
Railway•10mo 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•10mo ago
Project ID: e9489f6a-7b0a-45d9-8268-5cd182f9c22c
DM
DM•10mo ago
Also I should be on the pro plan. Not sure why my flair shows otherwise.
Brody
Brody•10mo ago
is the json file present in the container when deployed to railway?
DM
DM•10mo ago
Not running docker 😮
Brody
Brody•10mo ago
wdym?
DM
DM•10mo 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•10mo ago
the container that is running your app on railway
DM
DM•10mo ago
Doesn't look like that's the issue :/
Brody
Brody•10mo ago
so the file has made it into the container?
DM
DM•10mo 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•10mo ago
doesnt the gcp sdk need to read a json file from disk based on the location set by an environment variable
DM
DM•10mo 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•10mo ago
is there some whitelisting you need to do?
DM
DM•10mo ago
Good idea. Let me try to do some more troubleshooting on my own. I hate that it's this convoluted *** firebase
Brody
Brody•10mo ago
thats firebase for you just use supabase lol
DM
DM•10mo 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•10mo ago
strange
DM
DM•10mo ago
Somewhere at line 611-612 it fails 😦
No description
Brody
Brody•10mo ago
any helpfull error messages?
DM
DM•10mo ago
None, sadly
No description
Brody
Brody•10mo ago
should this opperation take longer than 30 seconds?
DM
DM•10mo 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•10mo ago
looks like the stream doesnt come through and times out the worker
DM
DM•10mo 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•10mo 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
DM•10mo ago
Aite. Going to leave out the firebase component for a bit while I debug.
DM
DM•10mo 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•10mo ago
that's because your app is sending those logs to stderr, logs sent to stderr will be coloured red
DM
DM•10mo ago
thanks
Want results from more Discord servers?
Add your server