I can't open Jupyter on my Amazon SageMaker notebook instance

3 minute read
1

I get an error when I try to open my Amazon SageMaker Jupyter notebook in my browser.

Resolution

First, try the following:

  • On the Amazon SageMaker console, and then confirm that the notebook instance status is InService. If the status is Pending, the notebook instance isn't ready yet.
  • Clear your browser cache or try a different browser.
  • Check the Jupyter logs for errors.

If you still can't open the Jupyter notebook, restart the notebook instance. It's a best practice to regularly restart notebook instances. Restarting helps keep notebook instance software updated. When you restart, the notebook instance moves to a new underlying host. This can help resolve HTTP 503 and 504 errors in your browser.

Note: The only persistent storage on the notebook instance is the /home/ec2-user/SageMaker file system. When you restart, you lose all other data.

To restart a notebook instance:

1.    Open the Amazon SageMaker console.

2.    In the navigation pane, choose Notebook instances.

3.    Select the circle next to the notebook instance name.

4.    Choose the Actions dropdown list, and then choose Stop.

5.    Wait for the notebook instance to reach the Stopped status.

6.    Choose the Actions dropdown list, and then choose Start.

7.    Open the notebook instance URL.

To prevent this issue from happening again, check for the following common causes of an overloaded notebook instance.

Too many open sessions

On the Jupyter dashboard, check the Running tab. When you have a large number of active sessions and notebooks, notebooks take longer to load and might time out in the browser. To resolve this issue, shut down unnecessary notebook or terminal sessions.

High CPU or memory utilization

1.    Open the Jupyter dashboard, and then choose the Files tab.

2.    Choose New, and then choose Terminal.

3.    Check memory utilization:

free -h

4.    Check CPU utilization:

top

If CPU or memory utilization is high and you can't free up any more resources, consider switching to a larger notebook instance type:

1.    Stop the notebook instance, as explained earlier.

2.    When the notebook instance reaches the Stopped status, choose the Actions dropdown list, and then choose Update settings.

3.    Choose a new Notebook instance type, and then choose Save. For a list of instance types available in each Region, see Supported instance types and Availability Zones.

4.    Choose the Actions dropdown list, and then choose Start.

5.    Open the notebook instance URL.

High disk utilization

1.    Open the Jupyter dashboard, and then choose the Files tab.

2.    Choose New, and then choose Terminal.

3.    Run a command similar to the following to start a shell session and check disk utilization:

df -h

4.    Check disk utilization for filesystem /home/ec2-user/SageMaker.

If disk utilization is high, then remove temporary files from the /home/ec2-user/SageMaker directory, if possible. Or, increase the Amazon Elastic Block Store (Amazon EBS) volume size:

1.    Stop the notebook instance, as explained earlier.

2.    When the notebook instance reaches the Stopped status, choose the Actions dropdown list, and then choose Update settings.

3.    Enter a new volume size, and then choose Save. The default EBS volume size is 5 GB. You can increase the volume size up to 16 TB.

4.    Choose the Actions dropdown list, and then choose Start.

5.    Open the notebook instance URL.


AWS OFFICIAL
AWS OFFICIALUpdated 2 years ago