Crash Mitmproxy when turn on mode transparent - python

I was learning about mitmproxy and trying to run it, I realized that when I ran the following command (admin rights):
mitmdump --mode transparent --ssl-insecure
it would cause mitmproxy crash:
Please lodge a bug report at: https://github.com/mitmproxy/mitmproxy
192.168.1.223:51720: clientdisconnect
192.168.1.223:51722: clientconnect
192.168.1.223:51722: GET https://140.82.113.26/_sockets/u/53718521/ws?session=eyJ2IjoiVjMiLCJ1Ijo1MzcxODUyMSwicyI6NTUzMzc5MDA2LCJjIjoxOTU3MjMyNzE1LCJ0IjoxNTkzNzU3MDg3fQ%3D%3D--4fceba1ee908439bbfbb6dd7ff882aa7f445a82584e481ea2c0a372f3b277360&shared=true
<< 101 Switching Protocols 0b
192.168.1.223:51722: Traceback (most recent call last):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\server.py", line 121, in handle
root_layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\modes\transparent_proxy.py", line 19, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 285, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http1.py", line 83, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 190, in __call__
if not self._process_flow(flow):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 449, in _process_flow
layer = WebSocketLayer(self, f)
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\websocket.py", line 71, in __init__
data = self.connections[self.server_conn].send(request)
File "c:\python\python38-32\lib\site-packages\wsproto\connection.py", line 109, in send
raise LocalProtocolError("Event {} cannot be sent.".format(event))
wsproto.utilities.LocalProtocolError: Event Request(host='140.82.113.26', target='/_sockets/u/53718521/ws?session=eyJ2IjoiVjMiLCJ1Ijo1MzcxODUyMSwicyI6NTUzMzc5MDA2LCJjIjoxOTU3MjMyNzE1LCJ0IjoxNTkzNzU3MDg3fQ%3D%3D--4fceba1ee908439bbfbb6dd7ff882aa7f445a82584e481ea2c0a372f3b277360&shared=true', extensions=[<PerMessageDeflate client_max_window_bits=15; client_no_context_takeover; server_max_window_bits=15; server_no_context_takeover>], extra_headers=[], subprotocols=[]) cannot be sent.
Traceback (most recent call last):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\server.py", line 121, in handle
root_layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\modes\transparent_proxy.py", line 19, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\tls.py", line 285, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http1.py", line 83, in __call__
layer()
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 190, in __call__
if not self._process_flow(flow):
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\http.py", line 449, in _process_flow
layer = WebSocketLayer(self, f)
File "c:\python\python38-32\lib\site-packages\mitmproxy\proxy\protocol\websocket.py", line 71, in __init__
data = self.connections[self.server_conn].send(request)
File "c:\python\python38-32\lib\site-packages\wsproto\connection.py", line 109, in send
raise LocalProtocolError("Event {} cannot be sent.".format(event))
wsproto.utilities.LocalProtocolError: Event Request(host='140.82.113.26', target='/_sockets/u/53718521/ws?session=eyJ2IjoiVjMiLCJ1Ijo1MzcxODUyMSwicyI6NTUzMzc5MDA2LCJjIjoxOTU3MjMyNzE1LCJ0IjoxNTkzNzU3MDg3fQ%3D%3D--4fceba1ee908439bbfbb6dd7ff882aa7f445a82584e481ea2c0a372f3b277360&shared=true', extensions=[<PerMessageDeflate client_max_window_bits=15; client_no_context_takeover; server_max_window_bits=15; server_no_context_takeover>], extra_headers=[], subprotocols=[]) cannot be sent.
mitmproxy has crashed!
Can someone help me with this problem? Thanks!
By the way, the version information I'm using is as follows:
Mitmproxy: 5.1.1
Python: 3.8.2
OpenSSL: OpenSSL 1.1.1g 21 Apr 2020
Platform: Windows-10-10.0.18362-SP0

Related

Why does python p5 give so much errors and warnings?

I'm trying to use the Python Processing port by Abhik Pal and Manindra Mohrarna. It seems to work fine, but it gives lots of warnings and errors and it really bothers me.
WARNING: Traceback (most recent call last):
File "C:\Users\gabri\Documents\Programmazione\Python\p5Sketchbook\test.py", line 10, in <module>
run()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 155, in run
p5.sketch = Sketch(setup_method, draw_method, handlers, frame_rate)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 60, in __init__
app.Canvas.__init__(
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 211, in __init__
self.create_native()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 228, in create_native
self._app.backend_module.CanvasBackend(self, **self._backend_kwargs)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 298, in __init__
self._on_resize(self._id, size[0], size[1])
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 394, in _on_resize
self._vispy_canvas.events.resize(
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in __call__
self._invoke_callback(cb, event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 471, in _invoke_callback
_handle_exception(self.ignore_callback_errors,
<< caught exception here: >>
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 157, in on_resize
p5.renderer.reset_view()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\renderer2d.py", line 82, in reset_view
self.texture_prog['modelview'] = self.modelview_matrix.T.flatten()
TypeError: 'NoneType' object does not support item assignment
ERROR: Invoking <bound method Sketch.on_resize of <Sketch (Glfw) at 0x1fba232bfd0>> for ResizeEvent
Exception ignored on calling ctypes callback function: <function CanvasBackend._on_close at 0x000001FBA2375EA0>
Traceback (most recent call last):
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\glfw\__init__.py", line 660, in callback_wrapper
return func(*args, **kwargs)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\backends\_glfw.py", line 400, in _on_close
self._vispy_canvas.close()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\app\canvas.py", line 463, in close
self.events.close()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 453, in __call__
self._invoke_callback(cb, event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\vispy\util\event.py", line 469, in _invoke_callback
cb(event)
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\base.py", line 148, in on_close
exit()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\_sitebuiltins.py", line 26, in __call__
raise SystemExit(code)
SystemExit: None
Traceback (most recent call last):
File "C:\Users\gabri\Documents\Programmazione\Python\p5Sketchbook\test.py", line 10, in <module>
run()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 167, in run
exit()
File "C:\Users\gabri\AppData\Local\Programs\Python\Python310\lib\site-packages\p5\sketch\userspace.py", line 250, in exit
p5.exit(*args, **kwargs)
AttributeError: module 'p5.core.p5' has no attribute 'exit'
Process returned 1 (0x1) execution time : 20.330 s
What does this mean? Why does it happen and is there a way to fix this?

Anki AssertionError learning

Hi I have a problem with anki when using it I get the following error.
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=False sv=2
Add-ons, last update check: 2021-12-02 12:41:47
Caught exception:
Traceback (most recent call last):
File “aqt\webview.py”, line 41, in cmd
File “aqt\webview.py”, line 142, in _onCmd
File “aqt\webview.py”, line 595, in _onBridgeCmd
File “aqt\reviewer.py”, line 503, in _linkHandler
File “aqt\reviewer.py”, line 423, in _answerCard
File “aqt\reviewer.py”, line 430, in _after_answering
File “aqt\reviewer.py”, line 211, in nextCard
File “aqt\reviewer.py”, line 317, in _showQuestion
File “anki\cards.py”, line 184, in autoplay
File “anki\decks.py”, line 309, in config_dict_for_deck_id
AssertionError

Channel tests with selenium in Django raise error message

I'm following this tutorial to experiment Channels with Django. I'm working on Windows 10 HOME, Django 2.1.4 and Python 3.7.1
The goal of this tutorial is to build a chat app.
After downloading chromeDriver and adding it in the PATH, I run this command in my prompt :
py manage.py test chat.tests
Which returns this error message :
EETraceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
======================================================================
ERROR: test_when_chat_message_posted_then_not_seen_by_anyone_in_different_room (chat.tests.ChatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\test\testcases.py", line 202, in __call__
self._pre_setup()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\channels\testing\live.py", line 52, in _pre_setup
self._server_process.start()
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\reduction.py", line 61, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'DaphneProcess.__init__.<locals>.<lambda>'
======================================================================
ERROR: test_when_chat_message_posted_then_seen_by_everyone_in_same_room (chat.tests.ChatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\test\testcases.py", line 202, in __call__
self._pre_setup()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\channels\testing\live.py", line 52, in _pre_setup
self._server_process.start()
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\reduction.py", line 61, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'DaphneProcess.__init__.<locals>.<lambda>'
----------------------------------------------------------------------
Ran 0 tests in 4.689s
FAILED (errors=2)
Destroying test database for alias 'default'...
The same question (https://stackoverflow.com/questions/50016048....) provide a solution, but it doesn't work for me.
When I modify the file reduction.py to replace import pickle by import dill as pickle, I'm getting this new message error :
DevTools listening on ws://127.0.0.1:25037/devtools/browser/b4c722e4-c7f2-49fb-939b-7372e9688eea
C:\Users\kevin\Envs\myproject\lib\site-packages\daphne\server.py:13: UserWarning: Something has already installed a non-asyncio Twisted reactor. Attempting to uninstall it; you can fix this warning by importing daphne.server early in your codebase or finding the package that imports Twisted and importing it later on.
UserWarning,
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\kevin\appdata\local\programs\python\python37-32\Lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
File "C:\Users\kevin\Envs\myproject\lib\site-packages\dill\_dill.py", line 304, in load
obj = pik.load()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\dill\_dill.py", line 465, in find_class
return StockUnpickler.find_class(self, module, name)
File "C:\Users\kevin\Envs\myproject\lib\site-packages\channels\auth.py", line 12, in <module>
from django.contrib.auth.models import AnonymousUser
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\contrib\auth\models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\contrib\auth\base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\db\models\base.py", line 87, in __new__
app_config = apps.get_containing_app_config(module)
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\apps\registry.py", line 249, in get_containing_app_config
self.check_apps_ready()
File "C:\Users\kevin\Envs\myproject\lib\site-packages\django\apps\registry.py", line 132, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Please, someone could bring me help ?

Jupyter terminats/exits with an error

Recently, whenever I terminate Jupyter by hitting CTRL-C I get the following error:
Traceback (most recent call last):
File "/Users/username/anaconda3/bin/jupyter-notebook", line 6, in <module>
sys.exit(notebook.notebookapp.main())
File "/Users/username/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/username/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/Users/username/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 1247, in start
self.io_loop.start()
File "/Users/username/anaconda3/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 177, in start
super(ZMQIOLoop, self).start()
File "/Users/username/anaconda3/lib/python3.5/site-packages/tornado/ioloop.py", line 862, in start
^C File "/Users/username/anaconda3/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 122, in poll
z_events = self._poller.poll(1000*timeout)
File "/Users/username/anaconda3/lib/python3.5/site-packages/zmq/sugar/poll.py", line 99, in poll
return zmq_poll(self.sockets, timeout=timeout)
File "zmq/backend/cython/_poll.pyx", line 123, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:2186)
File "zmq/backend/cython/_poll.pyx", line 116, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:2036)
File "zmq/backend/cython/checkrc.pxd", line 12, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/_poll.c:2418)
File "/Users/username/anaconda3/lib/python3.5/site-packages/conda/gateways/signals.py", line 15, in conda_signal_handler
raise CondaSignalInterrupt(signum)
conda.exceptions.CondaSignalInterrupt: Signal interrupt SIGINT
I tried to search a little for some hint what's the cause or reason but for vain. Therefore, I ask you. Do you know what's the reason?

Launching nose with --with-gae option raises ValueError for missing lib/ipaddr

Setting up the testing framework and I can't seem to get past this error:
Traceback (most recent call last):
File "/usr/local/bin/nosetests", line 8, in <module>
load_entry_point('nose==1.1.2', 'console_scripts', 'nosetests')()
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/core.py", line 118, in __init__
**extra_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/core.py", line 135, in parseArgs
self.config.configure(argv, doc=self.usage())
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/config.py", line 338, in configure
self.plugins.configure(options, self)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/plugins/manager.py", line 271, in configure
cfg(options, config)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/plugins/manager.py", line 94, in __call__
return self.call(*arg, **kw)
File "/Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg/nose/plugins/manager.py", line 162, in simple
result = meth(*arg, **kw)
File "build/bdist.macosx-10.7-intel/egg/nosegae.py", line 80, in configure
File "/usr/local/bin/dev_appserver.py", line 76, in <module>
DIR_PATH = get_dir_path(os.path.join('lib', 'ipaddr'))
File "/usr/local/bin/dev_appserver.py", line 66, in get_dir_path
'file and %s.' % sibling)
ValueError: Could not determine directory that contains both, this file and lib/ipaddr.
It's a correct error coming from dev_appserver.py... there is no lib/ipaddr in the /usr/local/bin directory.
Why is nosetests triggering the raising of this error? Why does dev_appengine try to look for lib/ipaddr in the first place?

Categories