Skip to content

>=3.1.0 does not run under Google App Engine #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Drarok opened this issue Oct 10, 2019 · 1 comment
Closed

>=3.1.0 does not run under Google App Engine #614

Drarok opened this issue Oct 10, 2019 · 1 comment
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup

Comments

@Drarok
Copy link

Drarok commented Oct 10, 2019

The change introduced in 6a7155a, "Switch to the newer importlib_metadata" introduces a new dependency (importlib_metadata) which uses ctypes which are not available on Google App Engine:

  File "…/jsonschema/__init__.py", line 31, in <module>
    import importlib_metadata
  File "…/importlib_metadata/__init__.py", line 15, in <module>
    from ._compat import (
  File "…/importlib_metadata/_compat.py", line 30, in <module>
    import pathlib2 as pathlib
  File "…/pathlib2/__init__.py", line 5, in <module>
    import ctypes
  File "…/.pyenv/versions/2.7.16/lib/python2.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
  File "…/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/sandbox.py", line 1120, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named _ctypes

Since it was only a minor version bump, it was picked up as a valid dependency but totally broke our development environment which took a lot of hunting to find.

I appreciate that as a project you might not want to revert this change for such a niche use-case, but hopefully other people will find this issue and it'll help them resolve the problem.

In short, if you're using this library* on Google App Engine, pin to v3.0.2.

*(or a project with this as a dependency such as Flask-RESTPlus)

@Julian
Copy link
Member

Julian commented Oct 10, 2019

Hi, sorry to hear you had trouble here, it's obviously never my intention to break anyone intentionally.

That being said, yeah, unfortunately as I've said in a few other of these kinds of situations (usually around things like pyinstaller, cx_Freeze, AWS Lambda, or some other serverless environment) -- these places are unfortunately today essentially "unsupported" configurations.

If stuff works there, great, but they do non-standard things, as I'm sure you've noticed in other areas.

There's no CI in place for jsonschema ensuring that new releases don't break these environments. If someone wants to author support (or knows how to do so), I'm very happy to accept PRs, but yeah as-is, this isn't a breaking change as far as backwards compatibility is concerned, given that this wasn't truly supported to begin with -- all the existing tests passed, and unlike #611 and #612, this isn't an environment that's got existing support.

I think if v3.0.2 works that seems like a decent compromise, but I can't guarantee other of these sorts of changes in the future.

I am obviously glad though that you both figured out the root cause here, and also filed this for any others. More than happy to hear additional feedback -- you might also have some luck in this specific case getting importlib-metadata to not use ctypes if you're sufficiently persuasive. It's a PyPA project, so they might be all ears to support App Engine. Once they do, I'm obviously happy to update to a newer version of importlib-metadata, but this still wouldn't be a supported configuration until CI is in place ensuring it doesn't break.

Sorry again for the trouble, going to close this since I don't see any action here, but yeah happy to hear your thoughts.

@Julian Julian closed this as completed Oct 10, 2019
@Julian Julian changed the title Major breaking change as of 3.1.0 – cannot run on Google App Engine (No module named _ctypes) v3.1.0 does not run under Google App Engine Oct 10, 2019
@Drarok Drarok changed the title v3.1.0 does not run under Google App Engine >=3.1.0 does not run under Google App Engine Oct 10, 2019
@Julian Julian added the Invalid Not a bug, PEBKAC, or an unsupported setup label Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup
Projects
None yet
Development

No branches or pull requests

2 participants