microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.29k stars 28.89k forks source link

Debugger issue: "Timed out waiting for debuggee to spawn" #186048

Closed eykamp closed 1 year ago

eykamp commented 1 year ago

We have written the needed data into your clipboard because it was too large to send. Please paste. Type: Bug

Behaviour

Expected vs. Actual

I expect to be able to debug a python script, as I've done hundreds of times. Instead I get a dialog box "Timed out waiting for debuggee to spawn". I've seen this before (not recently), but it seemed to resolve itself at some point. I don't know enough about the internals to make an educated guess as to what might be happening, or why it happened in the past, or why it resolved itself then.

Steps to reproduce:

Start with a new editor window; create the following python program:

print("234")
pass

Save. Press F5 to start debugger. See a terminal pane open (or get focus). See the normal commands get printed. Wait about 15 seconds. See message. Cry out in frustration.

Running this script by pressing Ctrl-Alt-N works, so I know on some level Python is hooked up.

After reading some possibly related cases, I turned on logging and the following three files got created. I'm not sure they're all relevant, but they're here:

debugger.vscode_7e11d670-43a4-4fc7-ab29-42db71b69a6e.log:

0 Starting Session:
{
    "logToFile": true,
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "C:\\dev\\HHHH\\delme.py",
    "console": "integratedTerminal",
    "justMyCode": false,
    "__configurationTarget": 6,
    "python": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
    "debugAdapterPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
    "debugLauncherPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
    "clientOS": "windows",
    "cwd": "c:\\dev\\HHHH",
    "envFile": "c:\\dev\\HHHH/.env",
    "env": {
        "PYTHONIOENCODING": "UTF-8",
        "PYTHONUNBUFFERED": "1"
    },
    "stopOnEntry": false,
    "showReturnValue": true,
    "internalConsoleOptions": "neverOpen",
    "debugOptions": [
        "DebugStdLib",
        "ShowReturnValue",
        "FixFilePathCase"
    ],
    "workspaceFolder": "c:\\dev\\HHHH"
}
1591 Client --> Adapter:
{
    "command": "initialize",
    "arguments": {
        "clientID": "vscode",
        "clientName": "Visual Studio Code",
        "adapterID": "python",
        "pathFormat": "path",
        "linesStartAt1": true,
        "columnsStartAt1": true,
        "supportsVariableType": true,
        "supportsVariablePaging": true,
        "supportsRunInTerminalRequest": true,
        "locale": "en",
        "supportsProgressReporting": true,
        "supportsInvalidatedEvent": true,
        "supportsMemoryReferences": true,
        "supportsArgsCanBeInterpretedByShell": true,
        "supportsMemoryEvent": true,
        "supportsStartDebuggingRequest": true
    },
    "type": "request",
    "seq": 1
}
5041 Client <-- Adapter:
{
    "seq": 1,
    "type": "event",
    "event": "output",
    "body": {
        "category": "telemetry",
        "output": "ptvsd",
        "data": {
            "packageVersion": "1.6.7"
        }
    }
}
5042 Client <-- Adapter:
{
    "seq": 2,
    "type": "event",
    "event": "output",
    "body": {
        "category": "telemetry",
        "output": "debugpy",
        "data": {
            "packageVersion": "1.6.7"
        }
    }
}
5047 Client <-- Adapter:
{
    "seq": 3,
    "type": "response",
    "request_seq": 1,
    "success": true,
    "command": "initialize",
    "body": {
        "supportsCompletionsRequest": true,
        "supportsConditionalBreakpoints": true,
        "supportsConfigurationDoneRequest": true,
        "supportsDebuggerProperties": true,
        "supportsDelayedStackTraceLoading": true,
        "supportsEvaluateForHovers": true,
        "supportsExceptionInfoRequest": true,
        "supportsExceptionOptions": true,
        "supportsFunctionBreakpoints": true,
        "supportsHitConditionalBreakpoints": true,
        "supportsLogPoints": true,
        "supportsModulesRequest": true,
        "supportsSetExpression": true,
        "supportsSetVariable": true,
        "supportsValueFormattingOptions": true,
        "supportsTerminateRequest": true,
        "supportsGotoTargetsRequest": true,
        "supportsClipboardContext": true,
        "exceptionBreakpointFilters": [
            {
                "filter": "raised",
                "label": "Raised Exceptions",
                "default": false,
                "description": "Break whenever any exception is raised."
            },
            {
                "filter": "uncaught",
                "label": "Uncaught Exceptions",
                "default": true,
                "description": "Break when the process is exiting due to unhandled exception."
            },
            {
                "filter": "userUnhandled",
                "label": "User Uncaught Exceptions",
                "default": false,
                "description": "Break when exception escapes into library code."
            }
        ],
        "supportsStepInTargetsRequest": true
    }
}
5165 Client --> Adapter:
{
    "command": "launch",
    "arguments": {
        "logToFile": true,
        "name": "Python: Current File",
        "type": "python",
        "request": "launch",
        "program": "C:\\dev\\HHHH\\delme.py",
        "console": "integratedTerminal",
        "justMyCode": false,
        "__configurationTarget": 6,
        "python": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
        "debugAdapterPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
        "debugLauncherPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
        "clientOS": "windows",
        "cwd": "c:\\dev\\HHHH",
        "envFile": "c:\\dev\\HHHH/.env",
        "env": {
            "PYTHONIOENCODING": "UTF-8",
            "PYTHONUNBUFFERED": "1"
        },
        "stopOnEntry": false,
        "showReturnValue": true,
        "internalConsoleOptions": "neverOpen",
        "debugOptions": [
            "DebugStdLib",
            "ShowReturnValue",
            "FixFilePathCase"
        ],
        "workspaceFolder": "c:\\dev\\HHHH",
        "__sessionId": "7e11d670-43a4-4fc7-ab29-42db71b69a6e"
    },
    "type": "request",
    "seq": 2
}
5194 Client <-- Adapter:
{
    "seq": 4,
    "type": "request",
    "command": "runInTerminal",
    "arguments": {
        "kind": "integrated",
        "title": "Python Debug Console",
        "args": [
            "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
            "c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0\\pythonFiles\\lib\\python\\debugpy\\adapter/../..\\debugpy\\launcher",
            "49983",
            "--",
            "C:\\dev\\HHHH\\delme.py"
        ],
        "env": {
            "DEBUGPY_LOG_DIR": "c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0"
        },
        "cwd": "c:\\dev\\HHHH"
    }
}
5269 Client --> Adapter:
{
    "type": "response",
    "seq": 3,
    "command": "runInTerminal",
    "request_seq": 4,
    "success": true,
    "body": {
        "shellProcessId": 13504
    }
}
26647 Client <-- Adapter:
{
    "seq": 5,
    "type": "response",
    "request_seq": 2,
    "success": false,
    "command": "launch",
    "message": "Timed out waiting for debuggee to spawn"
}
26772 Client --> Adapter:
{
    "command": "disconnect",
    "arguments": {
        "restart": false
    },
    "type": "request",
    "seq": 4
}
26950 Client <-- Adapter:
{
    "seq": 6,
    "type": "event",
    "event": "exited",
    "body": {
        "exitCode": 0
    }
}
26952 Client <-- Adapter:
{
    "seq": 7,
    "type": "event",
    "event": "terminated"
}
26953 Client <-- Adapter:
{
    "seq": 8,
    "type": "response",
    "request_seq": 4,
    "success": true,
    "command": "disconnect"
}
26965 Stopping Session
32587 Error:
{}
32595 Exit:
Exit-Code: 1
Signal: none

debugpy.adapter-10228.log

I+00000.125: Windows-10-10.0.19041-SP0 AMD64
             CPython 3.7.10 (64-bit)
             debugpy 1.6.7

I+00000.156: debugpy.adapter startup environment:

             System paths:
                 sys.executable: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\python.exe
                 sys.prefix: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                 sys.base_prefix: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                 sys.real_prefix: <missing>
                 site.getsitepackages(): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                                         C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\site-packages
                 site.getusersitepackages(): C:\Users\CE\AppData\Roaming\Python\Python37\site-packages
                 sys.path (site-packages): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\site-packages
                                           C:\Users\CE\AppData\Roaming\Python\Python37\site-packages
                 sysconfig.get_path('stdlib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib
                 sysconfig.get_path('platstdlib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib
                 sysconfig.get_path('purelib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib\site-packages
                 sysconfig.get_path('platlib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib\site-packages
                 sysconfig.get_path('include'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Include
                 sysconfig.get_path('scripts'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Scripts
                 sysconfig.get_path('data'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                 os.__file__: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\os.py
                 threading.__file__: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\threading.py
                 debugpy.__file__: c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\__init__.py(c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\__init__.py)

I+00000.172: Listening for incoming Client connections on 127.0.0.1:49981...

I+00000.188: Connecting to client over stdio...

D+00000.188: Starting message loop for channel Client[1]

D+00000.188: Client[1] <-- {
                 "seq": 1,
                 "type": "event",
                 "event": "output",
                 "body": {
                     "category": "telemetry",
                     "output": "ptvsd",
                     "data": {
                         "packageVersion": "1.6.7"
                     }
                 }
             }

D+00000.188: Client[1] <-- {
                 "seq": 2,
                 "type": "event",
                 "event": "output",
                 "body": {
                     "category": "telemetry",
                     "output": "debugpy",
                     "data": {
                         "packageVersion": "1.6.7"
                     }
                 }
             }

D+00000.188: Client[1] --> {
                 "seq": 1,
                 "type": "request",
                 "command": "initialize",
                 "arguments": {
                     "clientID": "vscode",
                     "clientName": "Visual Studio Code",
                     "adapterID": "python",
                     "pathFormat": "path",
                     "linesStartAt1": true,
                     "columnsStartAt1": true,
                     "supportsVariableType": true,
                     "supportsVariablePaging": true,
                     "supportsRunInTerminalRequest": true,
                     "locale": "en",
                     "supportsProgressReporting": true,
                     "supportsInvalidatedEvent": true,
                     "supportsMemoryReferences": true,
                     "supportsArgsCanBeInterpretedByShell": true,
                     "supportsMemoryEvent": true,
                     "supportsStartDebuggingRequest": true
                 }
             }

D+00000.203: /handling #1 request "initialize" from Client[1]/
             Capabilities: {
                 "supportsVariableType": true,
                 "supportsVariablePaging": true,
                 "supportsRunInTerminalRequest": true,
                 "supportsMemoryReferences": true,
                 "supportsArgsCanBeInterpretedByShell": true,
                 "supportsStartDebuggingRequest": true
             }

D+00000.203: /handling #1 request "initialize" from Client[1]/
             Expectations: {
                 "locale": "en",
                 "linesStartAt1": true,
                 "columnsStartAt1": true,
                 "pathFormat": "path"
             }

D+00000.203: /handling #1 request "initialize" from Client[1]/
             Client[1] <-- {
                 "seq": 3,
                 "type": "response",
                 "request_seq": 1,
                 "success": true,
                 "command": "initialize",
                 "body": {
                     "supportsCompletionsRequest": true,
                     "supportsConditionalBreakpoints": true,
                     "supportsConfigurationDoneRequest": true,
                     "supportsDebuggerProperties": true,
                     "supportsDelayedStackTraceLoading": true,
                     "supportsEvaluateForHovers": true,
                     "supportsExceptionInfoRequest": true,
                     "supportsExceptionOptions": true,
                     "supportsFunctionBreakpoints": true,
                     "supportsHitConditionalBreakpoints": true,
                     "supportsLogPoints": true,
                     "supportsModulesRequest": true,
                     "supportsSetExpression": true,
                     "supportsSetVariable": true,
                     "supportsValueFormattingOptions": true,
                     "supportsTerminateRequest": true,
                     "supportsGotoTargetsRequest": true,
                     "supportsClipboardContext": true,
                     "exceptionBreakpointFilters": [
                         {
                             "filter": "raised",
                             "label": "Raised Exceptions",
                             "default": false,
                             "description": "Break whenever any exception is raised."
                         },
                         {
                             "filter": "uncaught",
                             "label": "Uncaught Exceptions",
                             "default": true,
                             "description": "Break when the process is exiting due to unhandled exception."
                         },
                         {
                             "filter": "userUnhandled",
                             "label": "User Uncaught Exceptions",
                             "default": false,
                             "description": "Break when exception escapes into library code."
                         }
                     ],
                     "supportsStepInTargetsRequest": true
                 }
             }

D+00000.313: Client[1] --> {
                 "seq": 2,
                 "type": "request",
                 "command": "launch",
                 "arguments": {
                     "logToFile": true,
                     "name": "Python: Current File",
                     "type": "python",
                     "request": "launch",
                     "program": "C:\\dev\\HHHH\\delme.py",
                     "console": "integratedTerminal",
                     "justMyCode": false,
                     "__configurationTarget": 6,
                     "python": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "debugAdapterPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "debugLauncherPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "clientOS": "windows",
                     "cwd": "c:\\dev\\HHHH",
                     "envFile": "c:\\dev\\HHHH/.env",
                     "env": {
                         "PYTHONIOENCODING": "UTF-8",
                         "PYTHONUNBUFFERED": "1"
                     },
                     "stopOnEntry": false,
                     "showReturnValue": true,
                     "internalConsoleOptions": "neverOpen",
                     "debugOptions": [
                         "DebugStdLib",
                         "ShowReturnValue",
                         "FixFilePathCase"
                     ],
                     "workspaceFolder": "c:\\dev\\HHHH",
                     "__sessionId": "7e11d670-43a4-4fc7-ab29-42db71b69a6e"
                 }
             }

I+00000.328: /handling #2 request "launch" from Client[1]/
             Listening for incoming Server connections on 127.0.0.1:49982...

I+00000.344: /handling #2 request "launch" from Client[1]/
             Listening for incoming Launcher connections on 127.0.0.1:49983...

I+00000.344: /handling #2 request "launch" from Client[1]/
             Session[1] spawning launcher via "runInTerminal" request.

D+00000.344: /handling #2 request "launch" from Client[1]/
             Client[1] <-- {
                 "seq": 4,
                 "type": "request",
                 "command": "runInTerminal",
                 "arguments": {
                     "kind": "integrated",
                     "title": "Python Debug Console",
                     "args": [
                         "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                         "c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0\\pythonFiles\\lib\\python\\debugpy\\adapter/../..\\debugpy\\launcher",
                         "49983",
                         "--",
                         "C:\\dev\\HHHH\\delme.py"
                     ],
                     "env": {
                         "DEBUGPY_LOG_DIR": "c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0"
                     },
                     "cwd": "c:\\dev\\HHHH"
                 }
             }

D+00000.422: Client[1] --> {
                 "seq": 3,
                 "type": "response",
                 "request_seq": 4,
                 "success": true,
                 "command": "runInTerminal",
                 "body": {
                     "shellProcessId": 13504
                 }
             }

I+00005.485: Accepted incoming Launcher connection from 127.0.0.1:49985.

D+00005.500: Starting message loop for channel Launcher[1]

D+00005.500: /handling #2 request "launch" from Client[1]/
             Launcher[1] <-- {
                 "seq": 1,
                 "type": "request",
                 "command": "launch",
                 "arguments": {
                     "logToFile": true,
                     "name": "Python: Current File",
                     "type": "python",
                     "request": "launch",
                     "program": "C:\\dev\\HHHH\\delme.py",
                     "console": "integratedTerminal",
                     "justMyCode": false,
                     "__configurationTarget": 6,
                     "python": [
                         "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe"
                     ],
                     "debugAdapterPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "debugLauncherPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "clientOS": "windows",
                     "cwd": "c:\\dev\\HHHH",
                     "envFile": "c:\\dev\\HHHH/.env",
                     "env": {
                         "PYTHONIOENCODING": "UTF-8",
                         "PYTHONUNBUFFERED": "1"
                     },
                     "stopOnEntry": false,
                     "showReturnValue": true,
                     "internalConsoleOptions": "neverOpen",
                     "debugOptions": [
                         "DebugStdLib",
                         "ShowReturnValue",
                         "FixFilePathCase"
                     ],
                     "workspaceFolder": "c:\\dev\\HHHH",
                     "__sessionId": "7e11d670-43a4-4fc7-ab29-42db71b69a6e",
                     "pythonArgs": [],
                     "processName": "C:\\dev\\HHHH\\delme.py",
                     "port": 49982,
                     "adapterAccessToken": "967bac54d3832cd2cddd418595f485225129e8f503b2104aa5d26a3527ec59cb"
                 }
             }

D+00006.750: Launcher[1] --> {
                 "seq": 1,
                 "type": "event",
                 "event": "process",
                 "body": {
                     "startMethod": "launch",
                     "isLocalProcess": true,
                     "systemProcessId": 13436,
                     "name": "C:\\dev\\HHHH\\delme.py",
                     "pointerSize": 64
                 }
             }

D+00006.766: Launcher[1] --> {
                 "seq": 2,
                 "type": "response",
                 "request_seq": 1,
                 "success": true,
                 "command": "launch"
             }

D+00006.766: /handling #1 event "process" from Launcher[1]/
             Propagation deferred.

I+00006.766: /handling #2 request "launch" from Client[1]/
             Session[1] waiting for connection from debug server...

I+00021.781: All debug servers disconnected; waiting for remaining sessions...

E+00021.797: /handling #2 request "launch" from Client[1]/
             Traceback (most recent call last):
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\messaging.py", line 1015, in __init__
                 raise self
             debugpy.common.messaging.MessageHandlingError: Timed out waiting for debuggee to spawn

             Stack where logged:
               File "C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\threading.py", line 890, in _bootstrap
                 self._bootstrap_inner()
               File "C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\threading.py", line 926, in _bootstrap_inner
                 self.run()
               File "C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\threading.py", line 870, in run
                 self._target(*self._args, **self._kwargs)
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\messaging.py", line 1458, in _run_handlers
                 handler()
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\messaging.py", line 701, in _handle
                 result = handler(self)
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\adapter\components.py", line 91, in lock_and_handle
                 return f(self, message)
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\adapter\clients.py", line 221, in handle
                 f(self, request)
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\adapter\clients.py", line 427, in launch_request
                 sudo,
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\adapter\launchers.py", line 187, in spawn_debuggee
                 raise start_request.cant_handle("Timed out waiting for debuggee to spawn")
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\messaging.py", line 525, in cant_handle
                 return self.error(MessageHandlingError, *args, **kwargs)
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\messaging.py", line 513, in error
                 exc = exc_type(reason, self, silent)  # will log it
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\messaging.py", line 1017, in __init__
                 log.swallow_exception()
               File "c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\common\log.py", line 215, in swallow_exception
                 _exception(format_string, *args, **kwargs)

D+00021.797: /handling #2 request "launch" from Client[1]/
             Client[1] <-- {
                 "seq": 5,
                 "type": "response",
                 "request_seq": 2,
                 "success": false,
                 "command": "launch",
                 "message": "Timed out waiting for debuggee to spawn"
             }

E+00021.828: /handling #2 request "launch" from Client[1]/
             Handler 'Client._start_message_handler.<locals>.handle' (file 'c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0\\pythonFiles\\lib\\python\\debugpy\\adapter/../..\\debugpy\\adapter\\components.py', line 205)
             couldn't handle #2 request "launch" from Client[1]:
             Timed out waiting for debuggee to spawn

D+00021.922: Client[1] --> {
                 "seq": 4,
                 "type": "request",
                 "command": "disconnect",
                 "arguments": {
                     "restart": false
                 }
             }

I+00021.922: /handling #4 request "disconnect" from Client[1]/
             client requested "disconnect"; finalizing Session[1].

D+00021.922: /handling #4 request "disconnect" from Client[1]/
             Launcher[1] <-- {
                 "seq": 2,
                 "type": "request",
                 "command": "terminate"
             }

D+00021.922: Launcher[1] --> {
                 "seq": 3,
                 "type": "response",
                 "request_seq": 2,
                 "success": true,
                 "command": "terminate"
             }

I+00021.922: /handling #4 request "disconnect" from Client[1]/
             Session[1] waiting for Launcher[1] to disconnect...

D+00022.094: Launcher[1] --> {
                 "seq": 4,
                 "type": "event",
                 "event": "exited",
                 "body": {
                     "exitCode": 0
                 }
             }

D+00022.094: Launcher[1] --> {
                 "seq": 5,
                 "type": "event",
                 "event": "terminated"
             }

D+00022.094: /handling #5 event "terminated" from Launcher[1]/
             Client[1] <-- {
                 "seq": 6,
                 "type": "event",
                 "event": "exited",
                 "body": {
                     "exitCode": 0
                 }
             }

D+00022.094: /handling #5 event "terminated" from Launcher[1]/
             Closing Launcher[1] message stream

D+00022.094: Exiting message loop for channel Launcher[1]: [WinError 10038] An operation was attempted on something that is not a socket

D+00022.110: /handling #4 request "disconnect" from Client[1]/
             Client[1] <-- {
                 "seq": 7,
                 "type": "event",
                 "event": "terminated"
             }

I+00022.110: /handling #4 request "disconnect" from Client[1]/
             Session[1] finalized.

D+00022.110: /handling #4 request "disconnect" from Client[1]/
             Client[1] <-- {
                 "seq": 8,
                 "type": "response",
                 "request_seq": 4,
                 "success": true,
                 "command": "disconnect"
             }

I+00022.110: /handling #4 request "disconnect" from Client[1]/
             Client[1] disconnected from stdio; closing remaining server connections.

debugpy.launcher-20740.log


I+00000.157: Windows-10-10.0.19041-SP0 AMD64
             CPython 3.7.10 (64-bit)
             debugpy 1.6.7

I+00000.188: debugpy.launcher startup environment:

             System paths:
                 sys.executable: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\python.exe
                 sys.prefix: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                 sys.base_prefix: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                 sys.real_prefix: <missing>
                 site.getsitepackages(): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                                         C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\site-packages
                 site.getusersitepackages(): C:\Users\CE\AppData\Roaming\Python\Python37\site-packages
                 sys.path (site-packages): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\site-packages
                                           C:\Users\CE\AppData\Roaming\Python\Python37\site-packages
                 sysconfig.get_path('stdlib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib
                 sysconfig.get_path('platstdlib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib
                 sysconfig.get_path('purelib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib\site-packages
                 sysconfig.get_path('platlib'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Lib\site-packages
                 sysconfig.get_path('include'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Include
                 sysconfig.get_path('scripts'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\Scripts
                 sysconfig.get_path('data'): C:\Users\CE\AppData\Local\ESRI\conda\envs\dev
                 os.__file__: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\os.py
                 threading.__file__: C:\Users\CE\AppData\Local\ESRI\conda\envs\dev\lib\threading.py
                 debugpy.__file__: c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy\__init__.py(c:\Users\CE\.vscode\extensions\ms-python.python-2023.8.0\pythonFiles\lib\python\debugpy\__init__.py)

I+00000.188: sys.argv before parsing: ['c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0\\pythonFiles\\lib\\python\\debugpy\\adapter/../..\\debugpy\\launcher', '49983', '--', 'C:\\dev\\HHHH\\delme.py']

I+00000.188: sys.argv after patching: ['c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0\\pythonFiles\\lib\\python\\debugpy\\adapter/../..\\debugpy\\launcher', 'C:\\dev\\HHHH\\delme.py']

I+00000.188: Connecting to adapter at 127.0.0.1:49983

D+00000.219: Starting message loop for channel Adapter

D+00000.219: Adapter --> {
                 "seq": 1,
                 "type": "request",
                 "command": "launch",
                 "arguments": {
                     "logToFile": true,
                     "name": "Python: Current File",
                     "type": "python",
                     "request": "launch",
                     "program": "C:\\dev\\HHHH\\delme.py",
                     "console": "integratedTerminal",
                     "justMyCode": false,
                     "__configurationTarget": 6,
                     "python": [
                         "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe"
                     ],
                     "debugAdapterPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "debugLauncherPython": "C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe",
                     "clientOS": "windows",
                     "cwd": "c:\\dev\\HHHH",
                     "envFile": "c:\\dev\\HHHH/.env",
                     "env": {
                         "PYTHONIOENCODING": "UTF-8",
                         "PYTHONUNBUFFERED": "1"
                     },
                     "stopOnEntry": false,
                     "showReturnValue": true,
                     "internalConsoleOptions": "neverOpen",
                     "debugOptions": [
                         "DebugStdLib",
                         "ShowReturnValue",
                         "FixFilePathCase"
                     ],
                     "workspaceFolder": "c:\\dev\\HHHH",
                     "__sessionId": "7e11d670-43a4-4fc7-ab29-42db71b69a6e",
                     "pythonArgs": [],
                     "processName": "C:\\dev\\HHHH\\delme.py",
                     "port": 49982,
                     "adapterAccessToken": "967bac54d3832cd2cddd418595f485225129e8f503b2104aa5d26a3527ec59cb"
                 }
             }

I+00000.219: /handling #1 request "launch" from Adapter/
             Spawning debuggee process:

             Command line: ['C:\\Users\\CE\\AppData\\Local\\ESRI\\conda\\envs\\dev\\python.exe', 'c:\\Users\\CE\\.vscode\\extensions\\ms-python.python-2023.8.0\\pythonFiles\\lib\\python\\debugpy\\adapter/../..\\debugpy\\launcher/../..\\debugpy', '--connect', '127.0.0.1:49982', '--configure-qt', 'none', '--adapter-access-token', '967bac54d3832cd2cddd418595f485225129e8f503b2104aa5d26a3527ec59cb', 'C:\\dev\\HHHH\\delme.py']

             Environment variables: XXX REDACTED XXX

I+00001.469: /handling #1 request "launch" from Adapter/
             Spawned Debuggee[PID=13436].

D+00001.469: /handling #1 request "launch" from Adapter/
             Adapter <-- {
                 "seq": 1,
                 "type": "event",
                 "event": "process",
                 "body": {
                     "startMethod": "launch",
                     "isLocalProcess": true,
                     "systemProcessId": 13436,
                     "name": "C:\\dev\\HHHH\\delme.py",
                     "pointerSize": 64
                 }
             }

D+00001.485: /handling #1 request "launch" from Adapter/
             Adapter <-- {
                 "seq": 2,
                 "type": "response",
                 "request_seq": 1,
                 "success": true,
                 "command": "launch"
             }

D+00016.641: Adapter --> {
                 "seq": 2,
                 "type": "request",
                 "command": "terminate"
             }

D+00016.641: /handling #2 request "terminate" from Adapter/
             Adapter <-- {
                 "seq": 3,
                 "type": "response",
                 "request_seq": 2,
                 "success": true,
                 "command": "terminate"
             }

I+00016.641: /handling #2 request "terminate" from Adapter/
             Killing Debuggee[PID=13436]

I+00016.813: Debuggee[PID=13436] exited with code 0

D+00016.813: Adapter <-- {
                 "seq": 4,
                 "type": "event",
                 "event": "exited",
                 "body": {
                     "exitCode": 0
                 }
             }

D+00016.813: Adapter <-- {
                 "seq": 5,
                 "type": "event",
                 "event": "terminated"
             }

D+00016.813: Exiting message loop for channel Adapter: No more messages

D+00016.813: Closing Adapter message stream

I+00016.813: Not logging to "<stderr>" anymore.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` XXX ```

User Settings

``` languageServer: "Pylance" linting • flake8Args: "" • flake8Enabled: true formatting • autopep8Args: "" • provider: "black" ```

VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z) OS version: Windows_NT x64 10.0.19044 Modes: Sandboxed: Yes

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (6 x 2592)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.76GB (19.02GB free)| |Process Argv|--crash-reporter-id e1e7d685-ffab-41ed-83b8-7d2c21f43013| |Screen Reader|no| |VM|0%|
Extensions (66) Extension|Author (truncated)|Version ---|---|--- increment-selection|alb|0.2.0 Bookmarks|ale|13.3.1 arepl|alm|2.0.5 armview|ben|0.4.6 markdown-checkbox|bie|0.4.0 vscode-toggle-quotes|Bri|0.3.6 insert-unicode|bru|0.14.0 vscode-better-align|cho|1.4.2 vscode-sql-beautify|cla|0.3.19 rainbow-highlighter|cob|0.1.0 gitlens|eam|14.0.1 vs-code-xml-format|fab|0.1.5 vscode-diff|fab|1.4.2 vscode-open-in-github|fab|1.3.0 url-encode|fle|1.1.0 code-runner|for|0.12.0 todo-tree|Gru|0.0.226 timing|Haa|2.7.2 vscode-test-explorer|hbe|2.21.1 beautify|Hoo|1.5.0 rest-client|hum|0.25.1 vscode-peacock|joh|4.2.2 vscode-position|jtr|1.1.2 vscode-python-test-adapter|lit|0.7.1 MagicPython|mag|1.1.0 rainbow-csv|mec|3.7.0 git-graph|mhu|1.30.0 vscode-deploy-reloaded|mkl|0.89.0 csharp|ms-|1.26.0 vscode-dotnet-runtime|ms-|1.6.0 isort|ms-|2022.8.0 python|ms-|2023.8.0 vscode-pylance|ms-|2023.6.30 jupyter|ms-|2023.5.1101742258 jupyter-keymap|ms-|1.1.2 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 remote-ssh|ms-|0.102.0 remote-ssh-edit|ms-|0.86.0 cpptools|ms-|1.16.2 remote-explorer|ms-|0.4.0 sublime-keybindings|ms-|4.0.10 test-adapter-converter|ms-|0.1.8 vscode-progressive-increment|nar|1.0.5 vetur|oct|0.37.3 indent-rainbow|ode|8.3.1 quicktype|qui|12.0.46 sqlite-viewer|qwt|0.2.5 vscode-data-preview|Ran|2.3.0 command-variable|rio|1.53.0 rubberduck-vscode|rub|1.15.0 partial-diff|ryu|1.4.3 text-marker|ryu|1.11.0 multi-command|ryu|1.6.0 incremental-search|sie|0.2.1 vscode-fileutils|sle|3.10.1 rewrap|stk|1.16.3 mako|tom|0.2.0 pdf|tom|1.2.2 selectline-statusbar|tom|0.0.2 sort-lines|Tyr|1.10.1 gistfs|vsl|0.4.1 debug|web|0.26.1 cursor-align|yo1|1.1.0 multi-cursor-search|yo1|2.1.0 markdown-all-in-one|yzh|3.5.1
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263cf:30773604 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 pynewext54:30695312 azure-dev_surveyonecf:30548226 vsccc:30610678 2e4cg342:30602488 pyind779:30671433 f6dab269:30613381 pythonsymbol12:30671437 showlangstatbar:30737416 vsctsb:30748421 pythonms35:30701012 03d35959:30757346 pythonfmttext:30731395 pythoncmv:30756943 fixshowwlkth:30771522 pythongtdpath:30769146 dh2dc718:30770000 pythonidxptcf:30772540 pythondjangots:30772535 ```
VSCodeTriageBot commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.79.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

eykamp commented 1 year ago

I tried with 1.79.2, and had the same problem. I read that other users had experienced the same thing I did so I downgraded. That did not fix the issue, sadly.

gjsjohnmurray commented 1 year ago

Did you try downgrading the Python extension?

eykamp commented 1 year ago

Is there any way to increase the timeout to see if it's just that something is really slow to get going?

eykamp commented 1 year ago

Interesting. I've been pressing a lot of buttons, so I'm not sure this is it, but it appears that the problem is only present when I'm running the local-user version of code; I can resolve the problem by installing and running non-user "standard" version.

Things are working for me now, so I'm going to close this, but maybe this will be helpful to someone else.