Infisical / infisical

♾ Infisical is the open-source secret management platform: Sync secrets across your team/infrastructure, prevent secret leaks, and manage internal PKI
https://infisical.com
Other
15.03k stars 858 forks source link

healthcheck fails in standalone #1541

Open codedoga opened 6 months ago

codedoga commented 6 months ago

Describe the bug

Error: Cannot find module '/backend/healthcheck.js' in Standalone

To Reproduce

Steps to reproduce the behavior: Run standalone docker image and inspect.

"Health": {
            "Status": "unhealthy",
            "FailingStreak": 141,
            "Log": [
                {
                    "Start": "2024-03-08T11:04:17.614594958Z",
                    "End": "2024-03-08T11:04:17.749685042Z",
                    "ExitCode": 1,
                    "Output": "node:internal/modules/cjs/loader:1147\n  throw err;\n  ^\n\nError: Cannot find module '/backend/healthcheck.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)\n    at Module._load (node:internal/modules/cjs/loader:985:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)\n    at node:internal/main/run_main_module:28:49 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v20.11.1\n"
                },
                {
                    "Start": "2024-03-08T11:04:27.761521588Z",
                    "End": "2024-03-08T11:04:27.899014463Z",
                    "ExitCode": 1,
                    "Output": "node:internal/modules/cjs/loader:1147\n  throw err;\n  ^\n\nError: Cannot find module '/backend/healthcheck.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)\n    at Module._load (node:internal/modules/cjs/loader:985:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)\n    at node:internal/main/run_main_module:28:49 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v20.11.1\n"
                },
                {
                    "Start": "2024-03-08T11:04:37.90551501Z",
                    "End": "2024-03-08T11:04:38.007544426Z",
                    "ExitCode": 1,
                    "Output": "node:internal/modules/cjs/loader:1147\n  throw err;\n  ^\n\nError: Cannot find module '/backend/healthcheck.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)\n    at Module._load (node:internal/modules/cjs/loader:985:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)\n    at node:internal/main/run_main_module:28:49 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v20.11.1\n"
                },
                {
                    "Start": "2024-03-08T11:04:48.008183125Z",
                    "End": "2024-03-08T11:04:48.1012925Z",
                    "ExitCode": 1,
                    "Output": "node:internal/modules/cjs/loader:1147\n  throw err;\n  ^\n\nError: Cannot find module '/backend/healthcheck.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)\n    at Module._load (node:internal/modules/cjs/loader:985:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)\n    at node:internal/main/run_main_module:28:49 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v20.11.1\n"
                },
                {
                    "Start": "2024-03-08T11:04:58.102691505Z",
                    "End": "2024-03-08T11:04:58.259047422Z",
                    "ExitCode": 1,
                    "Output": "node:internal/modules/cjs/loader:1147\n  throw err;\n  ^\n\nError: Cannot find module '/backend/healthcheck.js'\n    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)\n    at Module._load (node:internal/modules/cjs/loader:985:27)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)\n    at node:internal/main/run_main_module:28:49 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v20.11.1\n"
                }
            ]
        }

Expected behavior

Either no healthcheck or the one that actually reports health status

Screenshots

-

Platform you are having the issue on:

Ampere Altra - Ubunutu 22.04 Apple M1, Apple M3 Pro (macOS 14.4)

Additional context

dirty fix for me is overriding healthcheck

FROM infisical/infisical:latest-postgres
HEALTHCHECK --interval=10s CMD exit 0
mihakrumpestar commented 6 months ago

I am also experiencing this.

Salman2301 commented 6 months ago

Looks like the file has been moved during pg migrations from healthcheck.js old location to ./frontend-build/scripts/healthcheck.js (Working directory is /backend). But having some trouble with redis trying to fix it on my end?