You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local Model Error: Failed to establish connection to macOS system extension (deadline has elapsed) #7236
I installed mitmproxy and it ran wonderfully for around a day.
Then it suddenly stopped to work and instead gave the following error in local mode:
> mitmproxy --mode local
Error logged during startup:
failed to establish connection to macOS system extension
Caused by:
deadline has elapsed
This only happens in the local mode on my MacBook, it still works when I connect my phone to it.
Steps to reproduce the behavior:
I ran the same command several times (continuously, without modifying any settings), and the it just suddenly stopped working on the last try. The error message was rather mysterious and I'm a bit lost on what might have gone wrong.
The exact command was:
mitmproxy --mode local --set console_mouse=false --view-filter '(~m POST | ~m PUT)' -s script.py
Here is a list of information that might be helpful:
I was constantly rerunning the code as I was trying to write a simple Python Script (mainly just prints stuff, didn't mess around with anything fancy). I ran the same instruction around 10 times in 2 minutes before it stopped working.
I was noticing a lot of SSL version and general network connection errors popping up in red from the interface (Unfortunately I have already forgotton where exactly they came from), but the app traffic I was interested in was being processed just fine, so I did not pay much attention.
I have no knowledge on Rust but heard from the blog that the local mode utilized Rust at the backend. Additionally, rustdesk and rustdesk-server have had similar issues happen to it.
Seems like rustdesk also had a lot of trouble replicating the issue, in the end a user said the error was "caused by the client not being able to automatically connect through the transit tunnel", and forcing relay connection solved the issue. Unfortunately I have too little knowledge on the matter to understand what that means, but hopefully this information may be useful to the more experienced folks.
UPDATE: I tried the exact same command after 5 minutes and suddenly it started working again! I honestly have no clue what happened but problem solved I guess?
UPDATE2: It stopped working again, but this time I was trying to access Google and Youtube, which might be related? I also managed to collect some of the error logs that were printed in the terminal. They looked something like this:
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
[e15bea35ca53f7ce] Error: 296, reason: No supported signature algorithm, frame_type: 6
[808bcb10a398e557] Error: 296, reason: No supported signature algorithm, frame_type: 6
Full Logs
> mitmproxy --mode local --set console_mouse=false --view-filter '(~m POST | ~m PUT)' -s script.py
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Server QUIC handshake failed. connection closed
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
Client QUIC handshake failed. connection closed early
[e15bea35ca53f7ce] Error: 296, reason: No supported signature algorithm, frame_type: 6
[808bcb10a398e557] Error: 296, reason: No supported signature algorithm, frame_type: 6
[755bbdb644c611ac] Error: 296, reason: No supported signature algorithm, frame_type: 6
[9091702cd6826729] Error: 296, reason: No supported signature algorithm, frame_type: 6
[2456a43bb682e576] Error: 296, reason: No supported signature algorithm, frame_type: 6
[380d5155e7c475b1] Error: 296, reason: No supported signature algorithm, frame_type: 6
[9bc55106d2ee6228] Error: 296, reason: No supported signature algorithm, frame_type: 6
[0b09041b5d974e7e] Error: 296, reason: No supported signature algorithm, frame_type: 6
[8e6f0cc9b65a7b8c] Error: 296, reason: No supported signature algorithm, frame_type: 6
[183432f0c42cf7ef] Error: 296, reason: No supported signature algorithm, frame_type: 6
[640e0885c05503e6] Error: 296, reason: No supported signature algorithm, frame_type: 6
[f847dd9e4d2aebee] Error: 296, reason: No supported signature algorithm, frame_type: 6
[cdcf298cd73bc149] Error: 296, reason: No supported signature algorithm, frame_type: 6
[1e1a3944b3b70365] Error: 296, reason: No supported signature algorithm, frame_type: 6
[f67e7b60bfcb75c2] Error: 296, reason: No supported signature algorithm, frame_type: 6
[aeb19441f3388a3b] Error: 296, reason: No supported signature algorithm, frame_type: 6
[7ea99eae3a52b06d] Error: 296, reason: No supported signature algorithm, frame_type: 6
[c9211e1439bb93d8] Error: 296, reason: No supported signature algorithm, frame_type: 6
[65e7092245afc1fc] Error: 296, reason: No supported signature algorithm, frame_type: 6
[a251f06339ddebda] Error: 296, reason: No supported signature algorithm, frame_type: 6
It also has a wonderful "XXX: Saw some hangs here during development, not sure why." comment on it, so you are probably not alone. 😅 This is either us not doing a great job with starting up / tearing down the network system extension, or a macOS bug. Unfortunately I cannot reproduce it locally.
Even when the proxy is running I am encountering a duplicate of #6617, #7225, or #7082: Client & mitmproxy cannot agree on a TLS version to use no matter how tls_version_client_min is updated. Not sure if these 2 errors are related but I thought I can post the logs I collected.
info: [13:37:03.779][10.150.121.3:55285] server connect xyks.website.com:443 (59.110.126.151:443)
info: [13:37:03.786][10.150.121.3:55287] server connect xyks.website.com:443 (59.110.126.151:443)
info: [13:37:03.981][10.150.121.3:55286] Client TLS handshake failed. The client disconnected during the handshake. If this happens consistently for inappcheck.itunes.apple.com, this may indicate
that the client does not trust the proxy's certificate.
info: [13:37:03.984][10.150.121.3:55289] server connect xyks.website.com:443 (8.152.208.113:443)
info: [13:37:03.988][10.150.121.3:55288] server connect frog.website.com:443 (39.105.71.126:443)
info: [13:37:03.989][10.150.121.3:55286] client disconnect
Seems like there is a long history behind this bug. What's the current progress like on fixing the issue? Is there a general guess for what might have gone wrong? At first glance this seems like one of these mystery bugs that's caused by race conditions.
Now the proxy is working again but with this different error. I am using my console to track all the logs. However, there are a lot of logs from different processes on my machine, are there any specific files / names / filters I should focus on? Sorry if this is a newbie question, I don't have much experience with tracking logs.
UPDATE: I just searched mitmproxy and recorded all console logs from a working session with Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option error, I will also post a log when it crashes
Full Logs From MitmProxy
info: [14:06:02.481] Using existing mitmproxy redirector app.
info: [14:06:02.557] Local redirector started.
info: [14:06:02.698][127.0.0.1:0] client connect
info: [14:06:02.714][127.0.0.1:0] server connect 17.248.207.66:443
warn: [14:06:02.752][127.0.0.1:0] Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option.
info: [14:06:02.752][127.0.0.1:0] client disconnect
info: [14:06:02.753][127.0.0.1:0] server disconnect 17.248.207.66:443
info: [14:06:04.806][127.0.0.1:0] client connect
info: [14:06:04.824][127.0.0.1:0] server connect 17.248.210.70:443
warn: [14:06:04.845][127.0.0.1:0] Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option.
Full Logs From Console, From Starting Process to First Error
It crashed again on starting and I was able to grab the relevant console logs. Here is what it looks like in terminal:
> mitmproxy --mode local --set console_mouse=false -s script.py
Error logged during startup:
failed to establish connection to macOS system extension
Caused by:
deadline has elapsed
Seems like the error stems from calling NEFlowDirectorCreateInternal with null input:
default 14:32:42.549977-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateStarting: plugin NEFlowDivertPlugin(org.mitmproxy.macos-redirector[inactive]) started with PID 27591 error (null)
default 14:32:42.550338-0500 nesessionmanager [Host org.mitmproxy.macos-redirector]: Starting with options 0x0
fault 14:32:42.550390-0500 org.mitmproxy.macos-redirector.network-extension NEFlowDirectorCreateInternal called with null (control_socket >= 0)
error 14:32:42.550438-0500 org.mitmproxy.macos-redirector.network-extension [Extension org.mitmproxy.macos-redirector]: Cannot start the proxy because the flow director is nil
Hopefully this helps! Please let me know if there are any other things I can do. I'm more than happy to help.
Full Logs From Console
default 14:32:42.472163-0500 Mitmproxy Redirector [0x140804ec0] activating connection: mach=true listener=false peer=false name=com.apple.sysextd
default 14:32:42.478575-0500 Mitmproxy Redirector [0x136f06ff0] activating connection: mach=false listener=false peer=false name=(anonymous)
default 14:32:42.478692-0500 Mitmproxy Redirector [0x140804ec0] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
default 14:32:42.478904-0500 sysextd client activation request for org.mitmproxy.macos-redirector.network-extension
default 14:32:42.478941-0500 sysextd attempting to realize extension with identifier org.mitmproxy.macos-redirector.network-extension
default 14:32:42.482928-0500 sysextd realizing target path: file:///Applications/Mitmproxy%20Redirector.app/Contents/Library/SystemExtensions/org.mitmproxy.macos-redirector.network-extension.systemextension/
default 14:32:42.492510-0500 sysextd retrieved bundle code signing info: SecStaticCodeSigningInfo(entitlements: ["com.apple.developer.networking.networkextension": <__NSArrayM 0x13880f0f0>(
app-proxy-provider-systemextension
)
, "com.apple.application-identifier": S8XHQB96PW.org.mitmproxy.macos-redirector.network-extension, "com.apple.developer.team-identifier": S8XHQB96PW], teamID: sysextd.TeamIDType.teamID("S8XHQB96PW"), cdHashes: ["0e9ba54a2e3b850c556e3cf4e40cf2469c111210": sysextd.ArchInfo(name: "x86_64", cputype: 16777223, cpusubtype: 3), "f19e330893fc151b85c3cde69ae8d720f5179aee": sysextd.ArchInfo(name: "arm64", cputype: 16777228, cpusubtype: 0)], signingIdentifier: "org.mitmproxy.macos-redirector.network-extension")
default 14:32:42.492574-0500 sysextd /Applications/Mitmproxy Redirector.app/Contents/Library/SystemExtensions/org.mitmproxy.macos-redirector.network-extension.systemextension: package type not `DEXT`
default 14:32:42.492624-0500 sysextd /Applications/Mitmproxy Redirector.app/Contents/Library/SystemExtensions/org.mitmproxy.macos-redirector.network-extension.systemextension: entitlement `com.apple.developer.endpoint-security.client` not present or not true
default 14:32:42.501458-0500 sysextd retrieved bundle code signing info: SecStaticCodeSigningInfo(entitlements: ["com.apple.developer.system-extension.install": 1, "com.apple.developer.networking.networkextension": <__NSArrayM 0x13770a350>(
app-proxy-provider-systemextension
)
, "com.apple.application-identifier": S8XHQB96PW.org.mitmproxy.macos-redirector, "com.apple.developer.team-identifier": S8XHQB96PW], teamID: sysextd.TeamIDType.teamID("S8XHQB96PW"), cdHashes: ["589e0e50c8a3098d742e215edf22a223a28d72df": sysextd.ArchInfo(name: "arm64", cputype: 16777228, cpusubtype: 0), "f03a5cee30628b4d0a1644701fa2388bdedc75ee": sysextd.ArchInfo(name: "x86_64", cputype: 16777223, cpusubtype: 3)], signingIdentifier: "org.mitmproxy.macos-redirector")
default 14:32:42.501637-0500 sysextd take reference:
reference: (Optional("file:///.file/id=6571367.61165455/") + S8XHQB96PW + org.mitmproxy.macos-redirector)
references: [(Optional("file:///.file/id=6571367.61165455/") + S8XHQB96PW + org.mitmproxy.macos-redirector)]
result: false
default 14:32:42.501816-0500 Mitmproxy Redirector [0x136f06ff0] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
default 14:32:42.505182-0500 Mitmproxy Redirector [0x1408070a0] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.daemon
default 14:32:42.505232-0500 Mitmproxy Redirector [0x136e11710] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.agent
default 14:32:42.507313-0500 Mitmproxy Redirector [0x136e146d0] activating connection: mach=true listener=false peer=false name=com.apple.nehelper
default 14:32:42.508831-0500 Mitmproxy Redirector Sending load command to nehelper
default 14:32:42.508886-0500 Mitmproxy Redirector Clearing 8DA72D98-BC95-48F5-ACED-212FA095C14C from the loaded configurations
default 14:32:42.509358-0500 Mitmproxy Redirector Adding 8DA72D98-BC95-48F5-ACED-212FA095C14C to the loaded configurations
default 14:32:42.509479-0500 Mitmproxy Redirector [0x136e12740] activating connection: mach=true listener=false peer=false name=com.apple.nesessionmanager
default 14:32:42.509690-0500 nesessionmanager Got a new session client connection from Mitmproxy Redirector(29069)
default 14:32:42.510133-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Adding a connection for client Mitmproxy Redirector[29069]
default 14:32:42.511581-0500 Mitmproxy Redirector Last disconnect error for mitmproxy changed from "none" to "The operation couldn’t be completed. (NEAppProxyFlowErrorDomain error 8.)"
default 14:32:42.514348-0500 Mitmproxy Redirector Saving configuration mitmproxy with existing signature {length = 20, bytes = 0x8151ab92baabd53d561853f5171203e7898df384}
default 14:32:42.521042-0500 Mitmproxy Redirector Received a com.apple.neconfigurationchanged notification with token 13
default 14:32:42.521219-0500 Mitmproxy Redirector Successfully saved configuration mitmproxy
default 14:32:42.521502-0500 Mitmproxy Redirector Sending load command to nehelper
default 14:32:42.521537-0500 Mitmproxy Redirector Clearing 8DA72D98-BC95-48F5-ACED-212FA095C14C from the loaded configurations
default 14:32:42.521620-0500 Mitmproxy Redirector Sending load command to nehelper
default 14:32:42.521647-0500 Mitmproxy Redirector Clearing 8DA72D98-BC95-48F5-ACED-212FA095C14C from the loaded configurations
default 14:32:42.522128-0500 Mitmproxy Redirector Adding 8DA72D98-BC95-48F5-ACED-212FA095C14C to the loaded configurations
default 14:32:42.522690-0500 Mitmproxy Redirector Adding 8DA72D98-BC95-48F5-ACED-212FA095C14C to the loaded configurations
default 14:32:42.522898-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Received a start command from Mitmproxy Redirector[29069]
default 14:32:42.522952-0500 nesessionmanager Registering session NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]
default 14:32:42.524880-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Resetting VPN On Demand
default 14:32:42.524940-0500 nesessionmanager Found 1 registrations for org.mitmproxy.macos-redirector.network-extension (com.apple.networkextension.app-proxy)
default 14:32:42.524972-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Plugin is registered with provider manager
default 14:32:42.525007-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Plugin is installed
default 14:32:42.526885-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateIdle: update configuration
default 14:32:42.528532-0500 nesessionmanager <NESMServer: 0x122009c50>: Register Enterprise VPN Session: NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]
default 14:32:42.528589-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Successfully registered
default 14:32:42.530783-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: status changed to connecting
default 14:32:42.531069-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateIdle: received start message
default 14:32:42.531354-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Leaving state NESMVPNSessionStateIdle
default 14:32:42.531544-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Entering state NESMVPNSessionStatePreparingNetwork, timeout 5 seconds
default 14:32:42.532135-0500 nesessionmanager Found 1 registrations for org.mitmproxy.macos-redirector.network-extension (com.apple.networkextension.app-proxy)
default 14:32:42.532318-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Leaving state NESMVPNSessionStatePreparingNetwork
default 14:32:42.532378-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Entering state NESMVPNSessionStateStarting, timeout 300 seconds
default 14:32:42.532485-0500 nesessionmanager NEFlowDivertPlugin(org.mitmproxy.macos-redirector[inactive]): Sending start command
default 14:32:42.532789-0500 org.mitmproxy.macos-redirector.network-extension [0x13cf04bd0] Channel could not return listener port.
default 14:32:42.533154-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Removing a connection for client Mitmproxy Redirector[29069]
default 14:32:42.541657-0500 org.mitmproxy.macos-redirector.network-extension [0x13da092f0] activating connection: mach=false listener=true peer=false name=(anonymous)
default 14:32:42.541691-0500 org.mitmproxy.macos-redirector.network-extension [0x13da09820] activating connection: mach=false listener=false peer=true name=com.apple.xpc.anonymous.0x13cf04bd0.peer[840].0x13da09820
default 14:32:42.549829-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Plugin NEFlowDivertPlugin(org.mitmproxy.macos-redirector[inactive]) initialized with Mach-O UUIDs (
"B195606E-764E-3BDC-8D17-EA273DAA2EE1"
)
default 14:32:42.549977-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateStarting: plugin NEFlowDivertPlugin(org.mitmproxy.macos-redirector[inactive]) started with PID 27591 error (null)
default 14:32:42.550338-0500 nesessionmanager [Host org.mitmproxy.macos-redirector]: Starting with options 0x0
fault 14:32:42.550390-0500 org.mitmproxy.macos-redirector.network-extension NEFlowDirectorCreateInternal called with null (control_socket >= 0)
error 14:32:42.550438-0500 org.mitmproxy.macos-redirector.network-extension [Extension org.mitmproxy.macos-redirector]: Cannot start the proxy because the flow director is nil
default 14:32:42.550590-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: didSetStatus - 0
default 14:32:42.550612-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateStarting: plugin NEFlowDivertPlugin(org.mitmproxy.macos-redirector[inactive]) disconnected with reason Plugin initiated
default 14:32:42.550642-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Leaving state NESMVPNSessionStateStarting
default 14:32:42.550664-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Entering state NESMVPNSessionStateStopping, timeout 20 seconds
default 14:32:42.550693-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: config request: pushing handler [(null)] (null)
default 14:32:42.550713-0500 nesessionmanager <NESMServer: 0x122009c50>: Request to uninstall session: NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]
default 14:32:42.550729-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: status changed to disconnecting
default 14:32:42.550919-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Updated network agent (inactive, compulsory, not-user-activiated, not-kernel-activated)
default 14:32:42.551204-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateStopping: session is now uninstalled
default 14:32:42.551225-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateStopping: plugin already disconnected, disposing all plugins
default 14:32:42.551265-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Leaving state NESMVPNSessionStateStopping
default 14:32:42.551285-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Entering state NESMVPNSessionStateDisposing, timeout 5 seconds
default 14:32:42.551368-0500 org.mitmproxy.macos-redirector.network-extension [0x13da09820] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
default 14:32:42.551480-0500 org.mitmproxy.macos-redirector.network-extension [Extension org.mitmproxy.macos-redirector]: Session manager connection was invalidated
default 14:32:42.551515-0500 org.mitmproxy.macos-redirector.network-extension [Extension org.mitmproxy.macos-redirector]: Deallocating
default 14:32:42.551613-0500 org.mitmproxy.macos-redirector.network-extension [0x13da092f0] invalidated because the current process cancelled the connection by calling xpc_connection_cancel()
default 14:32:42.551906-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateDisposing: plugin NEFlowDivertPlugin(org.mitmproxy.macos-redirector[inactive]) dispose complete
default 14:32:42.551975-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)] in state NESMVPNSessionStateDisposing: all plugins have disposed
default 14:32:42.552052-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Leaving state NESMVPNSessionStateDisposing
default 14:32:42.552170-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Entering state NESMVPNSessionStateIdle
error 14:32:42.552203-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: Disconnected session has 1 stale completionHandler(s)
default 14:32:42.552239-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: config request: popping handler [(null)] (null)
default 14:32:42.552700-0500 nesessionmanager NESMTransparentProxySession[Primary Tunnel:mitmproxy:8DA72D98-BC95-48F5-ACED-212FA095C14C:(null)]: status changed to disconnected, last stop reason Plugin initiated
Even when the proxy is running I am encountering a duplicate of #6617, #7225, or #7082: Client & mitmproxy cannot agree on a TLS version to use no matter how tls_version_client_min is updated. Not sure if these 2 errors are related but I thought I can post the logs I collected.
Your comment made me look into this again, the compatibility is now much improved on main via #7241. We'll ship a release soon. It is completely unrelated though. :)
As a quick workaround, killing the system extension helps. After running mitmproxy again, a new process is started and everything seems to work (for a while).
As a quick workaround, killing the system extension helps. After running mitmproxy again, a new process is started and everything seems to work (for a while).
Activity
Bojun-Feng commentedon Oct 11, 2024
Tried to uninstall and reinstall, did not fix the issue. Here are the executed commands:
Seems like rustdesk also had a lot of trouble replicating the issue, in the end a user said the error was "caused by the client not being able to automatically connect through the transit tunnel", and forcing relay connection solved the issue. Unfortunately I have too little knowledge on the matter to understand what that means, but hopefully this information may be useful to the more experienced folks.
UPDATE: I tried the exact same command after 5 minutes and suddenly it started working again! I honestly have no clue what happened but problem solved I guess?
UPDATE2: It stopped working again, but this time I was trying to access Google and Youtube, which might be related? I also managed to collect some of the error logs that were printed in the terminal. They looked something like this:
Full Logs
mhils commentedon Oct 11, 2024
Thanks for the detailed report!
This is a nice way of saying we hit a timeout, the rustdesk bug is very likely completely unrelated. :)
The trigger for this is here:
https://github.com/mitmproxy/mitmproxy_rs/blob/d81b68b0399def1c33835f18833e77ed614ad514/src/packet_sources/macos.rs#L82-L92. We're starting the network system extension, but then somehow fail to get a connection from it.
It also has a wonderful "XXX: Saw some hangs here during development, not sure why." comment on it, so you are probably not alone. 😅 This is either us not doing a great job with starting up / tearing down the network system extension, or a macOS bug. Unfortunately I cannot reproduce it locally.
Can you record system logs (https://support.apple.com/guide/console/log-messages-cnsl1012/mac) and see if there's anything interesting in there?
Bojun-Feng commentedon Oct 12, 2024
Even when the proxy is running I am encountering a duplicate of #6617, #7225, or #7082: Client & mitmproxy cannot agree on a TLS version to use no matter how
tls_version_client_minis updated. Not sure if these 2 errors are related but I thought I can post the logs I collected.Seems like there is a long history behind this bug. What's the current progress like on fixing the issue? Is there a general guess for what might have gone wrong? At first glance this seems like one of these mystery bugs that's caused by race conditions.
Now the proxy is working again but with this different error. I am using my console to track all the logs. However, there are a lot of logs from different processes on my machine, are there any specific files / names / filters I should focus on? Sorry if this is a newbie question, I don't have much experience with tracking logs.
UPDATE: I just searched
mitmproxyand recorded all console logs from a working session withClient TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min optionerror, I will also post a log when it crashesFull Logs From MitmProxy
Full Logs From Console, From Starting Process to First Error
Bojun-Feng commentedon Oct 12, 2024
It crashed again on starting and I was able to grab the relevant console logs. Here is what it looks like in terminal:
Seems like the error stems from calling
NEFlowDirectorCreateInternalwith null input:Hopefully this helps! Please let me know if there are any other things I can do. I'm more than happy to help.
Full Logs From Console
mhils commentedon Oct 15, 2024
Your comment made me look into this again, the compatibility is now much improved on main via #7241. We'll ship a release soon. It is completely unrelated though. :)
The console logs look promising, thanks. I won't get to that in the short term, but it looks like we have some pointers there to figure out what's wrong in https://github.com/mitmproxy/mitmproxy_rs/tree/main/mitmproxy-macos/redirector.
mhils commentedon Oct 28, 2024
sureshdsk commentedon Mar 18, 2025
I'm also getting same error
It works if i don't pass the script.py. raises below error when using script.
redbeam commentedon Apr 2, 2025
As a quick workaround, killing the system extension helps. After running
mitmproxyagain, a new process is started and everything seems to work (for a while).sudo pkill -9 org.mitmproxy.macos-redirector.network-extensionngyngcphu commentedon Mar 3, 2026
Has this been resolved? I tried this way but still getting the same error. My
mitmproxyversion is 12.2.1