Giter Site home page Giter Site logo

Comments (8)

hiranya911 avatar hiranya911 commented on May 23, 2024 2

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.

hiranya911 avatar hiranya911 commented on May 23, 2024 1

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.pysolved 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.

google-oss-bot avatar google-oss-bot commented on May 23, 2024

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.

google-oss-bot avatar google-oss-bot commented on May 23, 2024

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

from firebase-admin-python.

hiranya911 avatar hiranya911 commented on May 23, 2024

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.

rjvir avatar rjvir commented on May 23, 2024

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.

hiranya911 avatar hiranya911 commented on May 23, 2024

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.

titocosta avatar titocosta commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.