joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.45k stars 423 forks source link

Errno #268

Closed foxman209 closed 5 years ago

foxman209 commented 6 years ago

when I grip,it show me : [Errno 8] nodename nor servname provided, or not known

joeyespo commented 6 years ago

I wonder if this is caused by utilizing localhost for generating a random port, from

        if port == 0 and open_browser:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.bind(('localhost', 0))
            port = sock.getsockname()[1]
            sock.close()

This and https://stackoverflow.com/questions/39970606/gaierror-errno-8-nodename-nor-servname-provided-or-not-known-with-macos-sie hints at that.

Are you running with port 0 and --browser by chance? If not, could you post the exact command you used and the full output (if there's any more).

Thanks!

kevinjpickard commented 6 years ago

I'm getting this as well:

> $ grip -b README.md 8888                                                                                                                                                                                                                                                                   
 * Serving Flask app "grip.app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Error: [Errno 8] nodename nor servname provided, or not known

With no parameters:

> $ grip                                                                                                                                                                                                                                                                          
 * Serving Flask app "grip.app" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Error: [Errno 8] nodename nor servname provided, or not known

I'm running Grip 4.5.2.

> $ pip show grip                                                                                                                                                                                                                                                                            
Name: grip
Version: 4.5.2
Summary: Render local readme files before sending off to GitHub.
Home-page: http://github.com/joeyespo/grip
Author: Joe Esposito
Author-email: joe@joeyespo.com
License: MIT
Location: /Users/kevin/.pyenv/versions/2.7.15/lib/python2.7/site-packages
Requires: docopt, Flask, Markdown, path-and-address, Pygments, requests
Required-by:

> $ pip show flask                                                                                                                                                                                                                                                                           
Name: Flask
Version: 1.0.2
Summary: A simple framework for building complex web applications.
Home-page: https://www.palletsprojects.com/p/flask/
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD
Location: /Users/kevin/.pyenv/versions/2.7.15/lib/python2.7/site-packages
Requires: Werkzeug, click, Jinja2, itsdangerous
Required-by: grip

This is on macOS 10.13.5, ZSH, and tested both on Python 2.7.15 and 3.6.5, same results in both. Using pyenv to manage python environments.

BenGitsCode commented 6 years ago

Similar problem here.

❯ grip report-data-source.md
 * Using personal access token
Error: [Errno 8] nodename nor servname provided, or not known

forge/notes/shadows/jono-mentor git/master*
❯ grip -b report-data-source.md
 * Using personal access token
Error: [Errno 8] nodename nor servname provided, or not known

forge/notes/shadows/jono-mentor git/master*
❯ zsh --version \n; python --version \n ; brew list --versions grip
zsh 5.3 (x86_64-apple-darwin17.0)
Python 2.7.15
grip 4.5.2

my ~/.grip/settings.py is just my username and personal access token. This is a new grip instance on my work computer, I'll check my home computer tonight to see if that's also having the issue.

BenGitsCode commented 6 years ago

Has anyone gotten beyond this error before? I'm happy to try some further debugging but I'm not sure where to start with this.

nikvdp commented 5 years ago

@BenGitsCode I had the same issue start happening all of a sudden after doing some work that involved modifying my hosts file. Eventually realized I'd misconfigured my /etc/hosts file and had deleted this line:

127.0.0.1     localhost

Adding that line back into /etc/hosts made grip start working correctly again.

joeyespo commented 5 years ago

Hi, all. Is this still happening? If so, can you try @nikvdp's suggestion?

I can't reproduce, so I'm closing for now. Feel free to re-open if that doesn't work.