question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to connect to remote SageMaker server

See original GitHub issue

Bug: Notebook Editor, Interactive Window, Editor cells

Steps to cause the bug to occur

  1. Created a SageMaker notebook instance
  2. Ran aws --region <region> sagemaker create-presigned-notebook-instance-url --notebook-instance-name <instance name> to generate an authorized Url of the form https://<notebook name>.notebook.<region>.sagemaker.aws?authToken=<long auth token>
  3. Cmd+Shift+P -> Python: Specify a local or remote Jupyter server for connections and copied in the auth token.
  4. Created a new .ipynb file in vscode and wrote print('Hello World!')
  5. Ran the cell and received a popup Enter your notebook password
  6. Got stuck since my notebook didn’t have a password. Decided to go to my SageMaker instance and try to create a password, so opened a terminal in my SM hosted instance and typed jupyter notebook password, then created a password.
  7. Restarted the jupyter server with sudo initctl restart jupyter-server --no-wait
  8. Refreshed my page, got a box asking for password, entered it in.
  9. Tried running the print statement again in vscode, entered in my new password.
  10. Got the same error as with no password:
Failed to connect to remote Jupyter notebook.
Check that the Jupyter Server URI setting has a valid running server specified.
https://<notebook name>.notebook.<region>.sagemaker.aws/
Error: Failed to connect to password protected server. Check that password is correct.

Actual behavior

Received the above error.

Expected behavior

Connect to remote SageMaker server.

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local | Remote | N/A
  • Extension version: 20YY.MM.#####-xxx
  • VS Code version: #.##
  • Setting python.jediEnabled: true | false
  • Python and/or Anaconda version: #.#.#
  • OS: Windows | Mac | Linux (distro):
  • Virtual environment: conda | venv | virtualenv | N/A | …

Developer Tools Console Output

[Extension Host] Info Python Extension: 2020-03-22 20:56:39: Executing cell 5be2420a-8318-4c69-88ad-71134207026c
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:39: Waiting for jupyter server and web panel ...
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:39: Cached data exists getEnvironmentVariables, Untitled-1.ipynb
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:39: Getting jupyter server options ...
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:39: Connecting to jupyter server ...
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:39: Connecting to history server
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:41: Killing server because of error Error: Failed to connect to password protected server. Check that password is correct.
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:41: Shutting down notebooks for 4cea6e5c-f565-4d34-8996-788b645d8b2b
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:41: Shut down session manager
console.ts:137 [Extension Host] Info Python Extension: 2020-03-22 20:56:41: Finished executing cell 5be2420a-8318-4c69-88ad-71134207026c
notificationsAlerts.ts:40 Failed to connect to remote Jupyter notebook. Check that the Jupyter Server URI setting has a valid running server specified. https://sagemaker-gluon.notebook.us-east-2.sagemaker.aws/ Error: Failed to connect to password protected server. Check that password is correct.
onDidChangeNotification @ notificationsAlerts.ts:40
console.ts:137 [Extension Host] Error Python Extension: 2020-03-22 20:56:41: DataScience Error Error: Failed to connect to remote Jupyter notebook.
Check that the Jupyter Server URI setting has a valid running server specified.
https://sagemaker-gluon.notebook.us-east-2.sagemaker.aws/
Error: Failed to connect to password protected server. Check that password is correct.    at /Users/austinmw/.vscode/extensions/ms-python.python-2020.3.69010/src/client/datascience/jupyter/jupyterExecution.ts:210:39
t.log @ console.ts:137
webviewElement.ts:241 [Embedded Page] Posting message get_variables_request to extension.
2console.ts:137 [Extension Host] (node:94559) [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
log.ts:197   ERR No application in the Launch Services database matches the input criteria.: Error: No application in the Launch Services database matches the input criteria.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dennisbappertcommented, Apr 1, 2020

I don’t think that this issue is a duplicate of microsoft/vscode-python#10320 - 405 Method not allowed is not happening here.

0reactions
greazercommented, Mar 27, 2020

Duplicate of microsoft/vscode-python#10320

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot issues with associating Git repositories ... - AWS
I'm trying to add a Git repository to an Amazon SageMaker ... "fatal: unable to access <Git repository URL> : failed to connect...
Read more >
How to connect SageMaker notebook from VS Code?
VS Code gives me this error: Failed to connect to remote Jupyter notebook. Check that the Jupyter Server URI setting has a valid...
Read more >
Sagemaker Train Job can't connect to ec2 instance
I had this same issue, Sagemaker plus MLflow Server on another ec2. The first instinct is to assign the estimator the same VPC...
Read more >
Resolving "Connection refused" or "Connection timed out ...
Resolving " Connection refused " or " Connection timed out" errors connecting to my EC2 Instance. Watch later. Share. Copy link.
Read more >
Connect to compute instance in Visual Studio Code (preview)
This option allows you to set a compute instance as a remote Jupyter Notebook server. Configure a remote compute instance. To configure a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found