aws-containers / eks-app-mesh-polyglot-demo

End to end deployment and observability of polyglot microservices in Amazon EKS using AWS App Mesh, AWS Fargate, Amazon Cloudwatch Container Insights, and AWS X-Ray
MIT No Attribution
64 stars 636 forks source link

prodcatalog pod goes in CrashLoopBackOff. Python Import error: cannot import name 'json' from 'itsdangerous' #12

Open nikitsrj opened 2 years ago

nikitsrj commented 2 years ago

I deployed the pods in EKS, frontend-node and proddetail seems running fine, but prodcatalogpod goes in crashloopbackoff.

Here is the pod log error.

ec2-user:~/environment/eks-app-mesh-polyglot-demo/deployment (master) $ kubectl logs -f prodcatalog-5b85b57487-r4qp7 -n prodcatalog-ns
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 5, in <module>
    from flask.cli import main
  File "/usr/local/lib/python3.9/site-packages/flask/__init__.py", line 21, in <module>
    from .app import Flask, Request, Response
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 26, in <module>
    from . import cli, json
  File "/usr/local/lib/python3.9/site-packages/flask/json/__init__.py", line 21, in <module>
    from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.9/site-packages/itsdangerous/__init__.py)

I think it's the issue of python docker image version of the way we are using pip ? Any suggestion or fixes?

uallu commented 2 years ago

I am seeing the same issue with Python 3.7

nikitsrj commented 2 years ago

Even with the latest docker file which have python3.9, the issue still persists.

@uallu If you want to run just for temporary purpose, you can just use the public image which i found from helmchart public.ecr.aws/u2g6w7p2/eks-workshop-demo/product_catalog:1.0. I did the same. But if i am building the image with the dockerfile, issue still persists.