Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.87k stars 1.97k forks source link

Chaining requests do not work with CLI #6059

Open leoneperdigao opened 1 year ago

leoneperdigao commented 1 year ago

Expected Behavior

I have several endpoints to be tested, and some of them require authorisation. For all these endpoints, I configured the Bearer authentication with the token as a response body of the auth endpoint.

Example: Screenshot 2023-06-26 at 18 22 53

Screenshot 2023-06-26 at 18 27 45

Actual Behavior

The request chaining works smoothly in the Desktop app. However, in the CLI, this just do not work whatsoever. No matter how the requests are configured, I always the the following error:

     Error: Failed to render request: req_27dfd3974975476b8b784862b31b667a
      at tryToInterpolateRequest (/snapshot/insomnia/packages/insomnia-send-request/dist/index.js)
      at async Insomnia.sendRequest (/snapshot/insomnia/packages/insomnia-send-request/dist/index.js)
      at async Insomnia.send (/snapshot/insomnia/packages/insomnia-testing/dist/run/insomnia.js)
      at async Context.<anonymous> (/private/var/folders/v6/w38rpl2n1c3gkdh99s9tlxjm0000gn/T/insomnia-testing/0.5999570703761101-test.ts:79:22)

I already tried to use the tags in the environment, authorisation and headers, and all of them results in the same behaviour.

Reproduction Steps

Is there an existing issue for this?

Additional Information

I also tried to run it in a pipeline (linux ubuntu 22.04.2 LTS), but it results in the very same problem.

Insomnia Version

3.16.0

What operating system are you using?

macOS

Operating System Version

Apple M1 Max - Ventura 13.4.1 (22F82)

Installation method

homebrew

Last Known Working Insomnia version

No response

ndbroadbent commented 1 year ago

I'm having a similar problem with the CLI with a chained request that works fine in the Mac desktop. In my case it's unable to resolve the host name for a dependent request. The same test works fine when it's run normally.

     Error: Failed to send dependent request Error: Couldn't resolve host name
      at /snapshot/insomnia/packages/insomnia-send-request/dist/index.js
      at /snapshot/insomnia/packages/insomnia-send-request/dist/index.js
      at RawTask.call (/snapshot/insomnia/packages/insomnia-send-request/dist/index.js)
      at flush (/snapshot/insomnia/packages/insomnia-send-request/dist/index.js)
      at Timeout.handleTimer (/snapshot/insomnia/packages/insomnia-send-request/dist/index.js)
      at listOnTimeout (node:internal/timers:564:17)
      at process.processTimers (node:internal/timers:507:7)

Not sure if this is related