fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Apache License 2.0
10k stars 1.14k forks source link

can not connect to visdom server On Linux #174

Closed jdhao closed 6 years ago

jdhao commented 6 years ago

I have installed visdom python package on my Linux system After starting the visdom server, I can not open the page localhost:8097. I have tried to add LocalForward 127.0.0.1:8097 127.0.0.1:8097 to ~/.ssh/config, but it does not help either. I have also tried to install visdom on my Windows computer, and it works fine.

Any idea how to fix this?

JackUrb commented 6 years ago

I'm not quite familiar with how visdom will act on linux (as I know networking on linux tends to vary by distribution) but it could be possible that routing to localhost isn't properly configured. Are you able to successfully ping localhost via a terminal?

jdhao commented 6 years ago

@JackUrb , I am using CentOS 7.2. When I use ping localhost:8097, I get an error:

ping: unknown host localhost:8097

JackUrb commented 6 years ago

Are you able to ping localhost without the port? just ping localhost

jdhao commented 6 years ago

Yes, I can

JackUrb commented 6 years ago

And when you run the server the line You can navigate to ... appears, correct? While the server is running, what is the output of nmap -p 8097 localhost?

jdhao commented 6 years ago

No, both on Windows and CentOS, when I run the server using python -m visdom.server, only the line

It's Alive!

appers.

The output of nmap -p 8097 localhost on CentOS is

Starting Nmap 6.40 ( http://nmap.org ) at 2017-10-16 10:36 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.000087s latency). Other addresses for localhost (not scanned): 127.0.0.1 PORT STATE SERVICE 8097/tcp open sac

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds

JackUrb commented 6 years ago

Hm no other lines - What is the console output when you ctrl c? Also what is the output of nmap -p 8097 localhost if the server is not running? Also what browser are you using in CentOS?

I can't tell if the issue is something on tornado's end in not fully starting up or on the side of the browser side

jdhao commented 6 years ago

The output of ctrl + c is

Traceback (most recent call last): File "/home/jdhao/util/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/jdhao/util/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jdhao/util/anaconda3/lib/python3.6/site-packages/visdom/server.py", line 438, in main() File "/home/jdhao/util/anaconda3/lib/python3.6/site-packages/visdom/server.py", line 433, in main ioloop.IOLoop.instance().start() File "/home/jdhao/util/anaconda3/lib/python3.6/site-packages/zmq/eventloop/ioloop.py", line 177, in start super(ZMQIOLoop, self).start() File "/home/jdhao/util/anaconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 862, in start event_pairs = self._impl.poll(poll_timeout) File "/home/jdhao/util/anaconda3/lib/python3.6/site-packages/zmq/eventloop/ioloop.py", line 122, in poll z_events = self._poller.poll(1000*timeout) File "/home/jdhao/util/anaconda3/lib/python3.6/site-packages/zmq/sugar/poll.py", line 99, in poll return zmq_poll(self.sockets, timeout=timeout) File "zmq/backend/cython/_poll.pyx", line 116, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:2036) File "zmq/backend/cython/checkrc.pxd", line 12, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/_poll.c:2418) KeyboardInterrupt

The output of nmap -p 8097 localhost if server is not running

Starting Nmap 6.40 ( http://nmap.org ) at 2017-10-16 10:53 EDT Nmap scan report for localhost (127.0.0.1) Host is up (0.00010s latency). Other addresses for localhost (not scanned): 127.0.0.1 PORT STATE SERVICE 8097/tcp closed sac

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds

On CentOS, I tested both firefox and chrome. Neither of them works properly.

JackUrb commented 6 years ago

Alright this seems to imply the visdom server is running properly (as nmap before and after shows the port opening and closing, and the server makes it to ioloop.IOLoop.instance().start()). Can you try navigating to 127.0.0.1:8097 in your browser instead of using localhost?

jdhao commented 6 years ago

Whether I use localhost:8097 or 127.0.0.1:8097, after a long time of loading, I see on CentOS the following image

While on Windows, I see this image

The upper tool bar is not shown in CentOS, maybe the issue with the browser?

JackUrb commented 6 years ago

Ah alright so the page does eventually load at least - can you check the contents of the javascript console in the window on CentOS? It's possible that some of the dependancies are not getting loaded for some reason.

jdhao commented 6 years ago

On CentOS, the output of javascript console is image

And on Windows, it is image

Maybe this is the cause. But how to solve this...

JackUrb commented 6 years ago

Yeah the issue is definitely there - where is it trying to load those files from? You should be able to see on the network tab.

jdhao commented 6 years ago

I think I have found the root cause. Thanks to the f**king GFW. On my windows, my browser connect to internet via proxy, but on CentOS, there is no proxy. So some of the resources can't be loaded properly on CentOS.

JackUrb commented 6 years ago

Ah that would definitely explain it. I know it's possible to connect through a proxy on CentOS, though I'm not sure how easy it is. Hopefully you'll be able to use visdom properly once you have that set up though!

I'm going to close the issue now that we're sure it's external to us

jdhao commented 6 years ago

Ok, thanks for your help and patience~ 👍

SMZCC commented 6 years ago

你好

jdhao,

jdhao commented 6 years ago

@SMZCC, I think using English is preferred. Actually I have not spent my time to solve this problem. There are two ways I can think of to solve this problem, one is to set up your browser and connect to any website via proxy (so you have to install a shadowsocks client on your Ubuntu). Another way is to download the blocked javascript resource and put it somewhere the visdom page expect them to be (although I do not where). You may ask the visdom developer for help for the second way.

SMZCC commented 6 years ago
jdhao commented 6 years ago

@SMZCC , I would rather advise you to try this tool, https://github.com/lanpa/tensorboard-pytorch. There are not so many free shadowsocks that you can use. For beginners, it may not be so easy to configure to make it work. Try the simpler way~

JackUrb commented 6 years ago

Hi @SMZCC @jdhao. It definitely is possible to download the required scripts manually and store them in the location that visdom expects them. We used to make these packages install during the initial download and setup, but then it was impossible to get visdom when our external content distributors were down.

Here's the function that actually does the collecting. This line is the file name that we expect to find the file that we download from the location stored in key. As long as you download these files and put them in the expected location, the server won't need to attempt to download them externally on runtime.

SMZCC commented 6 years ago
JackUrb commented 6 years ago

I used the line print ('download from {} and put at {}'.format(key,filename)) right before this one to be able to get the following:

download from https://unpkg.com/jquery@3.1.1/dist/jquery.min.js and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/jquery.min.js
download from https://unpkg.com/bootstrap@3.3.7/dist/js/bootstrap.min.js and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/bootstrap.min.js
download from https://unpkg.com/react-resizable@1.4.6/css/styles.css and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/css/react-resizable-styles.css
download from https://unpkg.com/react-grid-layout@0.14.0/css/styles.css and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/css/react-grid-layout-styles.css
download from https://unpkg.com/react@15.6.1/dist/react.min.js and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/react-react.min.js
download from https://unpkg.com/react-dom@15.6.1/dist/react-dom.min.js and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/react-dom.min.js
download from https://unpkg.com/classnames@2.2.5 and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/classnames
download from https://unpkg.com/layout-bin-packer@1.2.2 and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/layout_bin_packer
download from https://cdn.rawgit.com/STRML/react-grid-layout/0.14.0/dist/react-grid-layout.min.js and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/react-grid-layout.min.js
download from https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/mathjax-MathJax.js
download from https://cdn.rawgit.com/plotly/plotly.js/master/dist/plotly.min.js and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/js/plotly-plotly.min.js
download from https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/css/bootstrap.min.css
download from https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.eot and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/glyphicons-halflings-regular.eot
download from https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.eot?#iefix and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/glyphicons-halflings-regular.eot?#iefix
download from https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.woff2 and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/glyphicons-halflings-regular.woff2
download from https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.woff and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/glyphicons-halflings-regular.woff
download from https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.ttf and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/glyphicons-halflings-regular.ttf
download from https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular and put at /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom/static/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular

You will need to find out where your visdom package folder is, as in my case it is /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/visdom but it might not be in the same location for you.

lixuanze commented 2 years ago

I am facing the same issue, is anyone here got the things sorted out?

JackUrb commented 2 years ago

@lixuanze please open a new issue and fill out the complete set of details, otherwise it is impossible to diagnose your problem.