The remote debugging auto-disconnects immediately on Mac
OS: M1(Pro) Build Version: 20220726.5
Repro Steps:
- Open a python project in VS Code -> Add docker files to it.
- Right click .debug.yml file -> Compose Up.
- Open the launch.json file -> Add a new "Python Remote Attach" configuration.
- Navigate to "Run and Debug" view -> Select "Python: Remote Attach" -> F5.
- Check whether succeeds to remote debug the python project.
Expect: Succeed to remote debug the python project.
Actual: The remote debugging auto-disconnects immediately.
More Info: This issue doesn't reproduce on Windows and Linux.
This might be an M1-only issue. @v-xinda, can you try this on an Intel Mac if possible?
I was able to test on my Intel Mac, and the issue did not reproduce. I'll see if I can test on M1.
I was able to make this Flask-based tutorial work on my M1 Mac, as well as another FastApi-based sample (with a base image quirk that had a different symptom but was ultimately successful).
@v-xinda If you still repro this issue, it'd be good to attach the Python project source as there's so many different flavors, it makes reproduction difficult.
@philliphoff @bwateratmsft Python project source as below: flask_project.zip
@v-xinda I was able to successfully attach and debug using that sample project on my M1 Mac. What port were you choosing for running the app/container? If 5000 (which tends to be the default for Flask), you could end up colliding with an Apple service running on the machine (AirPlay, which uses the same port).
@philliphoff The default port is 5002, but this issue also reproduces if I change the port to 3000 when remote debugging the flask_project project.
We'll close this for now and see if any customers reproduce it.