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