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

Unable to connect to SageMaker notebook on AWS #1117

Closed
chris-merapar opened this issue Apr 7, 2020 · 8 comments
Closed

Unable to connect to SageMaker notebook on AWS #1117

chris-merapar opened this issue Apr 7, 2020 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug feature-request Request for new features or functionality notebook-remote Applies to remote Jupyter Servers

Comments

@chris-merapar
Copy link

Bug: Notebook Editor

Steps to cause the bug to occur

  1. Start an AWS Sagemaker notebook instance
  2. Use the AWS CLI command "aws sagemaker create-presigned-notebook-instance-url" to get a presigned notebook instance URL
  3. Rename the URL param "authToken" to "token" from step 2, otherwise VSCode will ask you to enter a password when it connects
  4. In VSCode, select Python: Specify local or remote jupyter server..." from command palette and give the URL
  5. Try to run a notebook in VSCode

Actual behavior

Connection fails with "Error: Invalid response: 200 OK"

Extra debug info:
Connecting to local instance of Jupyter notebook works ok. Comparing the Sagemaker notebook URL and the localhost notebook URL in Postman reveals the responses are very similar. Using both local and Sagemaker URLs, the /api/status path works fine and returns the same output.

Expected behavior

Connection should succeed.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Remote
  • Extension version: 2020.3.71659
  • VS Code version: 1.43.2
  • Setting python.jediEnabled: true
  • Python and/or Anaconda version: 3.7.7
  • OS: Mac
  • Virtual environment: N/A

Developer Tools Console Output

