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

can not connect to visdom server On Linux #174

Closed
jdhao opened this issue Oct 16, 2017 · 25 comments
Closed

can not connect to visdom server On Linux #174

jdhao opened this issue Oct 16, 2017 · 25 comments

Comments

@jdhao
Copy link

jdhao commented Oct 16, 2017

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?

@jdhao jdhao changed the title can not connect to server On Linux can not connect to visdom server On Linux Oct 16, 2017
@JackUrb
Copy link
Contributor

JackUrb commented Oct 16, 2017

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
Copy link
Author

jdhao commented Oct 16, 2017

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

ping: unknown host localhost:8097

@JackUrb
Copy link
Contributor

JackUrb commented Oct 16, 2017

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

@jdhao
Copy link
Author

jdhao commented Oct 16, 2017

Yes, I can

@JackUrb
Copy link
Contributor

JackUrb commented Oct 16, 2017

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
Copy link
Author

jdhao commented Oct 16, 2017

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
Copy link
Contributor

JackUrb commented Oct 16, 2017

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
Copy link
Author

jdhao commented Oct 16, 2017

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
Copy link
Contributor

JackUrb commented Oct 16, 2017

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
Copy link
Author

jdhao commented Oct 16, 2017

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
Copy link
Contributor

JackUrb commented Oct 16, 2017

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
Copy link
Author

jdhao commented Oct 16, 2017

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
Copy link
Contributor

JackUrb commented Oct 16, 2017

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
Copy link
Author

jdhao commented Oct 16, 2017

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
Copy link
Contributor

JackUrb commented Oct 16, 2017

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

@JackUrb JackUrb closed this as completed Oct 16, 2017
@jdhao
Copy link
Author

jdhao commented Oct 16, 2017

Ok, thanks for your help and patience~ 👍

@SMZCC
Copy link

SMZCC commented Oct 24, 2017

你好

jdhao,

  • 我遇到了和你一样的问题(我是Ubuntu 16.04 firefox / chrome),请问下,你是怎么解决的,那个proxy是啥?该怎么设置(萌新瑟瑟发抖 😢 )

谢谢 @jdhao

@jdhao
Copy link
Author

jdhao commented Oct 24, 2017

@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
Copy link

SMZCC commented Oct 24, 2017

  • 感谢如此快速的回复
  • 羡慕你的英语这么好 👍
  • proxy和那个shadowsocks都没有用过,我先搜搜看
  • 祝好 @jdhao

@jdhao
Copy link
Author

jdhao commented Oct 24, 2017

@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
Copy link
Contributor

JackUrb commented Oct 24, 2017

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
Copy link

SMZCC commented Oct 25, 2017

  • 感谢,tensorboard还有点会 ,可以试一试 @jdhao
  • Hi @JackUrb
  • Thank you for your reply, however, I am a green hand who even can't understand the code you marked, sorry 😿
  • Does location stored in key mean the location in ext_files?
ext_files = {
        '%sjquery@3.1.1/dist/jquery.min.js' % b: 'jquery.min.js',
        '%sbootstrap@3.3.7/dist/js/bootstrap.min.js' % b: 'bootstrap.min.js',
        '%sreact-resizable@1.4.6/css/styles.css' % b: 'react-resizable-styles.css',
        '%sreact-grid-layout@0.14.0/css/styles.css' % b: 'react-grid-layout-styles.css',
        '%sreact@15.6.1/dist/react.min.js' % b: 'react-react.min.js',
        '%sreact-dom@15.6.1/dist/react-dom.min.js' % b: 'react-dom.min.js',
        '%sclassnames@2.2.5' % b: 'classnames',
        '%slayout-bin-packer@1.2.2' % b: 'layout_bin_packer',
        'https://cdn.rawgit.com/STRML/react-grid-layout/0.14.0/dist/' +
        'react-grid-layout.min.js': 'react-grid-layout.min.js',
        'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG':
            'mathjax-MathJax.js',
        'https://cdn.rawgit.com/plotly/plotly.js/master/dist/plotly.min.js':
            'plotly-plotly.min.js',
        '%scss/bootstrap.min.css' % bb: 'bootstrap.min.css',
        '%sfonts/glyphicons-halflings-regular.eot' % bb:
            'glyphicons-halflings-regular.eot',
        '%sfonts/glyphicons-halflings-regular.eot?#iefix' % bb:
            'glyphicons-halflings-regular.eot?#iefix',
        '%sfonts/glyphicons-halflings-regular.woff2' % bb:
            'glyphicons-halflings-regular.woff2',
        '%sfonts/glyphicons-halflings-regular.woff' % bb:
            'glyphicons-halflings-regular.woff',
        '%sfonts/glyphicons-halflings-regular.ttf' % bb:
            'glyphicons-halflings-regular.ttf',
        '%sfonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular' % bb:
            'glyphicons-halflings-regular.svg#glyphicons_halflingsregular',
}
  • Does the location mean the download link or anything others?
  • How can I get the download link?
  • Where can I know the expected location of the server?

@JackUrb
Copy link
Contributor

JackUrb commented Oct 25, 2017

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
Copy link

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

@JackUrb
Copy link
Contributor

JackUrb commented Aug 14, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants