postmanlabs / newman

Newman is a command-line collection runner for Postman
https://www.postman.com
Apache License 2.0
6.86k stars 1.16k forks source link

Newman doesn't appear to be able to download Postman Collections in Node 12 #1991

Closed deltamualpha closed 5 years ago

deltamualpha commented 5 years ago
  1. Newman Version (can be found via newman -v): 4.4.1
  2. OS details (type, version, and architecture): macOS 10.14.4; node 12.1.0
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: New installation
  5. Expected behaviour: It runs a collection
  6. Command / script used to run Newman: newman run https://raw.githubusercontent.com/heremaps/postman-collections/master/weather.postman_collection
  7. Sample collection, and auxiliary files (minus the sensitive details):
  8. Screenshots (if applicable):

Node 12.1.0:

$ newman run https://raw.githubusercontent.com/heremaps/postman-collections/master/weather.postman_collection
newman: Newman v4 deprecates support for the v1 collection format
  Use the Postman Native app to export collections in the v2 format

newman

Weather API

→ Severe Weather Alerts
_tls_wrap.js:513
  self._destroySSL();
       ^

TypeError: Cannot read property '_destroySSL' of undefined
    at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:513:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

Node 10:

$ newman run https://raw.githubusercontent.com/heremaps/postman-collections/master/weather.postman_collection
newman: Newman v4 deprecates support for the v1 collection format
  Use the Postman Native app to export collections in the v2 format

newman

Weather API

→ Severe Weather Alerts
  GET https://weather.cit.api.here.com/weather/1.0/report.json?product=alerts&name=Chicago&app_id={{YOUR_APP_ID}}&app_code={{YOUR_APP_CODE}} [401 Unauthorized, 550B, 156ms]
... etc etc etc

Node 12:

$ newman run weather.postman_collection
newman: Newman v4 deprecates support for the v1 collection format
  Use the Postman Native app to export collections in the v2 format

newman

Weather API

→ Severe Weather Alerts
  GET https://weather.cit.api.here.com/weather/1.0/report.json?product=alerts&name=Chicago&app_id={{YOUR_APP_ID}}&app_code={{YOUR_APP_CODE}} [401 Unauthorized, 550B, 137ms]
... etc etc etc
deltamualpha commented 5 years ago

(Original issue wasn't encountered with the weather collection, but it showcases identical behavior.)

deltamualpha commented 5 years ago

Ah, running them from a local file succeeds.

ousmaneNdiaye commented 5 years ago

Since three days, all my Newman builds on CircleCi fail with the error 😭 :

       ^
TypeError: Cannot read property '_destroySSL' of undefined
    at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:513:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

On my setup the collection file is not donwloaded but already in the project (running the tests from local works fine).


I found a solution to fix it on CircleCi, sticking node to the lts version :

#.circleci/config.yml
version: 2.1
jobs:
    build:
        docker:
        - image: circleci/node:lts
[...]
Exodus commented 5 years ago

I'm having the same issue with the current latest version in homebrew:

node --version
v12.1.0

When running:

newman run https://api.getpostman.com/collections/<redacted>\?apikey\=<redacted> --environment https://api.getpostman.com/environments/<redacted>\?apikey\=<redacted>

Output:

_tls_wrap.js:513
  self._destroySSL();
       ^

TypeError: Cannot read property '_destroySSL' of undefined
    at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:513:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

Downgrading to the LTS version (v10.15.3) runs the collection without issue.

shamasis commented 5 years ago

Yep. We are observing anomalies with Node12. @codenirvana - maybe we can put some of our observations updated here.

I suggest downgrading to node 11 / 10 - until we figure out what changed in 12.

MauriceS commented 5 years ago

I observed the same problem in Bitbucket Pipelines, Newman 4.4.1, and latest node image in Bitbucket Pipelines. It failed in the middle of the test (after 300 of 905 tests). Specifying Node 10.15 fixed the problem.

_tls_wrap.js:534 self._destroySSL(); ^ TypeError: Cannot read property '_destroySSL' of undefined at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:534:8) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7)

codenirvana commented 5 years ago

This is fixed in Newman v4.5.0

juchom commented 5 years ago

Issue is still present in 4.5.0, my tests are working fine and then this exception appears:

TypeError: Cannot read property '_destroySSL' of undefined
    at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:534:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)
PS C:\Users\Administrator> newman -v
4.5.0
janniswarnat commented 5 years ago

I am also still getting the error with newman 4.5.0 and Node version v12.2.0:

_tls_wrap.js:534
  self._destroySSL();
       ^

TypeError: Cannot read property '_destroySSL' of undefined
    at Timeout.destroySSL [as _onTimeout] (_tls_wrap.js:534:8)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

Not sure if this is relevant: In my case it comes up when querying a URL with a self-signed SSL certificate. Can this issue be re-opened or should @juchom or I open a fresh issue?

Best regards

Jannis

shamasis commented 5 years ago

Are you facing issue while fetching collection from url or while running a collection that has this url? @codenirvana if @janniswarnat says it’s the latter, then let’s track that as a separate issue

janniswarnat commented 5 years ago

A test inside a local collection fails. I will try to reproduce the error with a minimal example and open a new issue.

janniswarnat commented 5 years ago

New issue has been created with info on how to reproduce:

2015

Update to one of my comments: The error is not related to self-signed certificates.

csvan commented 5 years ago

Confirming that downgrading from nodejs 12.2 to 10.15 solves this issue for me (see repro: https://github.com/postmanlabs/newman/issues/2015#issuecomment-495893273)

testerncoder commented 4 years ago

I am still getting the same issue while generating the URL via sharing collection: newman: Newman v4 deprecates support for the v1 collection format Use the Postman Native app to export collections in the v2 format