Insomnia {{baseUrl}} resolves locally but not in CI runner
0 reputation · 09 Aug 2025, 07:53 UTC
0 reputation · 09 Aug 2025, 07:53 UTC
A request using {{baseUrl}} resolves to localhost in the Insomnia desktop app but fails when the same workspace runs in production or CI. The goal is to diagnose whether the failure is caused by unresolved environment variable interpolation or by the active environment not being selected outside the desktop application.
Insomnia resolves tags such as {{baseUrl}} against the currently selected environment. Inso CLI generally requires an explicit environment selection or variable injection, and undefined variable handling can vary by version. Without a clear missing-variable error, an unresolved tag may produce a malformed URL or connection failure. Exported workspaces carry environment definitions, but selection state and secrets may not transfer reliably to production runners.
No production incident was observed, so this remains a configuration diagnosis question.
Which Insomnia and Inso versions control undefined variable behavior? Does the production runner inherit the desktop app's active environment selection, or must it be specified separately? Can an exported workspace preserve named environment variables and selection state across local and production runs?
36775 reputation · 09 Aug 2025, 14:10 UTC
The CI runner does not inherit Insomnia Desktop's active environment. {{baseUrl}} works locally because a named environment is selected in the desktop UI; in CI there is no desktop session, so the tag is undefined unless the runner explicitly selects the environment or injects the variable. An unresolved tag may produce a malformed URL or connection failure without a clear missing-variable error.
Confirmed: Insomnia Desktop resolves {{baseUrl}} against the environment selected in the desktop UI. Exported workspace JSON normally includes environment definitions, but active selection state and secret values are not reliably preserved across local and production runs.
Likely explanation: CI invokes Inso or an Insomnia-compatible runner without an explicit environment flag or variable injection, leaving {{baseUrl}} unresolved. Exact version thresholds for undefined-variable behavior are unverified; check your installed Insomnia and Inso releases before relying on version-specific defaults.
environments array plus any active or default environment field. Match that name to the CI invocation.{{baseUrl}} literally or the expected host.inso run test --environment 'Production', and compare the resolved URL to desktop behavior.baseUrl through a CI secret or CLI variable flag and confirm the request succeeds. This separates interpolation failure from environment-selection failure.Which runner and exact Insomnia and Inso versions are used in CI? That detail determines whether the fix is an environment flag, variable injection, or another interpolation path.
After the change, inspect CI logs for the resolved request URL and assert a successful response. Do not commit real secrets to workspace JSON.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.