question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

map-local not working in 5.3.0

See original GitHub issue

Problem Description

We use mitmproxy locally to replay backend queries made from frontend. After updating from 5.2 to 5.3.0 every command that has the --map-local options seems to work otherwise correctly but mitmproxy seems to completely ignore the --map-local part when replaying. On startup mitmproxy does validate that the local resource is present so it doesn’t completely ignore the option but it never actually seems to use it. The replay command that we use also has flows that are replayed and that part does work as intended. But even if we leave the flows out of the command and only use --map-local command the local resource is not served.

Steps to reproduce the behavior:

  1. Make a local resource file (local.json) and, optionally, prepare a flows file (mitmproxy-flows)
  2. Choose a server you are trying to mimick with replay
  3. Run command mitmdump --mode reverse:http://localhost:8910/ -S mitmproxy-flows --server-replay-nopop --server-replay-refresh --listen-port 7777 --map-local "|~m GET|localhost:8910/api/resource|local.json"
  4. Try to go to URL http://localhost:7777/api/resource

System Information

WORKING version info is:

Mitmproxy: 5.2 binary
Python:    3.7.8
OpenSSL:   OpenSSL 1.1.1g  21 Apr 2020
Platform:  Darwin-19.6.0-x86_64-i386-64bit

(note that I used the macOS binaries here when testing with 5.2 but it was also working with 5.2 installed with homebrew)

NOT WORKING version info is:

Mitmproxy: 5.3.0
Python:    3.9.0
OpenSSL:   OpenSSL 1.1.1h  22 Sep 2020
Platform:  macOS-10.15.7-x86_64-i386-64bit

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mhilscommented, Dec 10, 2020

This is fixed on master now, updated binaries should appear at https://mitmproxy.org/downloads/#branches/master/ in the next 15 minutes. 😃

0reactions
Krakaucommented, Dec 11, 2020

I confirm that the fixed version is working! Thanks!

And you are correct in that there are alternatives to homebrew. Thankfully. What I meant was that on the mitmproxy website the homebrew version is the advertised way to use mitmproxy and this case just showed that it is also the most fragile way to use mitmproxy (unable to change the version and you are stuck with what it gives you). Someone who is not tech-savvy might reject mitmproxy as an option if it does not work the way intended without looking for alternative ways to use the application. But this is not your fault and was just a sidetracked comment. So nevermind that and the main point is that the bug is fixed and will work in the future 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - Self-referential use of unordered_map causes problems ...
The issue seems to come down to libstdc++ using an __gnu_cxx::__aligned_buffer in its hash map implementation, which needs a complete type. Both ...
Read more >
5.3.0.x Limitations and known issues for IBM Spectrum Control
One way of mapping a drive as the local system user is to map the drive from a psexec command window. The psexec...
Read more >
vector tiles - Does OpenLayers 4.6.5 (or latest 5.3.0) support ...
I have been setting up my own MVT-service, which takes some GeoJSON input and convert it to MVT tiles. Then I've used Open...
Read more >
House Committee on Local Government
Site Map · Contact Us · Find Your Legislator · Accessibility · Agency Reports Portal · in.gov · Find an Agency · Find...
Read more >
MAPS Release Documentation - Evisions Help
Added support for IP Restrictions for IPv6 addresses. Resolved Issues: Microsoft OLE DB Driver 18 for SQL Server was failing to save Driver...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found