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

Debugger throws exception before hitting first line of code #2499

Closed
HughGrovesArup opened this issue Sep 6, 2018 · 10 comments
Closed

Debugger throws exception before hitting first line of code #2499

HughGrovesArup opened this issue Sep 6, 2018 · 10 comments
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@HughGrovesArup
Copy link

Environment data

  • VS Code version: 1.27.0 (user setup)
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 4.2.0 (64-bit) Python 3.6.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: n/a

Actual behavior

Debugger does not start. Given file does run as a python file (no exceptions).

Expected behavior

Debugging session starts

Steps to reproduce:

  1. Press F5 to start debugging file on network drive

Logs

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

PS C:\Users\Hugh.Groves> cd '\\global.arup.com\americas\Jobs\STJ\230000\230597-00(ACDO)\4-04 Engineering\4-04-02 Concrete\02 Calculations\19 Staged Construction\99-Tools\CreateBatches'; ${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFNIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; ${env:PYTHONPATH}='c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd'; & 'C:\Users\Hugh.Groves\AppDthon.exe' '-m' 'ptvsd' '--host' 'localhoata\Local\Continuum\Anaconda3\envs\p3\python.exe' '-m' 'ptvsd' '--host' 'localhost' '--port' '53026' '\\global.arup.com\americas\Jobs\STJ\230000\230597-00(ACDO)\4-04 Engineering\4-04-02 Concrete\02 Calculations\19 Staged Construction\99-Tools\CreateBatches\CreateBatches_02.py'
Traceback (most recent call last):
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1254, in done
    fut.result()
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 40, in result
    reraise(self._exc_info)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\reraise3.py", line 8, in reraise
    raise exc_info[1].with_traceback(exc_info[2])
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 155, in callback
    x = it.send(fut.result())
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1605, in on_stackTrace
    norm_path = self.path_casing.un_normcase(unquote(str(xframe['file'])))  # noqa
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 30, in un_normcase
    file_path_to_return = self._get_actual_filename(file_path)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 60, in _get_actual_filename
    fragments += ["{}[{}]".format(d[:-1], d[-1])]
IndexError: string index out of range
Traceback (most recent call last):
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1254, in donetal\ptvsd\ptvsd\wrapper.py", line 1254, in done
    fut.result()                                                                               tal\ptvsd\ptvsd\futures.py", line 40, in result
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 40, in result                                                tal\ptvsd\ptvsd\reraise3.py", line 8, in reraise
    reraise(self._exc_info)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 155, in callbacktal\ptvsd\ptvsd\reraise3.py", line 8, in reraise
    raise exc_info[1].with_traceback(exc_info[2])
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 155, in callback    x = it.send(fut.result())
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1605, in on_stackTrace
    norm_path = self.path_casing.un_normcase(unquote(str(xframe['file'])))  # noqa  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 30, in un_normcase
    file_path_to_return = self._get_actual_filename(file_path)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 60, in _get_actual_filename    fragments += ["{}[{}]".format(d[:-1], d[-1])]
IndexError: string index out of range

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

 INFO no standard startup: not the explorer viewlet
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
309C:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-textmate\release\main.js:2924 [4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping
scanNext @ C:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-textmate\release\main.js:2924
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
446C:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-textmate\release\main.js:2924 [4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping
scanNext @ C:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\vscode-textmate\release\main.js:2924
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276
/C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1)
@DonJayamanne
Copy link

@HughGrovesArup
The issue has been resolved. Please could you test this against our latest development version of the extension. Instructions for installing the dev version of the extension can be found here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build

Please feel free to re-open the issue if the issue persists, or just ping us here and we'll open it.

@HughGrovesArup
Copy link
Author

I've tried the new version and get this error dialog box popup:

image

Nothing abnormal is displayed in the terminal.

The developer console shows this:

INFO no standard startup: not just one text editor /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1) t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 [Extension Host] ApplicationInsights:Sender Array(1) t.log @ /C:/Users/Hugh.Groves/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:276 console.ts:136 [Extension Host] ApplicationInsights:Sender [{…}] t.log @ console.ts:136 t._logExtensionHostMessage @ extensionHost.ts:412 (anonymous) @ extensionHost.ts:224 emitTwo @ events.js:126 emit @ events.js:214 emit @ internal/child_process.js:772 _combinedTickCallback @ internal/process/next_tick.js:141 _tickCallback @ internal/process/next_tick.js:180 console.ts:136 [Extension Host] ApplicationInsights:Sender [{…}] t.log @ console.ts:136 t._logExtensionHostMessage @ extensionHost.ts:412 (anonymous) @ extensionHost.ts:224 emitTwo @ events.js:126 emit @ events.js:214 emit @ internal/child_process.js:772 _combinedTickCallback @ internal/process/next_tick.js:141 _tickCallback @ internal/process/next_tick.js:180

@DonJayamanne DonJayamanne reopened this Sep 28, 2018
@DonJayamanne
Copy link

Please could you try debugging a simple process for with a for loop.
Endure the file is in a folder in your local drive, such a C:\temp.

@HughGrovesArup
Copy link
Author

HughGrovesArup commented Sep 28, 2018

Tried a simple for loop in C:/temp, got the same error.

@DonJayamanne
Copy link

This is interesting, that's not the error you received in the past. In the past it was an error in the debugger, now you aren't even able to launch the debugger (i.e. it cannot connect to it due to a socket connection issue).
Has something changed since then, e.g. permissions/firewalls, etc.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs upstream fix labels Sep 28, 2018
@HughGrovesArup
Copy link
Author

HughGrovesArup commented Sep 28, 2018

Yes it's odd - I'm sorry I can't provide any more details.

Nothing has changed that I am aware of.

Is there anywhere else I can look to provide more details?

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Oct 1, 2018
@DonJayamanne
Copy link

Yes, please install Live Share extension and send me your time zone. Let's try to look at this together.

@DonJayamanne
Copy link

@HughGrovesArup

  • When you get the above Timeout error, please could you take a screen shot of the terminal window. I'd like to see what in there.
  • Finally, please could you try running the python file using Run python file in terminal command from the command palette.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels Oct 2, 2018
@HughGrovesArup
Copy link
Author

So I seem to have to hit each of those commands twice. The first call just launches powershell, and then it does the actual command?

This is what my screne looks like after hitting debug (twice):

image

This is what my screen looks like after doing 'run python file in terminal' (twice):

image

@DonJayamanne
Copy link

Closing as a duplicate of #2732

@lock lock bot locked as resolved and limited conversation to collaborators Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants