Skip to content
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

Python Debugger: "Timed out waiting for launcher to connect" #1677

Open
MJ1Peter opened this issue Jun 8, 2024 · 16 comments
Open

Python Debugger: "Timed out waiting for launcher to connect" #1677

MJ1Peter opened this issue Jun 8, 2024 · 16 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@MJ1Peter
Copy link

MJ1Peter commented Jun 8, 2024

Having an issue working in VSCode (Version: 1.90.0) using Python 3.12.2 on Mac. Program (below) runs just fine from the terminal:

Program

import sys

print (len(sys.argv))
print (sys.argv)
if  len(sys.argv) < 3:
    print("specify <sheet-name> <operation> where operation is 'create', 'insert', show' or 'delete'")
    sys.exit(1)
        
print("argument list:", str(sys.argv))
sheetname =  sys.argv[1]
operation =  sys.argv[2]

From terminal

petermelo@Peters-MacBook-Pro Code % python3 -V 
Python 3.12.2
petermelo@Peters-MacBook-Pro Code % python3 Test3.py 
1
['Test3.py']
specify <sheet-name> <operation> where operation is 'create', 'insert', show' or 'delete'
petermelo@Peters-MacBook-Pro Code % 

However, when I try to debug it from VSCode I get the following:
Image 6-8-24 at 10 19 AM

This is the config for launch.json im using:

`{

// 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 Debugger: Current File (Integrated Terminal)",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
          }
]

}`

@MJ1Peter
Copy link
Author

MJ1Peter commented Jun 8, 2024

I would also add that this runs no problem on Linux.

@paulacamargo25
Copy link

Thanks for your bug report, could you send me the logs of the Python Debugger extension?

@MJ1Peter
Copy link
Author

@paulacamargo25
Copy link

Sorry for the delay in responding and thanks for the information, I will try to reproduce the bug.

@MJ1Peter
Copy link
Author

MJ1Peter commented Aug 6, 2024

Following back up on this, any update?

@paulacamargo25
Copy link

Thanks for reporting the bug, and sorry for the delay. I tried it on a Mac and it's working for me. Can you try again with the latest version of the Python Debugger extension and the latest version of VSCode? If the error persists, can you send me the Python Debugger output logs?

Copy link

Hey @karthiknadig, this issue might need further attention.

@MJ1Peter, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@ErideDLF
Copy link

ErideDLF commented Sep 11, 2024

I’m encountering a timeout issue when debugging Python tests in VSCode after updating to the latest version. My launch.json was working perfectly until a couple of days ago, but now it’s failing with the same timeout error.

Here’s the launch.json configuration I’m using:

{
  // 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": "Jira_id",
      "type": "debugpy",
      "request": "launch",
      "cwd": "${workspaceFolder}/_test/acceptance/src/",
      "module": "behave",
      "env": {
        "PYTHONPATH": "${workspaceFolder}/_test/acceptance/src"
      },
      "console": "integratedTerminal",
      "args": [
        "${file}",
        "-t",
        "@jira.${selectedText}",
        "--no-skipped",
        "-D",
        "TestExecution_environment=local_es"
      ],
      "stopOnEntry": false,
      "justMyCode": false,
      "logToFile": true
    }
  ]
}

The logs after attempting to execute are as follows:
debugpy.adapter-43236.log
debugger.vscode_a19536a8-b7ff-4432-865a-59075c481480.log

When running the following commands manually in the terminal, everything works fine:

behave /Users/cx02460/Documents/Development/wallet-core/_test/acceptance/src/features/api/0-component/01-transactions_api/014-operations_b2m/tasks/process_inactive_accounts_kyc/success.feature -t @jira.QAWLLT-2044 --no-skipped -D TestExecution_environment=local_es

python -m debugpy --listen 5678 -m behave /Users/cx02460/Documents/Development/wallet-core/_test/acceptance/src/features/api/0-component/01-transactions_api/014-operations_b2m/tasks/process_inactive_accounts_kyc/success.feature -t @jira.QAWLLT-2044 --no-skipped -D TestExecution_environment=local_es

However, when pointing to the debugpy launcher file, I get the following error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/cx02460/.vscode/extensions/ms-python.debugpy-2024.11.2024082901-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/__main__.py", line 91, in <module>
    main()
  File "/Users/cx02460/.vscode/extensions/ms-python.debugpy-2024.11.2024082901-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/__main__.py", line 47, in main
    launcher.connect(host, port)
  File "/Users/cx02460/.vscode/extensions/ms-python.debugpy-2024.11.2024082901-darwin-arm64/bundled/libs/debugpy/launcher/../../debugpy/launcher/__init__.py", line 27, in connect
    sock.connect((host, port))
ConnectionRefusedError: [Errno 61] Connection refused

I am completely stuck and unsure of the next steps to resolve this issue. Any assistance would be greatly appreciated.

@iliagerman
Copy link

Im also having the same timeout issue, not sure how to fix this

@goldengrisha
Copy link

A temporary fix can be a change in a launch.json: "console": "internalConsole".

@oscles
Copy link

oscles commented Sep 12, 2024

A temporary fix can be a change in a launch.json: "console": "internalConsole".

working for me

@MovingLive
Copy link

A temporary fix can be a change in a launch.json: "console": "internalConsole".

working for me too. Thanks!
@VSCodeTriageBot CodeIssue?

@BohdanKostivKrootl
Copy link

Hey, I'm having the same issue
Changing "console" configuration parameter to "internalConsole" or "externalTerminal" works
Seems like the Internal Terminal is the issue, hope to see it fixed, thanks!

@ErideDLF
Copy link

Thank you for your suggestion. I was able to get it working by setting "console": "internalConsole". This prevents the timeout error and opens the debug console, which is definitely an improvement. However, when I set breakpoints, the debugger only stops at some of them, and not others.

It's better than not being able to launch at all, but it’s still not a complete solution. I hope this can be resolved fully. Thanks again for your help!

@Lucashygi
Copy link

Lucashygi commented Sep 16, 2024

@ErideDLF, I'm encountering the same error. Everything worked fine until two weeks ago, but now it only works when setting "console": "internalConsole."
Unfortunately, the internal console is much less effective than the previous one.
This issue seems to be related to the Integrated Console, but it doesn't appear to be specific to the ZSH or Bash terminal on macOS.

I hope it gets fixed soon.

@nleroy917
Copy link

Also suddenly started having this issue about a week ago...

Unfortunately, the internal console is much less effective than the previous one.

I agree with this, and I also would really hope for a fix soon too.

@karthiknadig karthiknadig removed their assignment Sep 18, 2024
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python-debugger Sep 18, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests