Comments (8)
I will close this issue, since there's not much we can do from our end to resolve the issues discussed here. We can continue to follow up with the Google cloud and google-auth team to get these issues addressed in the long run.
from firebase-admin-python.
I've created an issue for the google-auth library documenting some of the pain points related to App Engine support. Hopefully we can get some useful feedback from them.
As for the poor support from the dev appserver, this is a long running issue and many other projects are experiencing the same problem. However, there are several workarounds. For me adding the following bit of code into the appengine_config.py
solved the issue:
import os
import google
import imp
import inspect
from google.appengine.ext import vendor
from google.appengine.tools.devappserver2.python import sandbox
sandbox._WHITE_LIST_C_MODULES += ['_ssl', '_socket']
runtime_path = os.path.realpath(inspect.getsourcefile(inspect))
runtime_dir = os.path.dirname(runtime_path)
# Patch and reload the socket module implementation.
system_socket = os.path.join(runtime_dir, 'socket.py')
imp.load_source('socket', system_socket)
# Patch and reload the ssl module implementation.
system_ssl = os.path.join(runtime_dir, 'ssl.py')
imp.load_source('ssl', system_ssl)
This basically whitelists the socket
and ssl
libraries for the dev app server, and uses the system-level socket library instead of the one packaged with the App Engine SDK. Your mileage may vary.
from firebase-admin-python.
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.
from firebase-admin-python.
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
from firebase-admin-python.
I believe this is the expected behavior. The requests library is known to not work on App Engine dev app server. On production you need to enable billing for it to work. See https://stackoverflow.com/questions/9604799/can-python-requests-library-be-used-on-google-app-engine
from firebase-admin-python.
Thanks.
Then maybe a feature request would be for this library to work on the App Engine dev app server. I think this would be very helpful for developers, myself included.
The monkeypatch described in this answer seems like a simple solution and is recommended by Google, and it's one I've used myself with success.
from firebase-admin-python.
The monkeypatch is the recommended solution, but it should be done in the main.py of the web app. This cannot be built into the Admin SDK. As for supporting the dev app server, that's really a bug in dev appserver code.
from firebase-admin-python.
Just updated to Google App Engine Python 1.9.77 which raises an exception when importing sandbox.
Therefore the workaround suggested above stopped working.
from firebase-admin-python.
Related Issues (20)
- [FR] Adding global var HOT 1
- Option to pass values to the transaction function callback HOT 1
- auth.verify_id_token throwing ValueError HOT 1
- [FR] Add Support for Pyodide by providing a wheel with binaries built for Emscripten. HOT 2
- [FR] Add WebApps support to project_management HOT 1
- Couldn't import app_check HOT 1
- Firebase functions container silently freezes on making a get request to Firestore if multiple requests were created before container starts HOT 3
- Call to Firestore getting timed out from the docker container. HOT 1
- Querying Firestore documents by nested key-value in an array field using Python HOT 1
- firestore times out when using default DNS resolver HOT 1
- [FR] Async `messaging` requests HOT 1
- import firebase admin HOT 3
- Using cloud run from gcp console to firebase HOT 1
- Cloud run from gcp console HOT 2
- [FR][FCM] HTTP2 support for sendEach HOT 9
- [FR] Change the firestore db in firestore.client. HOT 1
- Datastore emulator causes firebase admin to hang HOT 2
- Realtime Database Listener Crashes on Internet Disconnection HOT 1
- Better Error handling for empty token list in Messaging send_each_multicast HOT 1
- Documentation: API Reference not available HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-admin-python.