Replies: 15 comments
-
I tried it out with mostly the same stuff you have (albeit once on Windows and once in Linux Codespaces) and was successful. Is there a Python interpreter selected in the lower left? Is there any difference in the output if you do:
vs.
Compose debugging is an alternative but I'm not sure if hot reloading will work. In the {
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Thanks! Do you mean the python version on the host machine?
That's an anaconda installation. Once I press F5 it also shows this python version Interestingly I also got the option to pick this "geoserver conda" version (geoserver is my project) and no idea where that comes from: EDIT: OK the following happened because I added a workspace OK found this #2327 - removed the workspace again (created it today because I wanted to ship the final thing to the client as a workspace, but fine without it as well). |
Beta Was this translation helpful? Give feedback.
-
@int19h I forgot how to turn on the extra diagnostics so we could see what's happening with Python debug--can you remind us? |
Beta Was this translation helpful? Give feedback.
-
So as I see it, it doesn't run my task at all. At least it outputs it nowhere.
Output etc. all empty. EDIT: Also interesting: when I go to the docker tab and right-click the container and try "show logs" or "attach shell" it prints the command in the terminal but never get a response Inspect works and opens a new file with the results. Running docker logs from my regular linux terminal shows me that the "dummy" interpreter is running:
|
Beta Was this translation helpful? Give feedback.
-
Yeah, I've seen that behavior--where the |
Beta Was this translation helpful? Give feedback.
-
TODO: @bwateratmsft Will make a small prototype of a flask app that does not emit an output to find a debugging issue. |
Beta Was this translation helpful? Give feedback.
-
Quick info from my side: meanwhile setup up Windows with WSL2 based docker and it worked without any issues or modifications. |
Beta Was this translation helpful? Give feedback.
-
We just released extension version 1.10.0, which included some changes in this space to make WSL debugging work better. Are you on 1.10.0 now (for that attempt on Windows where it worked)? Can you try again on Linux with 1.10.0 and see if there's any change? |
Beta Was this translation helpful? Give feedback.
-
Windows is running 1.10.0, although I'm not fully sure if it did an auto-update since I tested it a few days ago. |
Beta Was this translation helpful? Give feedback.
-
Hey @m-toman, sorry for the slow response, we've been super busy lately. We met with the Python debugger folks and they had a few things to try out. Meanwhile, they've opened microsoft/debugpy#579.
|
Beta Was this translation helpful? Give feedback.
-
Thanks, good timing as I am likely back working on the service next week. |
Beta Was this translation helpful? Give feedback.
-
OK I quickly tried it, @bwateratmsft debugger.vscode_9e59d0c5-6125-4204-a225-7e99e0a97300.log |
Beta Was this translation helpful? Give feedback.
-
@int19h Nothing sticks out to me in those logs; there isn't any error similar to what we tried yesterday. Any ideas? |
Beta Was this translation helpful? Give feedback.
-
I'm going to convert this to a discussion. As far as we can tell there's not a bug in the Docker extension; and microsoft/debugpy/issues/579 has been opened in debugpy. I'd still like to get to the bottom of what's happening, though. |
Beta Was this translation helpful? Give feedback.
-
Was this issue ever resolved? I am experiencing the identical problem on MacOS. |
Beta Was this translation helpful? Give feedback.
-
/Hi,
I've encountered the same issue as in #2313 and was not able to resolve it yet.
I am also on Linux but running a Flask app in a docker container.
Followed along https://code.visualstudio.com/docs/containers/debug-python#_for-flask-apps and ended up with:
launch.json
tasks.json
When I run the container with F5 it just seems it just runs the "dummy" python interpreter but not actually the flask app.
If I exec -it /bin/bash into the container and run "python -m flask run --host 0.0.0.0 --port 8090" I can connect to the service and it works fine (of course without debugging).
Outputs:
Output: empty
Debug console: empty
Terminal 1: empty
Terminal 2:
Terminal 3 (Python Debug Console): empty
At first I did not use docker-compose, after reading a few issues here I added the files as following and performed "compose up" on docker-compose.debug and then F5, but same result:
Do I need docker compose?
If I run "compose up" it just gives me
Pushing the restart button gives me "There is already a debug configuration "Docker: Python - Flask" running.
Pushing stop seems to stop whatever it is doing in VS code but the docker container is still running (probably supposedly so?)
docker inspect bridge --format="{{(index .IPAM.Config 0).Gateway}}"
gives me
172.17.0.1
And docker inspect:
Thanks!
EDIT: Dev.Dockerfile:
EDIT2:
ping 172.17.0.1 and ping 172.17.0.2 works.
Beta Was this translation helpful? Give feedback.
All reactions