Newman "unable to read data from file" in CI
Newman tried to read a file argument (collection, environment, or data file) and could not. The path is resolved relative to the working directory of the step, which in CI is often not what you expect.
What this error means
newman exits with "unable to read data from file 'collection.json'" (or the environment/iteration file) and does not run any requests.
error: unable to read data from file "postman/collection.json"
ENOENT: no such file or directory, open 'postman/collection.json'Common causes
The path is wrong relative to the step working directory
CI runs from the repo root by default; a path that worked from a subfolder locally does not resolve the same way in the workflow step.
The file was not checked out or was in a different job
A collection generated in a prior job is not present unless uploaded and downloaded as an artifact, so Newman finds nothing at that path.
How to fix it
Point Newman at the correct path
- List the directory in the step to confirm the file is present.
- Use a path relative to the repo root, or set
working-directory. - Re-run so Newman reads the collection.
- run: ls -la postman
- run: newman run postman/collection.json -e postman/env.jsonFetch generated collections from artifacts
If a previous job produced the collection, download it before the Newman step so the file exists on disk.
- uses: actions/download-artifact@v4
with:
name: postman-collectionHow to prevent it
- Keep collection and environment files in the repo and reference them from root.
- Add an
lscheck before the run step while debugging paths. - Use
working-directoryinstead of fragile relative paths.