Skip to content

Task failed: redirect daemon exited prematurely. #6950

Open

Description

@linuxlin365

Problem Description

Start the agent in local mode. After running for a while, the Task failed: redirect daemon exited prematurely. disabled backtrace message is displayed and windows-redirector.exe exits

Steps to reproduce the behavior:

  1. Start mitmdump mitmdump -m local -k --allow-hosts 10.26.18.149
  2. Run for a while

System Information

Mitmproxy: 10.3.1 binary
Python: 3.12.3
OpenSSL: OpenSSL 3.2.2 4 Jun 2024
Platform: Windows-11-10.0.22631-SP0

Activity

  1. added
    kind/triage
    on Jun 24, 2024
  2. mhils commented on Jun 26, 2024

    @mhils
    Member

    Thank you for the report. Do you have any better ideas how this can be reproduced? What happens if you run it with a RUST_BACKTRACE env var set to 1?

  3. linuxlin365 commented on Jun 27, 2024

    @linuxlin365
    Author

    [17:05:26.054] Task failed: redirect daemon exited prematurely.
    0: PyInit_pyo3_asyncio
    1: PyInit_pyo3_asyncio
    2: PyInit_mitmproxy_rs
    3:
    4:
    5: PyInit_pyo3_asyncio
    6: PyInit_pyo3_asyncio
    7: PyInit_pyo3_asyncio
    8: PyInit_pyo3_asyncio
    9: PyInit_pyo3_asyncio
    10: BaseThreadInitThunk
    11: RtlUserThreadStart

    image

    Why are there so many DNS connections?

  4. mhils commented on Jun 28, 2024

    @mhils
    Member

    Thanks! This looks good and bad at the same time - it looks like the redirect task is crashing, but we don't capture the process output from that. This is something we need to fix.

  5. DokiDoki1103 commented on Dec 19, 2024

    @DokiDoki1103

    我也遇到了相同的问题,是在捕获本地应用程序时候只要一开启就报错

  6. DokiDoki1103 commented on Dec 19, 2024

    @DokiDoki1103

    [22:52:40.183] HTTP(S) proxy listening at *:8080.
    [22:52:40.187] Web server listening at http://127.0.0.1:8081/
    [22:52:44.613][127.0.0.1:53992] client connect
    [22:52:45.318] Local redirector started.
    [22:52:45.482] Task failed: redirect daemon exited prematurely.

    Stack backtrace:
    0: PyInit_pyo3_asyncio
    1: PyInit_pyo3_asyncio
    2:
    3:
    4: PyInit_pyo3_asyncio
    5: PyInit_pyo3_asyncio
    6: PyInit_pyo3_asyncio
    7: PyInit_pyo3_asyncio
    8: PyInit_pyo3_asyncio
    9: ExitProcess
    10: ExitProcess
    11: ZwWaitLowEventPair
    0: PyInit_pyo3_asyncio
    1: PyInit_pyo3_asyncio
    2:
    3:
    4: PyInit_pyo3_asyncio
    5: PyInit_pyo3_asyncio
    6: PyInit_pyo3_asyncio
    7: PyInit_pyo3_asyncio
    8: PyInit_pyo3_asyncio
    9: ExitProcess
    10: ExitProcess
    11: ZwWaitLowEventPair

    [22:52:45.878][127.0.0.1:53992] server connect functional.events.data.microsoft.com:443 (20.189.173.9:443)
    [22:52:54.266][127.0.0.1:53994] client connect
    [22:52:55.584][127.0.0.1:53994] server connect assets.msn.cn:443 (95.100.74.231:443)

  7. Ran-Mewo commented on Jun 17, 2025

    @Ran-Mewo

    i get this whenever I try to capture local applications

    [16:45:42.148] HTTP(S) proxy listening at *:8080.
    [16:45:42.168] Web server listening at http://127.0.0.1:8081/?token=b161849d23e689077145a496d51ae993
    [16:45:49.519] Local redirector started.
    [16:45:49.640] Task failed: redirect daemon exited prematurely.
    
    Stack backtrace:
       0: PyInit_pyo3_async_runtimes
       1: tree_sitter_xml
       2: <unknown>
       3: <unknown>
       4: PyInit_pyo3_async_runtimes
       5: PyInit_pyo3_async_runtimes
       6: PyInit_pyo3_async_runtimes
       7: PyInit_pyo3_async_runtimes
       8: PyInit_pyo3_async_runtimes
       9: BaseThreadInitThunk
      10: RtlUserThreadStart
       0: PyInit_pyo3_async_runtimes
       1: tree_sitter_xml
       2: <unknown>
       3: <unknown>
       4: PyInit_pyo3_async_runtimes
       5: PyInit_pyo3_async_runtimes
       6: PyInit_pyo3_async_runtimes
       7: PyInit_pyo3_async_runtimes
       8: PyInit_pyo3_async_runtimes
       9: BaseThreadInitThunk
      10: RtlUserThreadStart
    
  8. alexdunae commented on Jul 9, 2025

    @alexdunae

    Same error for me - this is running on Windows in a Parallels VM, so maybe an unsupported configuration?

    [10:52:25.764] Local redirector started.
    [10:52:25.767] Web server listening at http://127.0.0.1:8081/?token=df08c32a976ed9167a6f9d6122a75117
    [10:52:25.855] Task failed: failed to propagate interception config update
    
    Caused by:
        The pipe is being closed. (os error 232)
    
    Stack backtrace:
       0: PyInit_pyo3_async_runtimes
       1: <unknown>
       2: <unknown>
       3: PyInit_pyo3_async_runtimes
       4: PyInit_pyo3_async_runtimes
       5: PyInit_pyo3_async_runtimes
       6: PyInit_pyo3_async_runtimes
       7: PyInit_pyo3_async_runtimes
       8: ExitProcess
       9: ExitProcess
      10: <unknown>
       0: PyInit_pyo3_async_runtimes
       1: <unknown>
       2: <unknown>
       3: PyInit_pyo3_async_runtimes
       4: PyInit_pyo3_async_runtimes
       5: PyInit_pyo3_async_runtimes
       6: PyInit_pyo3_async_runtimes
       7: PyInit_pyo3_async_runtimes
       8: ExitProcess
       9: ExitProcess
      10: <unknown>
    
  9. lior-ps commented on Aug 27, 2025

    @lior-ps

    @mhils is local mode supported on Windows Arm?

  10. tarasHQ commented on Nov 19, 2025

    @tarasHQ

    I'm way out of my league here, but maybe it'll be helpful. Initially everything was running perfectly, then I installed mitmproxy into system's python venv and started to getting those errors (Task failed: redirect daemon exited prematurely, though, I didn't have stack backtrace)
    Then I did
    pip show mitmproxy
    and removed every single dependancy. Now everything works perfectly .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions