Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Cannot install python-requests into docker image's site-packages #116

Open
mikelambert opened this issue Mar 7, 2017 · 4 comments
Open

Comments

@mikelambert
Copy link

mikelambert commented Mar 7, 2017

This might be a problem with the python-runtime as well (not sure, I only tested with python-compat-runtime)

I can install any modules I want in my docker image's site-packages, except requests. Installing this module results in the following error message trying to access the database. (Note, there is no problem if I install the module in a vendor'ed lib directory within my app itself.)

    mapreduce_states = model.MapreduceState.gql('WHERE result_status = :result_status AND app_id = :app_id ORDER BY start_time DESC', result_status='success', app_id=ranking).fetch(1)
  File "/env/local/lib/python2.7/site-packages/google/appengine/ext/db/__init__.py", line 2161, in fetch
    return list(self.run(limit=limit, offset=offset, **kwargs))
  File "/env/local/lib/python2.7/site-packages/google/appengine/ext/db/__init__.py", line 2330, in next
    return self.__model_class.from_entity(self.__iterator.next())
  File "/env/local/lib/python2.7/site-packages/google/appengine/datastore/datastore_query.py", line 3321, in next
    next_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
  File "/env/local/lib/python2.7/site-packages/google/appengine/datastore/datastore_query.py", line 3207, in next_batch
    batch = self.__next_batch.get_result()
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    return self.__get_result_hook(self)
  File "/env/local/lib/python2.7/site-packages/google/appengine/datastore/datastore_query.py", line 2906, in __query_result_hook
    self._batch_shared.conn.check_rpc_success(rpc)
  File "/env/local/lib/python2.7/site-packages/google/appengine/datastore/datastore_rpc.py", line 1371, in check_rpc_success
    rpc.check_success()
  File "/env/local/lib/python2.7/site-packages/google/appengine/api/apiproxy_stub_map.py", line 579, in check_success
    self.__rpc.CheckSuccess()
  File "/env/local/lib/python2.7/site-packages/google/appengine/ext/vmruntime/vmstub.py", line 312, in _WaitImpl
    raise self._ErrorException(*_DEFAULT_EXCEPTION)
RPCFailedError: The remote RPC to the application server failed for call datastore_v3.RunQuery()."   
@mikelambert
Copy link
Author

Oh I should clarify, I resolved this by leaving the module in a vendor-ed lib (and moved the rest of my modules into the docker image). It took a few hours to debug since I had to binary-search my few-dozen modules, with an 8-10min push to prod each time.

So I'm filing this since it might help someone else encountering something similar. Or might be worth fixing (especially if it's an issue with the python-runtime).

@andrewsg
Copy link
Member

andrewsg commented Mar 7, 2017 via email

@mikelambert
Copy link
Author

I was installing requests==2.12.1, which looks to be newer than the one required by python-compat.

@andrewsg
Copy link
Member

andrewsg commented Mar 8, 2017

Interesting, that's the first report of that then. Thanks. The solution is probably to vendor the version of requests used by the Python runtime and refer to that version directly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants