After building the debug image and trying to run it, the mitproxy
would fail to start:
Traceback (most recent call last):
File "/usr/bin/mitmweb", line 8, in
sys.exit(mitmweb())
File "/usr/lib/python3.8/site-packages/mitmproxy/tools/_main.py", line 172, in mitmweb
from mitmproxy.tools import web
File "/usr/lib/python3.8/site-packages/mitmproxy/tools/web/init.py", line 1, in
from mitmproxy.tools.web import master
File "/usr/lib/python3.8/site-packages/mitmproxy/tools/web/master.py", line 5, in
from mitmproxy import addons
File "/usr/lib/python3.8/site-packages/mitmproxy/addons/init.py", line 12, in
from mitmproxy.addons import onboarding
File "/usr/lib/python3.8/site-packages/mitmproxy/addons/onboarding.py", line 2, in
from mitmproxy.addons.onboardingapp import app
File "/usr/lib/python3.8/site-packages/mitmproxy/addons/onboardingapp/init.py", line 3, in
from flask import Flask, render_template
File "/usr/lib/python3.8/site-packages/flask/init.py", line 14, in
from jinja2 import escape
File "/usr/lib/python3.8/site-packages/jinja2/init.py", line 12, in
from .environment import Environment
File "/usr/lib/python3.8/site-packages/jinja2/environment.py", line 25, in
from .defaults import BLOCK_END_STRING
File "/usr/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/usr/lib/python3.8/site-packages/jinja2/filters.py", line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.8/site-packages/markupsafe/init.py)
Fixed the issue by explicitly requiring an older version of MarkupSafe.
After building the debug image and trying to run it, the mitproxy would fail to start:
Traceback (most recent call last): File "/usr/bin/mitmweb", line 8, in
sys.exit(mitmweb())
File "/usr/lib/python3.8/site-packages/mitmproxy/tools/_main.py", line 172, in mitmweb
from mitmproxy.tools import web
File "/usr/lib/python3.8/site-packages/mitmproxy/tools/web/init.py", line 1, in
from mitmproxy.tools.web import master
File "/usr/lib/python3.8/site-packages/mitmproxy/tools/web/master.py", line 5, in
from mitmproxy import addons
File "/usr/lib/python3.8/site-packages/mitmproxy/addons/init.py", line 12, in
from mitmproxy.addons import onboarding
File "/usr/lib/python3.8/site-packages/mitmproxy/addons/onboarding.py", line 2, in
from mitmproxy.addons.onboardingapp import app
File "/usr/lib/python3.8/site-packages/mitmproxy/addons/onboardingapp/init.py", line 3, in
from flask import Flask, render_template
File "/usr/lib/python3.8/site-packages/flask/init.py", line 14, in
from jinja2 import escape
File "/usr/lib/python3.8/site-packages/jinja2/init.py", line 12, in
from .environment import Environment
File "/usr/lib/python3.8/site-packages/jinja2/environment.py", line 25, in
from .defaults import BLOCK_END_STRING
File "/usr/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
File "/usr/lib/python3.8/site-packages/jinja2/filters.py", line 13, in
from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/lib/python3.8/site-packages/markupsafe/init.py)
Fixed the issue by explicitly requiring an older version of MarkupSafe.
The issue is related to: https://github.com/pallets/markupsafe/issues/282