0

Last Friday I uploaded a new version of my application to App Engine. It was working before, but now I get a 502 Bad Gateway. If I go into the AppEngine console and direct traffic to an older version it works fine. So, I must have changed something, but what?

I pulled the logs and the following caught my attention:

"/layers/google.python.pip/pip/lib/python3.9/site-packages/flask/json/init.py", line 15, in from itsdangerous import json as _json ImportError: cannot import name 'json' from 'itsdangerous' (/layers/google.python.pip/pip/lib/python3.9/site-packages/itsdangerous/init.py)

My requirements file is here:

Flask==1.1.4
google-cloud-datastore==1.12.0
requests==2.24.0

And my import sections are like this:

from flask import Blueprint, render_template
from flask import session, redirect, url_for, escape, request
from google.cloud import datastore

Any ideas where I can look?

kxtronic
  • 331
  • 5
  • 16
  • Did you update Flask version during your update? – Fedor Petrov Feb 21 '22 at 11:55
  • Does this answer your question? [Python Flask import Error of module that isn´t being imported](https://stackoverflow.com/questions/71173981/python-flask-import-error-of-module-that-isn%c2%b4t-being-imported) – new name Feb 21 '22 at 12:20
  • Hi Gaefan, that was it. I upgraded Flask to 2.0.3 and it works like a charm! – kxtronic Feb 21 '22 at 14:46

1 Answers1

0

As indicated in the comment above, the issue was resolved by upgrading from Flask 1.1.2 to Flask 2.0.3

kxtronic
  • 331
  • 5
  • 16