Skip to content

Could not extract BSD name from mount point #7807

Closed

Description

@Urie96

Problem Description

A clear and concise description of what the bug is.

When editing the request, nothing happened. After exiting mitmproxy, the error logs were printed.

$ mitmproxy
Can't statfs , failed with error -1
Could not extract BSD name from mount point 
$ 

However, editing the response worked normally.

System Information

Mitmproxy: 12.1.1
Python:    3.13.5
OpenSSL:   OpenSSL 3.5.1 1 Jul 2025
Platform:  macOS-14.7-arm64-arm-64bit-Mach-O

Checklist

Activity

  1. added
    kind/triage
    on Jul 21, 2025
  2. mhils commented on Aug 3, 2025

    @mhils
    Member

    Thank you for your report. No idea what's going on here. Can you run mitmproxy with strace? Or maybe RUST_LOG=TRACE mitmdump -vvv?

  3. Urie96 commented on Aug 4, 2025

    @Urie96
    Author

    Can you run mitmproxy with strace? Or maybe RUST_LOG=TRACE mitmdump -vvv?

    I tried RUST_LOG=TRACE mitmproxy -vvv, but the output was identical to what I’d already seen—no extra details appeared.

    I’ve now found that the crash only happens when the request body contains Chinese characters.
    For example, with this curl command mitmproxy refuses to let me edit the request (the response also contains Chinese, yet the response can be edited without issue):

    curl --proxy http://localhost:8080 -H "Content-Type: application/json" -d '{"key":"你好"}' https://httpbin.org/post

    With this curl command everything works fine:

    curl --proxy http://localhost:8080 -H "Content-Type: application/json" -d '{"key":"hello"}' https://httpbin.org/post
    $ /nix/store/nwval4ssnqfxmsivfkpbyzp6glr72vwz-python3.13-mitmproxy-12.1.1/bin/mitmproxy --version
    Mitmproxy: 12.1.1
    Python:    3.13.5
    OpenSSL:   OpenSSL 3.5.1 1 Jul 2025
    Platform:  macOS-14.7-arm64-arm-64bit-Mach-O

    When I install mitmproxy via Homebrew the behavior is different: I cannot edit requests or responses even when they contain no Chinese characters. In this case the Events tab shows the following traceback:

    info: [13:08:10.625] HTTP(S) proxy listening at *:8080.
    info: [13:08:15.490][[::1]:59401] client connect
    info: [13:08:15.761][[::1]:59401] server connect httpbin.org:443 (35.174.89.159:443)
    info: [13:08:16.702][[::1]:59401] client disconnect
    info: [13:08:16.702][[::1]:59401] server disconnect httpbin.org:443 (35.174.89.159:443)
    error: [13:08:19.239] Unhandled error in task.
    Traceback (most recent call last):
      File "asyncio/events.py", line 89, in _run
      File "urwid/event_loop/asyncio_loop.py", line 104, in wrapper
      File "urwid/display/_posix_raw_display.py", line 285, in wrapper
      File "urwid/display/_raw_display_base.py", line 488, in parse_input
      File "urwid/event_loop/main_loop.py", line 466, in _update
      File "urwid/event_loop/main_loop.py", line 566, in process_input
      File "mitmproxy/tools/console/window.py", line 302, in keypress
      File "urwid/widget/frame.py", line 526, in keypress
      File "urwid/widget/widget.py", line 729, in keypress
      File "mitmproxy/tools/console/window.py", line 43, in keypress
      File "urwid/widget/frame.py", line 526, in keypress
      File "urwid/widget/overlay.py", line 571, in keypress
      File "mitmproxy/tools/console/overlay.py", line 140, in keypress
      File "mitmproxy/tools/console/keymap.py", line 163, in handle
      File "mitmproxy/tools/console/commandexecutor.py", line 17, in __call__
      File "mitmproxy/command.py", line 292, in execute
      File "mitmproxy/command.py", line 280, in call_strings
      File "mitmproxy/command.py", line 149, in call
      File "mitmproxy/command.py", line 322, in wrapper
      File "mitmproxy/tools/console/consoleaddons.py", line 187, in nav_select
      File "mitmproxy/tools/console/master.py", line 201, in inject_key
      File "urwid/event_loop/main_loop.py", line 566, in process_input
      File "mitmproxy/tools/console/window.py", line 302, in keypress
      File "urwid/widget/frame.py", line 526, in keypress
      File "urwid/widget/widget.py", line 729, in keypress
      File "mitmproxy/tools/console/window.py", line 43, in keypress
      File "urwid/widget/frame.py", line 526, in keypress
      File "urwid/widget/overlay.py", line 571, in keypress
      File "mitmproxy/tools/console/overlay.py", line 130, in keypress
      File "mitmproxy/tools/console/consoleaddons.py", line 274, in callback
      File "mitmproxy/command.py", line 280, in call_strings
      File "mitmproxy/command.py", line 149, in call
      File "mitmproxy/command.py", line 322, in wrapper
      File "mitmproxy/tools/console/consoleaddons.py", line 512, in edit_focus
      File "<frozen _collections_abc>", line 811, in get
      File "mitmproxy/contentviews/_registry.py", line 70, in __getitem__
    AttributeError: 'NoneType' object has no attribute 'lower'
    
    $ /opt/homebrew/bin/mitmproxy --version
    Mitmproxy: 12.0.0 binary
    Python:    3.13.3
    OpenSSL:   OpenSSL 3.4.1 11 Feb 2025
    Platform:  macOS-14.7-arm64-arm-64bit-Mach-O
  4. mhils commented on Aug 4, 2025

    @mhils
    Member
    $ /opt/homebrew/bin/mitmproxy --version
    Mitmproxy: 12.0.0 binary
    

    This is outdated.

  5. mhils commented on Aug 4, 2025

    @mhils
    Member

    I can reproduce this with the cURL request you posted though. Alternative repro:

    mitmproxy -nr repro.mitm
    

    Edit -> request body

    repro.mitm.zip

  6. added and removed
    kind/triage
    on Aug 4, 2025
  7. caiquejjx commented on Oct 25, 2025

    @caiquejjx
    Contributor

    I checked this and there are two issues:
    1 - It mistakes the request body data as binary due to the chinese chars, which I fixed in this pr
    2 - It uses bless as hexeditor because macos has it's own bless binary but it's not a hex editor which causes the weird error messages:

    > man bless | head
    BLESS(8)                    System Manager's Manual                   BLESS(8)
    
    NAME
         bless – set volume bootability and startup disk options
    
    SYNOPSIS
         bless --help
    
         bless --folder directory [--file file] [--bootefi [file]]
               [--label name | --labelfile file] [--setBoot] [--nextonly]
    

    About the second issue I guess it should be addressed in another pr and my simplest idea would be to check if the which response contains /sbin which is the case of macos bless since it's a system binary, lmk what you think and i can also fix it

  8. mhils commented on Oct 27, 2025

    @mhils
    Member

    About the second issue I guess it should be addressed in another pr and my simplest idea would be to check if the which response contains /sbin which is the case of macos bless since it's a system binary, lmk what you think and i can also fix it

    I'd be fine with just removing bless of the supported list of hex editors. Do you want to send a PR? :)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions