I am getting ETIMEDOUT error even when axios default timeout is 0.
Error: connect ETIMEDOUT xx.xx.x.xx:xxxx
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: 'xx.xx.xx.1xxx',
port: 40112,
config: {
url: 'xxx.com/sda/das',
method: 'post',
data: '{"username":"abc","password":"sADASD","environment":"das","role":"dasd"}',
headers: {
Accept: 'application/json, text/plain, /',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.21.4',
'Content-Length': 187
},
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,\
CodePudding user response:
This is not an axios error, this is an OS error - it means that the OS timed out trying to connect to this host at this port. Usually, it means that the server is not reachable - at least on Linux the default timeout is very large - on the order of several minutes.
