Skip to content

SSL error when 'run in terminal' but not when run via anaconda prompt #10015

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

Closed
HughGrovesArup opened this issue Feb 10, 2020 · 4 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@HughGrovesArup
Copy link

Environment data

  • VS Code version: 1.42.0
  • Extension version (available under the Extensions sidebar): 2020.1.58038
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.7.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: urllib3
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): jedi=true
  • Value of the python.languageServer setting: ?

Expected behaviour

Script should run with no errors. This is true for the same environment when run from anaconda prompt.

Actual behaviour

When run with 'run python file in terminal' I get an SSL exception (below).

Will this possibly be fixed with #5559?

Logs

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

Traceback (most recent call last):
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\urllib3\connectionpool.py", line 654, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\urllib3\connectionpool.py", line 274, in _get_conn
    return conn or self._new_conn()
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\urllib3\connectionpool.py", line 964, in _new_conn
    "Can't connect to HTTPS URL because the SSL module is not available."
urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\requests\adapters.py", line 449, in send
    timeout=timeout
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\urllib3\util\retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='compute.rhino3d.com', port=443): Max retries exceeded with url: /rhino/geometry/mesh/createfrombrep-brep (Caused by SSLError("Can't connect to HTTPS URL because the SSL module isan't connect to HTTPS URL because the SSL module is not available."))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/Hugh.Groves/Documents/VS_Code_Projects/RhinoComputePyTest/rcpyt.py", line 9, in <module>
    meshes = compute_rhino3d.Mesh.CreateFromBrep(brep)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\compute_rhino3d\Mesh.py", line 407, in CreateFromBrep
    response = Util.ComputeFetch(url, args)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\compute_rhino3d\Util.py", line 31, in ComputeFetch
    r = requests.post(posturl, data=postdata, headers=headers)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\requests\api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\requests\api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\requests\sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\requests\sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\Hugh.Groves\AppData\Local\Continuum\Anaconda3\envs\rhinocompute\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='compute.rhino3d.com', port=443): Max retries exceeded with url: /rhino/geometry/mesh/createfrombrep-brep (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not connect to HTTPS URL because the SSL module is not available."))

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

[Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as undefined 
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path from user settings 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as powershell 
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell identified as 'powershell'
c:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\xterm\lib\xterm.js:1 xterm.js: Terminal.open was called on an element that was not attached to the DOM
e._log @ c:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\xterm\lib\xterm.js:1
e.warn @ c:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\xterm\lib\xterm.js:1
t.open @ c:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\xterm\lib\xterm.js:1
e.open @ c:\Users\Hugh.Groves\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\xterm\lib\xterm.js:1
(anonymous) @ terminalInstance.ts:573
processTicksAndRejections @ internal/process/task_queues.js:89
Promise.then (async)
_attachToElement @ terminalInstance.ts:558
attachToElement @ terminalInstance.ts:547
p @ terminalTab.ts:192
_addChild @ terminalTab.ts:105
split @ terminalTab.ts:47
(anonymous) @ terminalTab.ts:351
attachToElement @ terminalTab.ts:351
m @ terminalTab.ts:250
_createInstance @ instantiationService.ts:117
createInstance @ instantiationService.ts:82
createTerminal @ terminalService.ts:613
$createTerminal @ mainThreadTerminalService.ts:97
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:582
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:582
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'Python'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'other'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Terminal name 'Python' identified as shell 'other'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as other (Terminal name is Python)
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path from user settings 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as powershell (Terminal name is Python)
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell identified as 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Cached data exists getEnvironmentVariables, c:\Users\Hugh.Groves\Documents\VS_Code_Projects\RhinoComputePyTest\rcpyt.py
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'Python'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'other'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Terminal name 'Python' identified as shell 'other'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as other (Terminal name is Python)
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path from user settings 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as powershell (Terminal name is Python)
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell identified as 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Cached data exists getEnvironmentVariables, c:\Users\Hugh.Groves\Documents\VS_Code_Projects\RhinoComputePyTest\rcpyt.py
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'Python'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'other'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Terminal name 'Python' identified as shell 'other'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as other (Terminal name is Python)
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path identified as shell 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell path from user settings 'C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: [object Object]. Shell identified as powershell (Terminal name is Python)
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Shell identified as 'powershell'
console.ts:137 [Extension Host] Info Python Extension: 2020-02-10 11:45:31: Cached data exists getEnvironmentVariables, c:\Users\Hugh.Groves\Documents\VS_Code_Projects\RhinoComputePyTest\rcpyt.p
@HughGrovesArup HughGrovesArup added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Feb 10, 2020
@karthiknadig karthiknadig self-assigned this Feb 11, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Feb 11, 2020
@karthiknadig
Copy link
Member

@HughGrovesArup As you identified, this is a issue we see when the conda environment is not activated. This should be addressed when we fix #5559

@DonJayamanne
Copy link

@HughGrovesArup

  • What's the command that gets sent to the terminal
  • Please could you send a screenshot of the terminal (more interested in the begining contents , not the failure).

Generally we activate the environment in the terminal. Looks like the activation is failing or the activation command hasn't even been sent to the terminal.

@HughGrovesArup
Copy link
Author

@DonJayamanne the command that gets printed is:

& C:/Users/Hugh.Groves/AppData/Local/Continuum/Anaconda3/envs/rhinocompute/python.exe c:/Users/Hugh.Groves/Documents/VS_Code_Projects/RhinoComputePyTest/rcpyt.py

The screen looks like this:

image

@karthiknadig
Copy link
Member

Using the new vsc API to activate terminal should help with this issue. Closing this in favor of #11039

@ghost ghost removed the triage label Jun 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants