New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launching python script inside docker container fails with "No such container" error #478
Comments
Did you start the image, i.e. does the container actually exist? As the docs say, I may be wrong, but that was the usage I have experience with so it might unblock you until you get a better answer |
The container to run in has to already be running and you supply the container ID. |
I think I have enough to go on now that the contributor's guide from the issue template lead me to find this example project which does work with docker on my system. Sorry for the noise, but that documentation page is really the problem. It should just link to support/test/python/simple_python rather than presenting an unclear vimspector config that clearly contains various mistakes, with no instructions on how it should be used. |
Contributions to improve the documentation are always welcome. |
I'm still trying to get the support/test/python/simple_python docker configuration working. It seems from @mark2185 's comment and the .vimspector.json file only containing a About that arbitrary command; I am trying to write a
Any ideas? |
it does absolutely support doing that, that's what this is all about:
the 'docker-attach' in that file is actually a 'launch' - you can see that in "remote-request = launch". anyway it works fine for me. Instructions:
meanwhile, run vim, hit F5, select docker-attach and enter SIMPLE_PYTHON as the container ID. demo: |
What |
For posterity, here is a conversation about a similar topic attaching to a running Django in a container: https://gitter.im/vimspector/Lobby?at=616d749eee6c260cf7262fcb |
Describe the bug
In trying to follow [this Docker example] from Vimspector's configuration documentation page, and after fixing a few obvious mistakes in that configuration, launch still does not work even for a trivial python script inside of Docker, exiting with status 1 and message: "Error: no such container: [whatever you entered for container]"
Minimal reproduciton
vim --clean -Nu /path/to/vimspector/support/minimal_vimrc
? For nvim, yes. For vim, it gives this exact error instead. This is probably unrelated and I don't care about that since I use Neovim myself.Note that container and port can be anything you choose, as I'm expecting launch to launch a new container, so long as the connecting part executes in the same container that was spawned everything should work fine.
I copied the vimspector config from the documentation example, just adding comma's where necessary, on lines 26 and 65.
Expected behaviour
I expected the launch command to start debugpy's execution of script.py within a newly spun-up docker container, and then for vimspector to connect to that process so that debugging can commence.
Actual behaviour
Vimspector tab opens with all the default windows, and a message is shown in the middle of the screen "Initializing debug adapter". After 10 attempts are made to connect, it stops and the error: "No such container: anything" is shown in the output window.
Environemnt
NOTE: NeoVim is supported only on a best-effort basis. Please check the README
for limitations of neovim. Don't be offended if I ask you to reproduce issues in
Vim.
NOTE: Windows support is experimental and best-effort only. If you find an
issue related to Windows or windows-isms, consider sending a PR or
discussing on Gitter rather than raising an issue.
git rev-parse HEAD
if cloned or thename of the tarball used to install otherwise)
:VimspectorDebugInfo
vim --version
ornvim --version
which vim
orwhich nvim
::py3 print( __import__( 'sys' ).version )
::py3 import vim
::py3 import vimspector
:Note the previous two are empty, they return nothing at all.
:checkhealth
Declaration
Additional information
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: