AlansCodeLog/blender-debugger-for-vscode

VsCode: connect ECONNREFUSED 127.0.0.1:5678 when trying to start debuging

Lehong-Wang opened this issue · 3 comments

OS: Mac Big Sur

Add-on Version: 2.0.0

Blender Version: 2.90.0

VS Code Version: 1.67.2

VS Code Python Extension Version: 2022.6.2

One of the following two depending on which version of the addon you're using (2.0+ uses debugpy instead of ptvsd):

  • ptvsd version:
  • debugpy version: 1.6.0

Paths listed by where python or the corresponding command:
/Users/lhwang/.pyenv/shims/python
Does VS Code / Visual Studio connect to the troubleshooting script?
No. It shows waiting
Python path/interpreter detected/selected by VS Code/Visual Studio:
/Users/lhwang/.pyenv/versions/3.7.10/bin/python3.7

Notes:

I tried to connect VsCode with Blender

I ran the Debug: Start Debug Server for VS Code command in blender, and it prints out:
Blender quit
Server already running.
Waiting... (on port 5678)
Waiting... (on port 5678)

Then I go to VsCode, created a launch.json file, and this is my lauch.json file:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Attach",
      "type": "python",
      "request": "attach",
      "port": 5678, //careful, this used to be 3000 in older versions of vscode and this addon
      "host": "localhost"
    }
  ]
}

I hit start debugging, and VsCode gave me this message: "connect ECONNREFUSED 127.0.0.1:5678"

Blender is still waiting when I got this message.
I really don't know how to solve this, can someone help me with this?

Thanks

I just spotted an error in the test script I published, I had forgotten to change the port. Sorry about that. Can you please retry with the test script?

Otherwise everything looks fine.

Hi, I also have the same issue when trying to start debugging. VSCode can connect to the test.py script, but not to Blender - giving an 'ECONNREFUSED 127.0.0.1:5678' error.

OS: Windows 10

Add-on Version: 2.2.1

Blender Version: 2.90.1

VS Code Version: 1.75.0

VS Code Python Extension Version: 2023.2.0

debugpy version: 1.6.6

Both the blender addon + vscode use python from a conda environment with debugpy installed:
~\anaconda3\envs\debugpy\python.exe

Thanks for your help!

Hmm very strange. Can you please open a new issue. I will take a look when I can.