Appium 1.6.0 - ProxyRequestError: Could not proxy command to remote server. Original error: Error: getaddrinfo ENOTFOUND localhost localhost:8100

Hey There,

Does anyone ran into this problem:

[debug] [WebDriverAgent] Device: Nov 22 17:25:12 Mamtas-iPhone XCTRunner[727] : Continuing to run tests in the background with task ID 1
[XCUITest] Detected that WebDriverAgent is running at url ‘http://10.11.8.17:8100
[XCUITest] WebDriverAgent started at url ‘http://10.11.8.17:8100
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {“desiredCapabilities”:{"bu…
[XCUITest] ProxyRequestError: Could not proxy command to remote server. Original error: Error: getaddrinfo ENOTFOUND localhost localhost:8100
at JWProxy.proxy$ (lib/jsonwp-proxy/proxy.js:122:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
{ ProxyRequestError: Could not proxy command to remote server. Original error: Error: getaddrinfo ENOTFOUND localhost localhost:8100
at JWProxy.proxy$ (lib/jsonwp-proxy/proxy.js:122:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
jsonwp:
{ Error: getaddrinfo ENOTFOUND localhost localhost:8100
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
code: ‘ENOTFOUND’,
errno: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘localhost’,
host: ‘localhost’,
port: ‘8100’ } }
[JSONWP Proxy] Proxying [DELETE /session/7b4a5d4d-7cd5-4e5e-891e-b3953b9d3508] to [DELETE http://localhost:8100/session/7b4a5d4d-7cd5-4e5e-891e-b3953b9d3508] with no body
[MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: getaddrinfo ENOTFOUND localhost localhost:8100
at JWProxy.proxy$ (lib/jsonwp-proxy/proxy.js:122:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] ← POST /wd/hub/session 500 85635 ms - 248

I got this issue while automating my app on iOS 10. I have setup all the dependencies and WebDriverAgent successfully.

It just happens that WebDriverAgent launches on my device and after that this error appears.
For detailed log refer attached log file:
Log.txt (8.2 KB)

maybe help. to see what using 8100 port on your mac you can in terminal print:
lsof -P | grep ':8100' | awk '{print $2}'

this returns PID number. and in Activity Monitor you can sort by PID.