mitmproxy / docker-releases

🗃️ This repository has been integrated into mitmproxy/mitmproxy.
52 stars 26 forks source link

Potential Issue with Console width? #23

Closed colin-streicher closed 6 years ago

colin-streicher commented 6 years ago

I am unable to get the latest docker image to start. I get the error below.

I am running this through portainer, docker version is 17.12.0-ce-mac55 ( 23011 ).

Stepping back in mitm build versions,

3.0.0 breaks and each version up until latest shows the same issue. 2.0.1 works without issue

I'm not sure what other information is needed.

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/commands.py", line 119, in widget

id.Text(i) for i in textwrap.wrap(txt, cols)]

/usr/lib/python3.6/textwrap.py", line 379, in wrap

rn w.wrap(text)

/usr/lib/python3.6/textwrap.py", line 354, in wrap

rn self._wrap_chunks(chunks)

/usr/lib/python3.6/textwrap.py", line 248, in _wrap_chunks

e ValueError("invalid width %r (must be > 0)" % self.width)

or: invalid width 0 (must be > 0)

k (most recent call last):

/usr/bin/mitmproxy", line 11, in <module>

exit(mitmproxy())

/usr/lib/python3.6/site-packages/mitmproxy/tools/main.py", line 142, in mitmproxy

console.master.ConsoleMaster, cmdline.mitmproxy, args)

/usr/lib/python3.6/site-packages/mitmproxy/tools/main.py", line 124, in run

er.run()

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/master.py", line 211, in run

.window = window.Window(self)

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/window.py", line 149, in __init__

owStack(master, "flowlist"),

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/window.py", line 57, in __init__

ands = commands.Commands(master),

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/commands.py", line 131, in __init__

 CommandHelp(master)

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/commands.py", line 107, in __init__

r().__init__(self.widget(""))

/usr/lib/python3.6/site-packages/mitmproxy/tools/console/commands.py", line 119, in widget

id.Text(i) for i in textwrap.wrap(txt, cols)]

/usr/lib/python3.6/textwrap.py", line 379, in wrap

rn w.wrap(text)

/usr/lib/python3.6/textwrap.py", line 354, in wrap

rn self._wrap_chunks(chunks)

/usr/lib/python3.6/textwrap.py", line 248, in _wrap_chunks

e ValueError("invalid width %r (must be > 0)" % self.width)

or: invalid width 0 (must be > 0)
mhils commented 6 years ago

How do you invoke mitmproxy? Are you maybe missing -it?

colin-streicher commented 6 years ago

Hi, I invoked it through portainer, but the -it is not missing. It was when I started it the first time and it shows a different error. Specifically this:

Error: mitmproxy's console interface requires a tty. Please run mitmproxy in an interactive shell environment.
Kriechi commented 6 years ago

This looks like an issue with Portainer. Please open an issue in their bugtracker to properly initialize the terminal size for interactive TTYs on container startup.