[Extension Host] Info Python Extension: 2020-04-07 12:16:18: Executing cell NotebookImport#0
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Waiting for jupyter server and web panel ...
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Getting jupyter server options ...
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Connecting to jupyter server ...
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Connecting to history server
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Cached data exists getEnvironmentVariables,
5console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Get Interpreters in CacheableLocatorService, Class name = m, completed in 0ms, has a truthy return value, Arg 1: undefined, Return Value: []
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Get Interpreters in CacheableLocatorService, Class name = m, completed in 0ms, has a truthy return value, Arg 1: undefined, Return Value: [{"architecture":3,"path":"/usr/local/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"6e798bdc41af67078a149575c31794472627a813dfbccbb2ee40f64c9db3c20652a0b29ea6ab8155b30f5a29ae402054559e4adaa7d6ea3d1a009b8ddfb5a07b","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"b30d86b2774e701866b57534dccfbafe5023008633f9c1adc5b8c7ef9ad8bc7d89cee7ae575cd26b5167b9d5956732b12ea3a216a46254641124aed3c63093d1","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"67a57f611b7c1bed1f80bc117812448faac5a44ecc45942aa2df30caec31c22cc5e15da671dcf728c029715aea09cbd2d55ca782aff64b4284b347212139cb65","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7","fileHash":"4edd5c72a38a95337fba6bd29d3eff80ccfff5bbd767d3792d5ea4a48c6a7b4cb3745d589ee0db9ba41510268d0e38811b86fa55c39d4a846babbcf9b53976ee","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"0839f17282c88e40109b1dbe1ef22d30a807a6e350f435f8a236efc7973c1fd6cd0373739f6038eaa4c798efb67c05ea4a0e7afa5fd7f5093221a277dfe144eb","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"626775e953069275686f4b66db96499ba6d92df0bd5b1aa704d4b7a03b14a098eb0e6a054586fabf67cf3abdff6120ca75173990735004c65a07b91c7a36974e","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"a5a721363fcbb796daa7af20fbe4987c2c19a83333a42e1294d88f59f60ce035b50fbcd8e7e70e8de5567019aab6f0be819b1de9cdf11adc0cbf9dc6b1eab300","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"67a57f611b7c1bed1f80bc117812448faac5a44ecc45942aa2df30caec31c22cc5e15da671dcf728c029715aea09cbd2d55ca782aff64b4284b347212139cb65","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"6e798bdc41af67078a149575c31794472627a813dfbccbb2ee40f64c9db3c20652a0b29ea6ab8155b30f5a29ae402054559e4adaa7d6ea3d1a009b8ddfb5a07b","type":"Unknown"},{"architecture":3,"path":"/usr/local/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"b30d86b2774e701866b57534dccfbafe5023008633f9c1adc5b8c7ef9ad8bc7d89cee7ae575cd26b5167b9d5956732b12ea3a216a46254641124aed3c63093d1","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7","fileHash":"4edd5c72a38a95337fba6bd29d3eff80ccfff5bbd767d3792d5ea4a48c6a7b4cb3745d589ee0db9ba41510268d0e38811b86fa55c39d4a846babbcf9b53976ee","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"0839f17282c88e40109b1dbe1ef22d30a807a6e350f435f8a236efc7973c1fd6cd0373739f6038eaa4c798efb67c05ea4a0e7afa5fd7f5093221a277dfe144eb","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"626775e953069275686f4b66db96499ba6d92df0bd5b1aa704d4b7a03b14a098eb0e6a054586fabf67cf3abdff6120ca75173990735004c65a07b91c7a36974e","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"a5a721363fcbb796daa7af20fbe4987c2c19a83333a42e1294d88f59f60ce035b50fbcd8e7e70e8de5567019aab6f0be819b1de9cdf11adc0cbf9dc6b1eab300","type":"Unknown"}]
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Get Interpreters in CacheableLocatorService, Class name = m, completed in 1ms, has a truthy return value, Arg 1: undefined, Return Value: [{"architecture":3,"path":"/Library/Developer/CommandLineTools/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7","fileHash":"2c34b9e04d2f7e6858ad6ec64d37b859742fa3b61bf710eb2beee2dabfa8665fce3a1c3e004c541d2781cae2df03fc4fad26be92f8c73057366c0697eca9dd03","type":"Unknown"},{"architecture":3,"path":"/usr/local/opt/python@2/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"38611cd724ff2af6b0652a5caacad927217ea78e48381688ee5aedde81de87310e5920aecce6a045ab68ca868e6d064234f55110cb8eda74655402b546221bad","type":"Unknown"},{"architecture":3,"path":"/usr/local/opt/python@2/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"38611cd724ff2af6b0652a5caacad927217ea78e48381688ee5aedde81de87310e5920aecce6a045ab68ca868e6d064234f55110cb8eda74655402b546221bad","type":"Unknown"},{"architecture":3,"path":"/usr/local/opt/python@2/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"38611cd724ff2af6b0652a5caacad927217ea78e48381688ee5aedde81de87310e5920aecce6a045ab68ca868e6d064234f55110cb8eda74655402b546221bad","type":"Unknown"}]
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:18: Get Interpreters, Class name = m, completed in 2ms, has a truthy return value, Arg 1: undefined, Return Value: [{"architecture":3,"path":"/usr/local/bin/python2","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"6e798bdc41af67078a149575c31794472627a813dfbccbb2ee40f64c9db3c20652a0b29ea6ab8155b30f5a29ae402054559e4adaa7d6ea3d1a009b8ddfb5a07b","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7","fileHash":"4edd5c72a38a95337fba6bd29d3eff80ccfff5bbd767d3792d5ea4a48c6a7b4cb3745d589ee0db9ba41510268d0e38811b86fa55c39d4a846babbcf9b53976ee","type":"Unknown"},{"architecture":3,"path":"/usr/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.16-final","major":2,"minor":7,"patch":16,"prerelease":["final"],"build":[],"version":"2.7.16-final"},"sysPrefix":"/System/Library/Frameworks/Python.framework/Versions/2.7","fileHash":"0839f17282c88e40109b1dbe1ef22d30a807a6e350f435f8a236efc7973c1fd6cd0373739f6038eaa4c798efb67c05ea4a0e7afa5fd7f5093221a277dfe144eb","type":"Unknown"},{"architecture":3,"path":"/Library/Developer/CommandLineTools/usr/bin/python3","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.3-final","major":3,"minor":7,"patch":3,"prerelease":["final"],"build":[],"version":"3.7.3-final"},"sysPrefix":"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7","fileHash":"2c34b9e04d2f7e6858ad6ec64d37b859742fa3b61bf710eb2beee2dabfa8665fce3a1c3e004c541d2781cae2df03fc4fad26be92f8c73057366c0697eca9dd03","type":"Unknown"},{"architecture":3,"path":"/usr/local/opt/python@2/bin/python2.7","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"2.7.17-final","major":2,"minor":7,"patch":17,"prerelease":["final"],"build":[],"version":"2.7.17-final"},"sysPrefix":"/usr/local/Cellar/python@2/2.7.17/Frameworks/Python.framework/Versions/2.7","fileHash":"38611cd724ff2af6b0652a5caacad927217ea78e48381688ee5aedde81de87310e5920aecce6a045ab68ca868e6d064234f55110cb8eda74655402b546221bad","type":"Unknown"}]
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:19: Connecting to process for history server
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:19: Connecting server 0cdf18be-4184-4a0d-adf8-0d10af7fb6eb kernelSpec unknown
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: Shutdown session -- complete
console.ts:137 [Extension Host] Error Python Extension: 2020-04-07 12:16:20: Failed to connect to server [t [Error]: Invalid response: 200 OK at /Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/node_modules/@jupyterlab/services.js:3:375991 at async w.createSession (/Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/extension.js:1:493904) at async w.connect (/Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/extension.js:1:491037) at async t.JupyterSessionManager.startNew (/Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/extension.js:75:919828) at async d.connect (/Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/extension.js:75:891493) at async /Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/extension.js:1:813385] { response: B [Response] { size: 0, timeout: 0, [Symbol(Body internals)]: { body: [Gunzip], disturbed: false, error: null }, [Symbol(Response internals)]: { url: 'https://console.aws.amazon.com/sagemaker/home?region=eu-west-1&notebookState=L2FwaS9jb250ZW50cy8%3D#/notebook-instances/openNotebook/xxxx-test', status: 200, statusText: 'OK', headers: [C [Headers]], counter: 1 } }}
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:587
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:587
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:203
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:276
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: Killing server because of error Error: Invalid response: 200 OK
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: Shutting down notebooks for 0cdf18be-4184-4a0d-adf8-0d10af7fb6eb
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: Shut down session manager
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: SessionManager - dispose contents manager
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: ShutdownSessionAndConnection - dispose session manager
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: Shutdown server - dispose conn info
console.ts:137 [Extension Host] Info Python Extension: 2020-04-07 12:16:20: Finished executing cell NotebookImport#0
notificationsAlerts.ts:40 Failed to connect to remote Jupyter notebook. Check that the Jupyter Server URI setting has a valid running server specified. https://xxxx-test.notebook.eu-west-1.sagemaker.aws/ Error: Invalid response: 200 OK
onDidChangeNotification @ notificationsAlerts.ts:40
(anonymous) @ notificationsAlerts.ts:26
fire @ event.ts:587
addNotification @ notifications.ts:183
notify @ notificationService.ts:101
(anonymous) @ mainThreadMessageService.ts:83
_showMessage @ mainThreadMessageService.ts:44
$showMessage @ mainThreadMessageService.ts:38
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:587
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:587
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:203
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:276
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
console.ts:137 [Extension Host] Error Python Extension: 2020-04-07 12:16:20: DataScience Error [Error: Failed to connect to remote Jupyter notebook.
Check that the Jupyter Server URI setting has a valid running server specified.
https://xxxx-test.notebook.eu-west-1.sagemaker.aws/
Error: Invalid response: 200 OK at /Users/xxxx/.vscode/extensions/ms-python.python-2020.3.71659/out/client/extension.js:1:814820]
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:587
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:587
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:203
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:276
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
webviewElement.ts:241 [Embedded Page] Posting message get_variables_request to extension.
2console.ts:137 [Extension Host] (node:11105) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:587
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:587
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:203
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:276
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166

@IanMatthewHuff
Copy link
Member

@chris-merapar Thanks for reporting this issue and for providing this log. So I believe that you mentioned this already, but if you take the exact same URL that you put into VSCode you are able to paste it into a web browser on your vscode machine and connect to the jupyter instance via the browser? Our vscode setting will only work on something that directly works that way. I'm not fully sure on this, but it looks like that url link might be redirecting, which I don't believe our code would handle. In a redirect case the browser might be able to work, but we might fail. I see the initial setting here:

https://xxxx-test.notebook.eu-west-1.sagemaker.aws/

But later on in the log I'm seeing it resolve to a different url:

{ url: 'https://console.aws.amazon.com/sagemaker/home?region=eu-west-1&notebookState=L2FwaS9jb250ZW50cy8%3D#/notebook-instances/openNotebook/xxxx-test', status: 200, statusText: 'OK',

That second URL doesn't look like something we could connect to.

@chris-merapar
Copy link
Author

chris-merapar commented Apr 17, 2020

Yes you are correct, AWS authorises the request and then sets a cookie and redirects. But when I do this in Postman (which follows the redirect) the end result after redirect looks the same as the locally hosted notebook URL. Which part specifically will not work with VSCode, is it the redirect or setting the cookie and expecting to see it in subsequent requests? I am considering making a proxy that works around whatever the incompatibility is.

Edit: It appears AWS works this way as they don't want to expose ports on Sagemaker directly or use the Jupyter auth scheme, they want to proxy everything and use their own auth mechanisms for greater flexibility.

@IanMatthewHuff
Copy link
Member

Yeah, that was what I was figuring was going on. We can discuss this at our triage, but it's not something that we can support right now from our side. Jupyter does have the concept of a session cookie to validate a session. Is that the cookie that AWS is sending, or is it something AWS authorization specific? We do handle jupyter session cookies when we do a password connect. So there might a possibility that we could allow for a users to input a validated cookie somehow.

@vdabravolski
Copy link

Curious if there are any updates on this issue. Thanks.

@greazer
Copy link
Member

greazer commented May 28, 2020

Triage: Is #1057 a dupe of this issue?

@greazer
Copy link
Member

greazer commented Jun 1, 2020

This is a specific issue relating to supporting AWS. We will consider at a later time.

@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@KiraPC
Copy link

KiraPC commented Feb 5, 2021

Any news about this issue? I'm trying to connect to AWS Sagemaker Notebook without success.

@greazer greazer added the pyspark label Aug 4, 2021
@DonJayamanne DonJayamanne changed the title Invalid response: 200 OK when connecting to SageMaker notebook Unable to connect to SageMaker notebook on AWS Oct 19, 2021
@greazer greazer added feature-request Request for new features or functionality and removed enhancement labels May 4, 2022
@IanMatthewHuff IanMatthewHuff added the triage-needed Issue needs to be triaged label Jul 7, 2022
@greazer greazer removed the triage-needed Issue needs to be triaged label Jul 7, 2022
@greazer greazer added this to the July 2022 milestone Jul 7, 2022
@greazer greazer added notebook-remote Applies to remote Jupyter Servers vscode-web bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Jul 7, 2022
@rchiodo rchiodo removed their assignment Jul 11, 2022
@rchiodo rchiodo removed this from the July 2022 milestone Jul 11, 2022
@DonJayamanne DonJayamanne self-assigned this Aug 14, 2022
@DonJayamanne DonJayamanne added the feature-request Request for new features or functionality label Dec 1, 2022
@DonJayamanne
Copy link
Contributor

Closing in favour of #12268

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
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 feature-request Request for new features or functionality notebook-remote Applies to remote Jupyter Servers
Projects
None yet
Development

No branches or pull requests

7 participants