Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postman Newman - Requests that work in Postman fail in Newman with ETIMEDOUT

All requests to a specific server are timing out with the error ETIMEDOUT.

[...]$ newman -c Test.json.postman_collection 

Iteration 1 of 1
RequestError: [223f1c83-1bb6-b40c-acc7-d90a2dd4e4ce] 'HB Heart Beat' terminated. Complete error: 
Error: ETIMEDOUT
at null._onTimeout (~/.nvm/versions/node/v0.12.9/lib/node_modules/newman/node_modules/request/request.js:808:15)
at Timer.listOnTimeout (timers.js:119:15)

The tests work in Postman and Collection Runner. I can hit the target server using curl in bash. I'm not experienced enough to dig into the Newman errors further than this, and any help would be appreciated.

The actual request is simple. I've stripped out any environment variables to see if I could get it working:

POST  HTTP/1.1
Host: http://<IP ADDRESS GOES HERE>
Content-Length: 161
Cache-Control: no-cache
Postman-Token: 0e650324-356e-0a21-6ee1-2d7731a3f28c

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<HB timestamp="123456789" xmlns="http://google.com"/>

This same behavior happens in the top version of Newman and the beta version for Node 4.0+. There is a bug mentioned in the newman git repo. I'm thinking this may have something to do with it, but other requests are processing, so I wanted to be sure.

Anything?

like image 924
RangerDan Avatar asked Oct 19 '22 19:10

RangerDan


1 Answers

This specific behavior was caused by a difference in the Content-Length label between Postman and Newman. Postman uses capitalized 'Content-Length' while Newman's node packages use lowercase 'content-length'. The process I was talking to did not recognize the lowercase version.

like image 61
RangerDan Avatar answered Oct 21 '22 22:10

RangerDan