openshift-labs / starter-guides

Getting Started with OpenShift for Developers workshop
https://openshift-labs.github.io/starter-guides-html/
Apache License 2.0
136 stars 147 forks source link

Python container from "Deploying Python Code" starts with an error. Blocker for python option. #210

Open pittar opened 2 years ago

pittar commented 2 years ago

Language: Python Module: Deploying Python Code

There seems to be an issue with the Python code (or dependencies). Although the build completes successfully and the image start, the app does not work. If you look at the pod logs, you see:

[Wed May 18 14:45:01.247844 2022] [wsgi:error] [pid 63:tid 139903059884224] mod_wsgi (pid=63): Failed to exec Python script file '/tmp/mod_wsgi-localhost:8080:1000860000/handler.wsgi'.
[Wed May 18 14:45:01.247873 2022] [wsgi:error] [pid 63:tid 139903059884224] mod_wsgi (pid=63): Exception occurred processing WSGI script '/tmp/mod_wsgi-localhost:8080:1000860000/handler.wsgi'.
[Wed May 18 14:45:01.248628 2022] [wsgi:error] [pid 63:tid 139903059884224] Traceback (most recent call last):
[Wed May 18 14:45:01.248655 2022] [wsgi:error] [pid 63:tid 139903059884224]   File "/tmp/mod_wsgi-localhost:8080:1000860000/handler.wsgi", line 90, in <module>
[Wed May 18 14:45:01.248660 2022] [wsgi:error] [pid 63:tid 139903059884224]     handler = mod_wsgi.server.ApplicationHandler(entry_point,
[Wed May 18 14:45:01.248664 2022] [wsgi:error] [pid 63:tid 139903059884224]   File "/opt/app-root/lib64/python3.8/site-packages/mod_wsgi/server/__init__.py", line 1458, in __init__
[Wed May 18 14:45:01.248665 2022] [wsgi:error] [pid 63:tid 139903059884224]     __import__(entry_point)
[Wed May 18 14:45:01.248668 2022] [wsgi:error] [pid 63:tid 139903059884224]   File "/opt/app-root/src/wsgi.py", line 7, in <module>
[Wed May 18 14:45:01.248670 2022] [wsgi:error] [pid 63:tid 139903059884224]     from flask import Flask, request
[Wed May 18 14:45:01.248672 2022] [wsgi:error] [pid 63:tid 139903059884224]   File "/opt/app-root/lib64/python3.8/site-packages/flask/__init__.py", line 14, in <module>
[Wed May 18 14:45:01.248674 2022] [wsgi:error] [pid 63:tid 139903059884224]     from jinja2 import escape
[Wed May 18 14:45:01.248682 2022] [wsgi:error] [pid 63:tid 139903059884224] ImportError: cannot import name 'escape' from 'jinja2' (/opt/app-root/lib64/python3.8/site-packages/jinja2/__init__.py)

This was discovered by one of the participants in my workshop today (the only one that chose the python option). I went ran through the steps myself and hit the same problem.

Unfortunately, I don't know anything about python or I'd try to fix the issue myself and submit a PR.

As it stands, this is a blocker to completing the workshop using the python option.