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

gethostbyname() fails if socket.gethostname() gives a bad hostname. #165

Closed
bouthilx opened this issue Feb 28, 2019 · 1 comment
Closed

Comments

@bouthilx
Copy link
Member

From @mikepieper

Note: I don't know yet if this is related to #104

The error:

Traceback (most recent call last):
  File "main.py", line 7, in <module>
    from orion.core.io.experiment_builder import ExperimentBuilder
  File "/Users/michaelpieper/anaconda/envs/orion.tutorial/lib/python3.6/site-packages/orion/core/io/experiment_builder.py", line 92, in <module>
    from orion.core.io import resolve_config
  File "/Users/michaelpieper/anaconda/envs/orion.tutorial/lib/python3.6/site-packages/orion/core/io/resolve_config.py", line 71, in <module>
    ('ORION_DB_ADDRESS', 'host', socket.gethostbyname(socket.gethostname()))
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

The hostname:

>>> socket.gethostname()
'Michaels-MBP-2’
>>> socket.gethostbyname(socket.gethostname())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

From this stack overflow question (https://stackoverflow.com/questions/39970606/gaierror-errno-8-nodename-nor-servname-provided-or-not-known-with-macos-sie ), I tried:

>>> socket.gethostbyname('localhost')
‘127.0.0.1'

I’m figuring out the best way to resolve that, but just wanted to let you know there might be an issue for Macs.

A solution could be to simply turn the default value to None when gethostbyname() fails.

bouthilx added a commit to bouthilx/orion that referenced this issue Jun 5, 2019
Why:

On OSX, hostnames cannot be interpreted by `gethostbyname()` (See Epistimio#165).

How:

If the hostname cannot be interpreted, set to `localhost` by default.
bouthilx added a commit to bouthilx/orion that referenced this issue Jun 6, 2019
Why:

On OSX, hostnames cannot be interpreted by `gethostbyname()` (See Epistimio#165).

How:

If the hostname cannot be interpreted, set to `localhost` by default.
bouthilx added a commit that referenced this issue Jul 2, 2019
Why:

On OSX, hostnames cannot be interpreted by `gethostbyname()` (See #165).

How:

If the hostname cannot be interpreted, set to `localhost` by default.
@bouthilx
Copy link
Member Author

bouthilx commented Jul 5, 2019

Fixed by #179

@bouthilx bouthilx closed this as completed Jul 5, 2019
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

1 participant