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

ImportError on preflight call #14

Open
jsharpe opened this issue Aug 8, 2018 · 3 comments
Open

ImportError on preflight call #14

jsharpe opened this issue Aug 8, 2018 · 3 comments

Comments

@jsharpe
Copy link

jsharpe commented Aug 8, 2018

Calling preflight gives a 500 error.

Backtrace:

ImportError: No module named pkg_resources
at (/base/data/home/apps/eupvote-xxx/santa-api:auto.411705267076089495/external/gcloud_bigquery_archive/google/cloud/bigquery/init.py:31)
at (/base/data/home/apps/e
upvote-xxx/santa-api:auto.411705267076089495/upvote/gae/bigquery/tables.py:25)
at (/base/data/home/apps/eupvote-xxx/santa-api:auto.411705267076089495/upvote/gae/datastore/models/santa.py:21)
at (/base/data/home/apps/e
upvote-xxx/santa-api:auto.411705267076089495/upvote/gae/datastore/models/rule.py:17)
at (/base/data/home/apps/eupvote-xxx/santa-api:auto.411705267076089495/upvote/gae/real_appengine_config.py:20)
at (/base/data/home/apps/e
upvote-xxx/santa-api:auto.411705267076089495/appengine_config.py:10)
at import_module (/base/alloc/tmpfs/dynamic_runtimes/python27/8882c914eb6132e9_unzipped/python27_dist/lib/python2.7/importlib/init.py:37)
at initialize (/base/alloc/tmpfs/dynamic_runtimes/python27/8882c914eb6132e9_unzipped/python27_lib/versions/1/google/appengine/api/lib_config.py:165)
at _update_configs (/base/alloc/tmpfs/dynamic_runtimes/python27/8882c914eb6132e9_unzipped/python27_lib/versions/1/google/appengine/api/lib_config.py:294)
at getattr (/base/alloc/tmpfs/dynamic_runtimes/python27/8882c914eb6132e9_unzipped/python27_lib/versions/1/google/appengine/api/lib_config.py:358)
at Handle (/base/alloc/tmpfs/dynamic_runtimes/python27/8882c914eb6132e9_unzipped/python27_lib/versions/1/google/appengine/runtime/wsgi.py:240)

@msuozzo
Copy link
Member

msuozzo commented Aug 8, 2018

Yep this is an issue with the recent version update we did with the Bigquery library.

As a mitigation, you should be able to add a file to the top-level directory and add it to the main BUILD rule.

# ./pkg_resources.py
def get_distribution(name):
  fake_dist = object()
  setattr(fake_dist, 'version', '1.1.0')
  return fake_dist

We'll work on getting an actual solution out in the near future.

Thanks for the report!

@thehesiod
Copy link

I haven't figured out how to do this, I put a file at the root of upvote and I still get the error. I even tried adding setuptools as an external library. Does anyone know how to do this?

@thehesiod
Copy link

ok, finally fixed it: farmersbusinessnetwork@e9dbe13

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

3 participants