Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: could not load environment #3131

Open
damienrobson-sage opened this issue Jul 20, 2023 · 5 comments
Open

Error: could not load environment #3131

damienrobson-sage opened this issue Jul 20, 2023 · 5 comments

Comments

@damienrobson-sage
Copy link

  1. Newman Version (can be found via newman -v): 5.3.2
  2. OS details (type, version, and architecture): Ubuntu 22.04 x64 (GitHub Actions pipeline)
  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: Recently
  5. Expected behaviour: Newman runs with the correct environment.
  6. Command / script used to run Newman: newman run collection.js --environment config.json

When running locally (MacOS 13.4.1) the above command works fine. When I try and run it within a GitHub actions pipeline, the following error is shown:

error: could not load environment
  Trailing comma in array at 20:7
      ],
      ^

I've checked all of the files on our end but I can't track down the error anywhere, therefore I'm assuming the error is somewhere internal to newman.

@jcopperman
Copy link

jcopperman commented Oct 26, 2023

Would love to hear if you got any feedback on this @damienrobson-sage. I have the same issue only intermittently when running in a Github workflow with Postman CLI. And again, since it's intermittent and there are no logs I can't reproduce it :(

Run echo "result=1" >> $GITHUB_OUTPUT
Error: could not load environment
  Unexpected token '<' at 1:1
<html>
^

@Alan-Wales
Copy link

We've encountered this for quite some months using the postman cli. It's transitory and no other information to help debug it even in verbose mode (perhaps a trace id or similar would be useful)

@damienrobson-sage
Copy link
Author

@jcopperman unfortunately, no. It eventually went away of it's own volition and hasn't been seen since. Quite frustrating that there's been zero acknowledgement from the devs on this, too. I would close the issue but I think enough people keep coming a cropper with it that it should remain open and make as much noise as possible until it gets noticed

@CarlosPintoF
Copy link

Facing the same issue issue only intermittently when running in a Github workflow

@AnthonySteele-NewDay
Copy link

AnthonySteele-NewDay commented Jan 15, 2024

Same. Once or twice a day, on various different test runs in GitHub actions, we see:

$ newman run https://api.getpostman.com/collections/***?apikey=***  --otheroptions

error: could not load environment
Unexpected token '<' at 1:1
<html>
 ^

What this looks like is that the api.getpostman.com/collections endpoint has intermittent issues, there is no retry in the code that gets from it, and the end result is that our tests are flakey.

However we don't see more details of the response - the status code and response body would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants