You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our case this behavior raises a serious problem, because we cannot alter the variable in GitLab (otherwise the job would fail at a different place).
Generally speaking, this behavior is kind of stange, since a enviroment variable that is not managed by directus can contain arbitrary information.
For example: What happens if I set the environment variable TEST_FILE to a huge file.
To Reproduce
In our case - GitLab Configuration:
Assuming a working GitLab instance with CI/CD available
�[0;33m*** WARNING:�[0;m Service runner-75vys7d1-project-96-concurrent-0-ac8237f753d63b8a-directus__directus-1 probably didn't start properly.
Health check error:
start service container: Error response from daemon: Cannot link to a non running container: /runner-75vys7d1-project-96-concurrent-0-ac8237f753d63b8a-directus__directus-1 AS /runner-75vys7d1-project-96-concurrent-0-ac8237f753d63b8a-directus__directus-1-wait-for-service/service (docker.go:1153:1s)
Service container logs:
2022-05-13T09:34:55.886940797Z /directus/node_modules/directus/dist/env.js:190
2022-05-13T09:34:55.886961697Z throw new Error(Failed to read value from file "${value}", defined in environment variable "${key}".);
2022-05-13T09:34:55.886965574Z ^
2022-05-13T09:34:55.886967868Z
2022-05-13T09:34:55.886970022Z Error: Failed to read value from file "-----BEGIN CERTIFICATE-----
2022-05-13T09:34:55.886972327Z ****************************************************************
2022-05-13T09:34:55.886974541Z ****************************************************************
2022-05-13T09:34:55.886976715Z ****************************************************************
2022-05-13T09:34:55.886978879Z ****************************************************************
2022-05-13T09:34:55.886981103Z ****************************************************************
2022-05-13T09:34:55.886983417Z ****************************************************************
2022-05-13T09:34:55.886985582Z ****************************************************************
2022-05-13T09:34:55.886987726Z THE WHOLE CERTIFICATE CHAIN**
2022-05-13T09:34:55.886989910Z ****************************************************************
2022-05-13T09:34:55.886992094Z ****************************************************************
2022-05-13T09:34:55.886994288Z ****************************************************************
2022-05-13T09:34:55.886996442Z ****************************************************************
2022-05-13T09:34:55.886998636Z ****************************************************************
2022-05-13T09:34:55.887000780Z ****************************************************************
2022-05-13T09:34:55.887002944Z ****************************************************************
2022-05-13T09:34:55.887005178Z ****************************************************************
2022-05-13T09:34:55.887175700Z -----END CERTIFICATE-----", defined in environment variable "CI_SERVER_TLS_CA_FILE".
2022-05-13T09:34:55.887178134Z at processValues (/directus/node_modules/directus/dist/env.js:190:23)
2022-05-13T09:34:55.887180389Z at Object. (/directus/node_modules/directus/dist/env.js:96:7)
2022-05-13T09:34:55.887183274Z at Module._compile (node:internal/modules/cjs/loader:1105:14)
2022-05-13T09:34:55.887185789Z at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
2022-05-13T09:34:55.887188083Z at Module.load (node:internal/modules/cjs/loader:981:32)
2022-05-13T09:34:55.887190267Z at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-05-13T09:34:55.887192501Z at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-05-13T09:34:55.887194716Z at require (node:internal/modules/cjs/helpers:102:18)
2022-05-13T09:34:55.887196890Z at Object. (/directus/node_modules/directus/dist/cache.js:9:31)
2022-05-13T09:34:55.887199234Z at Module._compile (node:internal/modules/cjs/loader:1105:14)
What version of Directus are you using?
9.10.0
What version of Node.js are you using?
Use of Docker Image directus/directus:9
What database are you using?
Postgres 14
What browser are you using?
none - ci/cd pipeline
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered:
Describe the Bug
When running a GitLab CI/CD Pipeline, the runner contains a lot of environemt variables: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html.
On of those is:
CI_SERVER_TLS_CA_FILE
Directus behavior is to read the file contents if the key ends with _FILE:
directus/api/src/env.ts
Line 221 in c30b041
In our case this behavior raises a serious problem, because we cannot alter the variable in GitLab (otherwise the job would fail at a different place).
Generally speaking, this behavior is kind of stange, since a enviroment variable that is not managed by directus can contain arbitrary information.
For example: What happens if I set the environment variable TEST_FILE to a huge file.
To Reproduce
In our case - GitLab Configuration:
Errors Shown
�[0;33m*** WARNING:�[0;m Service runner-75vys7d1-project-96-concurrent-0-ac8237f753d63b8a-directus__directus-1 probably didn't start properly.
Health check error:
start service container: Error response from daemon: Cannot link to a non running container: /runner-75vys7d1-project-96-concurrent-0-ac8237f753d63b8a-directus__directus-1 AS /runner-75vys7d1-project-96-concurrent-0-ac8237f753d63b8a-directus__directus-1-wait-for-service/service (docker.go:1153:1s)
Service container logs:
2022-05-13T09:34:55.886940797Z /directus/node_modules/directus/dist/env.js:190
2022-05-13T09:34:55.886961697Z throw new Error(
Failed to read value from file "${value}", defined in environment variable "${key}".
);2022-05-13T09:34:55.886965574Z ^
2022-05-13T09:34:55.886967868Z
2022-05-13T09:34:55.886970022Z Error: Failed to read value from file "-----BEGIN CERTIFICATE-----
2022-05-13T09:34:55.886972327Z ****************************************************************
2022-05-13T09:34:55.886974541Z ****************************************************************
2022-05-13T09:34:55.886976715Z ****************************************************************
2022-05-13T09:34:55.886978879Z ****************************************************************
2022-05-13T09:34:55.886981103Z ****************************************************************
2022-05-13T09:34:55.886983417Z ****************************************************************
2022-05-13T09:34:55.886985582Z ****************************************************************
2022-05-13T09:34:55.886987726Z THE WHOLE CERTIFICATE CHAIN**
2022-05-13T09:34:55.886989910Z ****************************************************************
2022-05-13T09:34:55.886992094Z ****************************************************************
2022-05-13T09:34:55.886994288Z ****************************************************************
2022-05-13T09:34:55.886996442Z ****************************************************************
2022-05-13T09:34:55.886998636Z ****************************************************************
2022-05-13T09:34:55.887000780Z ****************************************************************
2022-05-13T09:34:55.887002944Z ****************************************************************
2022-05-13T09:34:55.887005178Z ****************************************************************
2022-05-13T09:34:55.887175700Z -----END CERTIFICATE-----", defined in environment variable "CI_SERVER_TLS_CA_FILE".
2022-05-13T09:34:55.887178134Z at processValues (/directus/node_modules/directus/dist/env.js:190:23)
2022-05-13T09:34:55.887180389Z at Object. (/directus/node_modules/directus/dist/env.js:96:7)
2022-05-13T09:34:55.887183274Z at Module._compile (node:internal/modules/cjs/loader:1105:14)
2022-05-13T09:34:55.887185789Z at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
2022-05-13T09:34:55.887188083Z at Module.load (node:internal/modules/cjs/loader:981:32)
2022-05-13T09:34:55.887190267Z at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-05-13T09:34:55.887192501Z at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-05-13T09:34:55.887194716Z at require (node:internal/modules/cjs/helpers:102:18)
2022-05-13T09:34:55.887196890Z at Object. (/directus/node_modules/directus/dist/cache.js:9:31)
2022-05-13T09:34:55.887199234Z at Module._compile (node:internal/modules/cjs/loader:1105:14)
What version of Directus are you using?
9.10.0
What version of Node.js are you using?
Use of Docker Image directus/directus:9
What database are you using?
Postgres 14
What browser are you using?
none - ci/cd pipeline
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: