Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Restful server start failed! #1223

Closed
liudonggang opened this issue Jun 27, 2019 · 10 comments
Closed

Restful server start failed! #1223

liudonggang opened this issue Jun 27, 2019 · 10 comments
Assignees
Labels

Comments

@liudonggang
Copy link

When I run an experiment,A "ERROR: Restful server start failed! "has occurred, I don't know why this problem occurred, I was in the docker container to start the trial, run the command: nnictl create -c config. yml-p XXXX

@liudonggang
Copy link
Author

I solved this problem. When I modified localhost to 127.0.0.1,then i try request.get('http://127.0.0.1:12306/api/v1/nni/check-status')
the requests could succeed, but when I used localhost, the NNI Restful server service could not be successfully started.
My solution was to modify /etc/hosts file and add "127.0.0.1 localhost", so that the bug could be successfully solved.
Is it possible to make changes in the original code?

@dliang0406
Copy link

I have this issue too!
I installed nni by pip install and it worked well for days and suddenly one day the error message shows up "Restful server start failed!"
I checked my "/etc/hosts" file and "127.0.0.1 localhost" has been there.
I reinstalled nni with this command "python3 -m pip install nni --no-cache-dir" but nothing changed.

@Weak-Chicken
Copy link

I had the same problem when I tried to run nni in docker container.

I solved this by removing my docker container proxy config file: ~/.docker/config.json

So for those of you who do not use it in docker, I think it is a good idea to check your environment variables like HTTP_PROXY or HTTPS_PROXY and remove them if they are set.

@ultmaster ultmaster added the documentation documentation related issues label Oct 20, 2019
@ultmaster
Copy link
Contributor

Can we add some FAQs about the common network issue that could cause the start failure of Restful Server?

@henryslzhao
Copy link

I have this issue too! The nni is run in docker.
I checked my "/etc/hosts" file and "127.0.0.1 localhost" has been there.

@scarlett2018
Copy link
Member

I have this issue too! The nni is run in docker.
I checked my "/etc/hosts" file and "127.0.0.1 localhost" has been there.

@henryslzhao - may you try suggestions in https://nni.readthedocs.io/en/latest/Tutorial/FAQ.html ? thanks.

@scarlett2018
Copy link
Member

Closing the issue as overdue (with no updates from user). Please feel free to reopen the issue if you are still seeing the issue and have updates to work with us.

@hamideh-h
Copy link

I also received this error and I don't know how to fix it.

I checked the node version and it is fine. I also unset the http_proxy && https_proxy
Localhost is also added in the hosts but I still have this problem

INFO: expand codeDir: . to C:\kit\code\Mnist-annotation-autoML.
INFO: Starting restful server...
ERROR: Restful server start failed!
INFO: Stdout:

@BlancRay
Copy link

Because Windows uses IPv6 by default when available, you need to change the IPv6/IPv4 preference by add a prefix policy to prefer IPv4 addresses over IPv6.
Simply check is ping localhost, see if is 127.0.0.1 or [::1]

Default Windows prefix policy table:

C:\> netsh interface ipv6 show prefixpolicies
Querying active state...

Precedence  Label  Prefix
----------  -----  --------------------------------
        50      0  ::1/128
        40      1  ::/0
        30      2  2002::/16
        20      3  ::/96
        10      4  ::ffff:0:0/96
         5      5  2001::/32

You can change it with netsh int ipv6 set prefix ::/96 55 3 with run as administrator and reboot after set. #2398

@hamideh-h
Copy link

hamideh-h commented Nov 11, 2020

Thanks a lot, BlanceRay.

However, I run "netsh int ipv6 set prefix ::/96 55 3" with administrator permission but I am still receiving this error and I think it is because of npm.

Error: Restful server start failed!
INFO:   Stdout:
                Experiment start time 2020-11-11 08:59:01

Info:   Stderr:
                Experiment start time 2020-11-11 08:59:01
internal/modules/cjs/loader.js:638
    throw err;
    ^
Error: Cannot find module 'typescript-ioc'

Although I have "typescript-ioc" in "C:\Program Files\nodejs\node_modules\npm\node_modules" directory. my node version is v15.1.0

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

No branches or pull requests

10 participants