I have spent days to solve this and no solution.
[ec2-user#ip-172-31-28-86 mynotebooks]$ jupyter notebook
[I 14:34:22.588 NotebookApp] [nb_conda_kernels] enabled, 15 kernels found
[I 14:34:22.615 NotebookApp] Writing notebook server cookie secret to /home/ec2-user/.local/share/jupyter/runtime/notebook_cookie_secret
[I 14:34:24.129 NotebookApp] [nb_anacondacloud] enabled
[I 14:34:24.250 NotebookApp] [nb_conda] enabled
[I 14:34:25.199 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 14:34:25.199 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'n bbrowserpdf'
[I 14:34:37.849 NotebookApp] sparkmagic extension enabled!
[I 14:34:37.854 NotebookApp] Serving notebooks from local directory: /home/ec2-user/mynotebooks
[I 14:34:37.854 NotebookApp] 0 active kernels
[I 14:34:37.854 NotebookApp] The Jupyter Notebook is running at:
[I 14:34:37.854 NotebookApp] https://[all ip addresses on your system]:8888/
[I 14:34:37.854 NotebookApp] Use Control-C to stop this server and shut down all
I have completed the setup process this is my output.
But when i try to open the url(public domain url in aws) with port number 8888 , it doesnt open timeout error.
None of the previous asked question solved my issue
Can you confirm that you have configured the Security Group applied to your ec2 instance that will let you connect on port 8888?
As you are connecting over the public internet, I would encourage you to tunnel your connection over SSH.
To create a tunnel over SSH using Putty on Windows:
Log into your remote box
Start up Jupyter Notebnook $ jupyter notebook --ip='*' --no-browser
Note which port Jupyter is using. In this example, it is 8846.
See: The Jupyter Notebook is running at: http://[all ip addresses on your system]:8846
Start another Putty window and highlight the session you use to connect to your instance and click the "Load" Button
Navigate down to Connection | SSH | Tunnels
Enter the port you want to connect to on your local machine in the " "Source Port" (I am using 5500 in this example)
Enter your destination address ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:8846 and click the "Add" button
Navigate back to your session, click "Save", then click "Connect"
You should now be able to enter http://localhost:5500 in your web browser and connection to Jupyter
More Information:
An example of someone tunneling through a proxy
Some excellent screenshots here
An informative Stack Overflow thread
Related
When trying to connect to tensorboard logs on a remote server and entering the address http://localhost:16006/ in chrome and firefox I get this message in the command line "channel 3: open failed: connect failed: Connection refused" multiple times and this message on the browser, "The Connection was Reset".
I ssh into the server like this: ssh -L 16006:127.0.0.1:6006 username#machine and then go one level up the log folder and write: tensorboard --logdir logs --port 16006
I tired:
tensorboard --logdir logs --port 16006 --bind-all
and also
tensorboard --logdir logs --host localhost, also
tensorboard --logdir logs --host 127.0.0.1
None of the above has wroked. I tried running the line above from another environment which didn't help. I went to the office and tried connecting to the logs from the server machine directly and it worked.
It used to work before when accessing remotely. Do you know what the problem is? any hint would be immensely appreciated.
I am having the same problem, but I think you should designate --port 6006 since it looks like you are forwarding remote port 6006 to the local port 16006.
Even so, since 6006 is the default port, the other commands should have worked, but you would have to go to http://127.0.0.1:16006 on your local machine, rather than the link it provides.
Some more in depth explanations can be found here how to run tensorboard on a remote server and how to see tensorboard over ssh
Even following this advice though I am still getting a 'channel 3: open failed: connect failed: Connection failed' error
I create GCP vm instance, allow http access and set config jupyter server as below:
$ jupyter notebook password
c = get_config()
c.NotebookApp.ip = '10.14.~~~~~~'
c.NotebookApp.allow_origin = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.password = "sha1:~~~~~"
$ sudo ufw allow 8888
$ jupyter notebook --ip 0.0.0.0 --port 8888
and I try to connect to "http(s)://externalip:8888"
but failed. It only showing infinite loading.
here is console message:
(base) myID#instance-1:~$ jupyter notebook --ip 0.0.0.0 --port 8888 [I
07:26:32.493 NotebookApp] JupyterLab extension loaded from
/home/renwenxue0/anaconda3/lib/python3.7/site-package s/jupyterlab [I
07:26:32.493 NotebookApp] JupyterLab application directory is
/home/renwenxue0/anaconda3/share/jupyter/lab [I 07:26:32.495
NotebookApp] Serving notebooks from local directory: /home/renwenxue0
[I 07:26:32.495 NotebookApp] The Jupyter Notebook is running at: [I
07:26:32.495 NotebookApp] http://(instance-1 or 127.0.0.1):8888/ [I
07:26:32.495 NotebookApp] Use Control-C to stop this server and shut
down all kernels (twice to skip confirmatio n).
I have sent feedback to google team but got no reply.
You need to enable firewall rule on GCP console(allow port 8888)
https://cloud.google.com/vpc/docs/firewalls#firewall_rules_in
I think you'll have a much easier time if you use GCP's AI Platform Notebooks instead.
It's the same price as doing it yourself, but you'll get a full Jupyter Notebook environment with various popular ML libraries preinstalled (and GPU support for them pre-setup as well)
To create one go to the GCP console -> AI Platform -> Notebooks -> New Instance
I have already set up an EC2 instance on AWS (ubuntu, eu-central-1b). Port 8888 (custom tcp rule), https 443 and ssh 22 is open on AWS (anywhere). I'm aware of the chmod 400 key.pem and jupyter_notebook_config.py topics. It is also sucessfully set up Anaconda3-5x and also Jupyter on the EC2 instance. BUT: I cannot access the Jupyter Server on my browser (Firefox and Safari). When launching jupyter notebook after logging in to the EC2 instance, i get the PermissionError: [Errno 13] Permission denied error message. In the browser, I simply get a the connection has timed out error message.
I followed pretty much every tutorial there is such as:
https://chrisalbon.com/aws/basics/run_project_jupyter_on_amazon_ec2/
or
https://github.com/mGalarnyk/Installations_Mac_Ubuntu_Windows/tree/master/AWS
I tried it a couple of times now, terminated the EC2 instance and set up the whole thing again. But still, I cannot connect to the Jupyter Server via the browser.
The exact error message looks like this the moment I try to connect / enter the URL in the browser:
(base) ubuntu#ip-172-31-34-13:~$ jupyter notebook [I 15:44:20.930 NotebookApp] JupyterLab extension loaded from /home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 15:44:20.930 NotebookApp] JupyterLab application directory is /home/ubuntu/anaconda3/share/jupyter/lab
[I 15:44:20.934 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 15:44:20.934 NotebookApp] The Jupyter Notebook is running at:
[I 15:44:20.934 NotebookApp] https://(ip-172-31-34-13 or 127.0.0.1):8888/
[I 15:44:20.934 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Exception in callback BaseAsyncIOLoop._handle_events(6, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(6, 1)>
Traceback (most recent call last):
File "/home/ubuntu/anaconda3/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 122, in _handle_events
handler_func(fileobj, events)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/s**tack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/netutil.py", line 262, in accept_handler
callback(connection, address)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/tcpserver.py", line 263, in _handle_connection
do_handshake_on_connect=False)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/netutil.py", line 565, in ssl_wrap_socket
context = ssl_options_to_context(ssl_options)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/tornado/netutil.py", line 540, in ssl_options_to_context
context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))**
There's also no difference when I use the 'https://(AWS Public DNS):8888' or the 'https://(AWS IPv4 Public IP):8888'
I tried even a different Port (8889) and stuff like this.
And as an info what my notebook_config looks like:
c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha1:xxxxx'
c.NotebookApp.port = 8888
Everythings's basically set up like they showed in the tutorials.
I tried it even like they showed officialy on AWS: https://docs.aws.amazon.com/dlami/latest/devguide/setup-jupyter-config.html
It might be a permissions error with the cert.pem file. Assuming the directory is correct for mycert.pem as listed in your notebook_config file, from the terminal that's SSH'd into the EC2 instance, you can use the following command:
sudo chown $USER:$USER /home/ubuntu/certs/mycert.pem
Possible duplicate of this question: Trouble with Jupyter certifications
Make sure not to use private ip but rather public ip, I still got above error after handling permission error on certificate by sudo chown $USER:$USER /home/ubuntu/certs/mycert.pem
Also, if you get SSL error make sure to use https:\\ before ip:<port number>
Also make sure to check inbound rules of security group to make sure you are trying right ports to access.
For me, the problem was because of read permission.
Following command fixes the read/write for all groups.
sudo chmod -R a+rw /home/ubuntu/certs/mycert.pem
I am setting up ec2 on Aws for the first time. When I command to run Jupyter notebook, it runs and says no browser found. However, when I put the link to connect Jupyter through my browser, I see this message in my browser--
This site can’t be reached The connection was reset.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_RESET
I tried several times to connect with Chrome and Firefox. But, haven't got connected. When I try to connect through Firefox, it shows the following message-
Secure Connection Failed
The connection to ec2-18-224-212-245.us-east-2.compute.amazonaws.com:8888 was interrupted while the page was loading.
The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.
After putting command - jupyter notebook - it runs but shows the browser not found error
[I 14:45:00.935 NotebookApp] The Jupyter Notebook is running at: https://[all ip addresses on your system]:8888/
[I 14:45:00.935 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 14:45:00.936 NotebookApp] No web browser found: could not locate runnable browser.
when i try to connect the jupyter notebook through my browser this error shows up
PermissionError: [Errno 13] Permission denied
I am expecting my Jupyter notebook run and load in browser. So that, I can use my Aws Jupyter notebook.
I used to run this Jupyter notebook with no problems (using 8889 port) at all but since yesterday I have been having troubles accessing it. This is what happens when I ssh to my server on AWS (below). When I copy/paste this url in Safari I get this message: "Safari cannot open the page because the server unexpectedly dropped the connection". SSH works fine though. Will appreciate help of this community as I'm new to AWS.
ssh [xxx]
ubuntu#ip-xxx:~$ cd mydir
ubuntu#ip-xxx:~/mydir$ source myenv/bin/activate
(myenv) ubuntu#ip-xxx:~/mydir$ jupyter notebook
[I xxx NotebookApp] The port 8888 is already in use, trying another port.
[I xxx NotebookApp] Serving notebooks from local directory: /home/ubuntu/mydir
[I xxx NotebookApp] The Jupyter Notebook is running at:
[I xxx NotebookApp] http://localhost:8889/?token=XXX
[I xxx NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W xxx NotebookApp] No web browser found: could not locate runnable browser.
[C xxx NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8889/?token=XXX
Run this to see what process is using that port
sudo netstat -tupln | grep 8888
Afterwards kill that process and try to start up notebook again.
sudo kill -9 PID