Newman: TypeError: Cannot read property '0' of undefined on Docker postman/newman execution

Created on 19 Feb 2019  ·  1Comment  ·  Source: postmanlabs/newman

@kunagpal getting this error that is similar to issues: https://github.com/postmanlabs/newman/issues/1434 https://github.com/postmanlabs/newman/issues/1740, https://github.com/postmanlabs/newman/issues/885 BUT getting this via the container execution.

  1. Newman Version (can be found via newman -v): the one used in latest docker postman/newman image
  2. OS details (type, version, and architecture): containerized execution
  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: Today (19 February 2019)
  5. Expected behaviour: ?
  6. Command / script used to run Newman:
docker run -v $(pwd):/etc/newman \
-t postman/newman run /etc/newman/src/test.postman_collection.json \
--environment="/etc/newman/src/env/test.postman_environment.json" \
--reporters cli,junit,json \
--reporter-junit-export="newman-report.xml" \
--reporter-json-export="newman-report.json"
  1. Sample collection, and auxiliary files (minus the sensitive details):
    Sensitive.
  2. Screenshots (if applicable):
    Sensitive.

Getting the following error message:

/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/cell.js:60
    let fixedWidth = tableOptions.colWidths[this.x];
                                           ^

TypeError: Cannot read property '0' of undefined
    at Cell.mergeTableOptions (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/cell.js:60:44)
    at Table.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/table.js:27:14)
    at Array.forEach (<anonymous>)
    at Table.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/table.js:26:11)
    at Array.forEach (<anonymous>)
    at Table.toString (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/table.js:25:11)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/newman/lib/reporters/cli/index.js:87:22)
    at EventEmitter.emit (/usr/local/lib/node_modules/newman/node_modules/eventemitter3/index.js:203:33)
    at /usr/local/lib/node_modules/newman/lib/run/index.js:306:33
    at /usr/local/lib/node_modules/newman/node_modules/async/internal/once.js:12:16
    at iteratorCallback (/usr/local/lib/node_modules/newman/node_modules/async/eachOf.js:60:13)
    at /usr/local/lib/node_modules/newman/node_modules/async/internal/onlyOnce.js:12:16
    at /usr/local/lib/node_modules/newman/node_modules/async/dist/async.js:473:16
    at next (/usr/local/lib/node_modules/newman/node_modules/async/dist/async.js:5329:29)
    at /usr/local/lib/node_modules/newman/node_modules/async/dist/async.js:969:16
    at /usr/local/lib/node_modules/newman/lib/run/export-file.js:41:13

Edit:
Adding the --reporter-cli-no-summary does not "hide" the problem and I get also an error message:

/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/cell.js:60
    let fixedWidth = tableOptions.colWidths[this.x];
                                           ^

TypeError: Cannot read property '0' of undefined
    at Cell.mergeTableOptions (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/cell.js:60:44)
    at Table.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/table.js:27:14)
    at Array.forEach (<anonymous>)
    at Table.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/table.js:26:11)
    at Array.forEach (<anonymous>)
    at Table.toString (/usr/local/lib/node_modules/newman/node_modules/cli-table3/src/table.js:25:11)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/newman/lib/reporters/cli/index.js:87:22)
    at EventEmitter.emit (/usr/local/lib/node_modules/newman/node_modules/eventemitter3/index.js:203:33)
    at /usr/local/lib/node_modules/newman/lib/run/index.js:306:33
    at /usr/local/lib/node_modules/newman/node_modules/async/internal/once.js:12:16
    at iteratorCallback (/usr/local/lib/node_modules/newman/node_modules/async/eachOf.js:60:13)
    at /usr/local/lib/node_modules/newman/node_modules/async/internal/onlyOnce.js:12:16
    at /usr/local/lib/node_modules/newman/node_modules/async/dist/async.js:473:16
    at next (/usr/local/lib/node_modules/newman/node_modules/async/dist/async.js:5329:29)
    at /usr/local/lib/node_modules/newman/node_modules/async/dist/async.js:969:16
    at /usr/local/lib/node_modules/newman/lib/run/export-file.js:41:13

Most helpful comment

Removing the -t in the docker command fixed it.

Related comment on previous issue: https://github.com/postmanlabs/newman/issues/885#issuecomment-343039846

🤷‍♂️

>All comments

Removing the -t in the docker command fixed it.

Related comment on previous issue: https://github.com/postmanlabs/newman/issues/885#issuecomment-343039846

🤷‍♂️

Was this page helpful?
0 / 5 - 0 ratings