Skip to content

[Bug]: Confusing environment variable configuration #7441

@jeanniton-mnr

Description

@jeanniton-mnr

Error Message and Logs

I just want to bring to your attention the missing documentation or the confusion between a project environment, a resource's production and preview environment variables.

I only set the environment variables under the preview deployment environment variables fields; I was deploying an app in / as preview.

However, my application / node.js process would not access my environment variables, and the container of my app would constantly restart because it would fail the health-check.

After long hours of debugging, I realized that Coolify never pulled / set the environment variables that I defined under the preview deployment environment variables, but it would pull / set the environment variables when i defined them, upper, under the production environment variables.

Then, they were accessible in my node.js application (through process.env.VARIABLE_NAME).

I originally thought that the preview environment variables section was my thing since this was how I name the environment I was working on for this project.

So in order to prevent someone else experiencing the same confusion / issue, I am bringing this to your attention.

Please reference the recorded video for visual explanation / extra clarification:

blured_520859039-d61764fd-0682-4ac0-b478-89d3047f9eb7_blurred.mp4

Thank you !

Steps to Reproduce

  1. Create a project
  2. Create an new environment name preview for this project
  3. Create a new application / resource, in my case a NODE.JS API, and that read an environment variable during runtime
  4. Define this environment variable under Deployment preview environment variables
  5. Deploy this application
  6. It would not be able to reference any environment variable under the preview environment.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.451

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions