Closed region-spotteR closed 3 months ago
2 issues :
{
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
"adapters": {
"python-remote-docker": {
"variables": {
"port": "8764"
},
"port": "${port}",
"launch": {
"remote": {
"container": "${ContainerID}",
"runCommand": [
"python3", "-m", "debugpy", "--listen", "0.0.0.0:${port}",
"--wait-for-client",
"%CMD%"
]
},
"delay": "5000m"
}
}
},
"configurations": {
"docker-pytest": {
"variables": {
"remoteWorkDir": "/code/app",
"filepath": "test_fastapi_example.py"
},
"adapter": "python-remote-docker",
"remote-cmdLine": ["-m", "pytest", "${remoteWorkDir}/${filepath}" ],
"remote-request": "launch",
"configuration": {
"request": "attach",
"pathMappings": [
{
"localRoot": "${workspaceRoot}",
"remoteRoot": "${remoteWorkDir}"
}
]
}
}
}
}
Description
I would like to use Vimspector in a new project which uses docker containers for debugging. I adapted the stuff in the
simple_python
until I could reproduce the issue (description below). The issue appeared after I added the mount command (-v ./:/code/app
). Before that I added theremoteWorkDir
-variable to the config and I think it was working. Since I added the mount, it doesn't go away even though I removed the mount, removed the volumes. It keeps having this issue with the header values.Is it reproducible in vim?
Reproducible in Vim
Works with clean config?
Yes
Sample project works?
Reproducible with sample project
Minimal Reproduction
List of steps to reproduce:
/path/to/vimspector/support/test/python/simple_python
fastapi_example.py
from the documentation heretest_fastapi_example.py
from the documentation hereWORKDIR /code RUN mkdir /code/app | pip install --no-cache-dir --upgrade fastapi debugpy httpx pytest
ADD main.py /root/main.py
ADD fastapi_example.py /code/app/fastapi_example.py ADD test_fastapi_example.py /code/app/test_fastapi_example.py CMD ["fastapi", "run", "app/fastapi_example.py", "--port", "8765"]
Error detected while processing function32__OnServerData:
line 6:
Traceback (most recent call last):
File "", line 1, in
File "/Users//Documents/repos/vimspector/python3/vimspector/debug_session.py", line 558, in OnChannelData
self._connection.OnData( data )
File "/Users//Documents/repos/vimspector/python3/vimspector/debug_adapter_connection.py", line 183, in OnData
self._ReadHeaders()
File "/Users//Documents/repos/vimspector/python3/vimspector/debug_adapter_connection.py", line 223, in _ReadHeaders
key, value = str( header_line, 'utf-8' ).split( ':', 1 )
^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
Channel closed
2024-05-14 08:11:28,398 - INFO - debug_session.py:226 - 0 - User requested start debug session with {} 2024-05-14 08:11:28,401 - DEBUG - debug_session.py:187 - 0 - Reading configurations from: None 2024-05-14 08:11:28,401 - DEBUG - debug_session.py:187 - 0 - Reading configurations from: /Users/moritzb/Documents/repos/vimspector/support/test/python/simple_python/.vimspector.json 2024-05-14 08:11:28,472 - DEBUG - debug_session.py:250 - 0 - Reading gadget config: /Users/moritzb/Documents/repos/vimspector/gadgets/macos/.gadgets.json 2024-05-14 08:11:28,472 - DEBUG - debug_session.py:250 - 0 - Reading gadget config: None 2024-05-14 08:11:34,682 - DEBUG - utils.py:633 - None - Returning filepath from the map for filepath with args () 2024-05-14 08:11:34,682 - DEBUG - utils.py:633 - None - Returning remoteWorkDir from the map for remoteWorkDir with args () 2024-05-14 08:11:34,682 - DEBUG - utils.py:633 - None - Returning filepath from the map for filepath with args () 2024-05-14 08:11:34,682 - DEBUG - utils.py:633 - None - Returning workspaceRoot from the map for workspaceRoot with args () 2024-05-14 08:11:34,682 - DEBUG - utils.py:633 - None - Returning remoteWorkDir from the map for remoteWorkDir with args () 2024-05-14 08:11:34,682 - DEBUG - utils.py:633 - None - Returning port from the map for port with args () 2024-05-14 08:11:35,465 - DEBUG - utils.py:714 - None - Value for ContainerID not set in ${ContainerID} (from ${ContainerID}): set to fastapi_example 2024-05-14 08:11:35,465 - DEBUG - utils.py:633 - None - Returning ContainerID from the map for ContainerID with args () 2024-05-14 08:11:35,465 - DEBUG - utils.py:633 - None - Returning port from the map for port with args () 2024-05-14 08:11:35,465 - INFO - debug_session.py:485 - 0 - Configuration: {"adapter": "python-remote-docker", "remote-cmdLine": ["-m", "pytest", "app/test_fastapi_example.py"], "remote-request": "launch", "configuration": {"request": "attach", "module": "pytest", "type": "debugpy", "cwd": "/code", "args": ["app/test_fastapi_example.py"], "pathMappings": [{"localRoot": "/Users/moritzb/Documents/repos/vimspector/support/test/python/simple_python", "remoteRoot": "/code"}]}} 2024-05-14 08:11:35,465 - INFO - debug_session.py:487 - 0 - Adapter: {"port": "8765", "launch": {"remote": {"container": "fastapi_example", "runCommand": ["python3", "-m", "debugpy", "--listen", "0.0.0.0:8765", "--wait-for-client", "%CMD%"]}, "delay": "5000m"}} 2024-05-14 08:11:35,466 - DEBUG - debug_session.py:1203 - 0 - min_width/height: 149/50, actual: 337/43 - result: horizontal 2024-05-14 08:11:35,477 - DEBUG - debug_session.py:1787 - 0 - LAUNCH! 2024-05-14 08:11:35,477 - DEBUG - debug_session.py:1657 - 0 - Running remote app: ['docker', 'exec', '-t', 'fastapi_example', 'python3', '-m', 'debugpy', '--listen', '0.0.0.0:8765', '--wait-for-client', '-m', 'pytest', 'app/test_fastapi_example.py'] 2024-05-14 08:11:40,488 - INFO - debug_session.py:1402 - 0 - Starting debug adapter with: {"port": "8765", "launch": {"remote": {"container": "fastapi_example", "runCommand": ["python3", "-m", "debugpy", "--listen", "0.0.0.0:8765", "--wait-for-client", "%CMD%"]}, "delay": "5000m"}} 2024-05-14 08:11:40,488 - DEBUG - debug_session.py:1421 - 0 - Connection Type: channel 2024-05-14 08:11:51,279 - ERROR - debug_session.py:1466 - 0 - Unable to start debug server 2024-05-14 08:11:51,280 - INFO - debug_session.py:509 - 0 - Failed to launch or attach to the debug adapter 2024-05-14 08:12:21,795 - DEBUG - debug_session.py:620 - 0 - Stop debug adapter with callback: _Reset 2024-05-14 08:12:21,796 - INFO - debug_session.py:662 - 0 - Debugging complete. 2024-05-14 08:12:21,796 - DEBUG - debug_session.py:665 - 0 - Clearing down UI 2024-05-14 08:12:23,730 - INFO - debug_session.py:226 - 0 - User requested start debug session with {} 2024-05-14 08:12:23,731 - DEBUG - debug_session.py:187 - 0 - Reading configurations from: None 2024-05-14 08:12:23,732 - DEBUG - debug_session.py:187 - 0 - Reading configurations from: /Users/moritzb/Documents/repos/vimspector/support/test/python/simple_python/.vimspector.json 2024-05-14 08:12:23,807 - DEBUG - debug_session.py:250 - 0 - Reading gadget config: /Users/moritzb/Documents/repos/vimspector/gadgets/macos/.gadgets.json 2024-05-14 08:12:23,807 - DEBUG - debug_session.py:250 - 0 - Reading gadget config: None 2024-05-14 08:12:26,970 - DEBUG - utils.py:633 - None - Returning filepath from the map for filepath with args () 2024-05-14 08:12:26,971 - DEBUG - utils.py:633 - None - Returning remoteWorkDir from the map for remoteWorkDir with args () 2024-05-14 08:12:26,971 - DEBUG - utils.py:633 - None - Returning filepath from the map for filepath with args () 2024-05-14 08:12:26,971 - DEBUG - utils.py:633 - None - Returning workspaceRoot from the map for workspaceRoot with args () 2024-05-14 08:12:26,971 - DEBUG - utils.py:633 - None - Returning remoteWorkDir from the map for remoteWorkDir with args () 2024-05-14 08:12:26,971 - DEBUG - utils.py:633 - None - Returning port from the map for port with args () 2024-05-14 08:12:28,206 - DEBUG - utils.py:714 - None - Value for ContainerID not set in ${ContainerID} (from ${ContainerID}): set to fastapi_example 2024-05-14 08:12:28,206 - DEBUG - utils.py:633 - None - Returning ContainerID from the map for ContainerID with args () 2024-05-14 08:12:28,206 - DEBUG - utils.py:633 - None - Returning port from the map for port with args () 2024-05-14 08:12:28,207 - INFO - debug_session.py:485 - 0 - Configuration: {"adapter": "python-remote-docker", "remote-cmdLine": ["-m", "pytest", "app/test_fastapi_example.py"], "remote-request": "launch", "configuration": {"request": "attach", "module": "pytest", "type": "debugpy", "cwd": "/code", "args": ["app/test_fastapi_example.py"], "pathMappings": [{"localRoot": "/Users/moritzb/Documents/repos/vimspector/support/test/python/simple_python", "remoteRoot": "/code"}]}} 2024-05-14 08:12:28,207 - INFO - debug_session.py:487 - 0 - Adapter: {"port": "8765", "launch": {"remote": {"container": "fastapi_example", "runCommand": ["python3", "-m", "debugpy", "--listen", "0.0.0.0:8765", "--wait-for-client", "%CMD%"]}, "delay": "5000m"}} 2024-05-14 08:12:28,208 - DEBUG - debug_session.py:1203 - 0 - min_width/height: 149/50, actual: 337/43 - result: horizontal 2024-05-14 08:12:28,223 - DEBUG - debug_session.py:1787 - 0 - LAUNCH! 2024-05-14 08:12:28,223 - DEBUG - debug_session.py:1657 - 0 - Running remote app: ['docker', 'exec', '-t', 'fastapi_example', 'python3', '-m', 'debugpy', '--listen', '0.0.0.0:8765', '--wait-for-client', '-m', 'pytest', 'app/test_fastapi_example.py'] 2024-05-14 08:12:33,235 - INFO - debug_session.py:1402 - 0 - Starting debug adapter with: {"port": "8765", "launch": {"remote": {"container": "fastapi_example", "runCommand": ["python3", "-m", "debugpy", "--listen", "0.0.0.0:8765", "--wait-for-client", "%CMD%"]}, "delay": "5000m"}} 2024-05-14 08:12:33,235 - DEBUG - debug_session.py:1421 - 0 - Connection Type: channel 2024-05-14 08:12:44,022 - ERROR - debug_session.py:1466 - 0 - Unable to start debug server 2024-05-14 08:12:44,022 - INFO - debug_session.py:509 - 0 - Failed to launch or attach to the debug adapter 2024-05-14 08:14:00,337 - DEBUG - debug_session.py:620 - 0 - Stop debug adapter with callback: _Reset 2024-05-14 08:14:00,338 - INFO - debug_session.py:662 - 0 - Debugging complete. 2024-05-14 08:14:00,338 - DEBUG - debug_session.py:665 - 0 - Clearing down UI
Python version
No response
Neovim diagnostics
No response
Operating System
MacOs
Declaration