Skip to content

Podman complains about health check syntax errors #2532

Closed

Description

@thenbe

There are two containers where the healthcheck fails in podman due to a syntax error, studio and pgmeta.

  1. pgmeta

Test: []string{"CMD", "node", `--eval='fetch("http://127.0.0.1:8080/health").then((r) => {if (r.status !== 200) throw new Error(r.status)})'`},

  1. studio

Test: []string{"CMD", "node", `--eval='fetch("http://127.0.0.1:3000/api/profile", (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})'`},

When I change these two lines to a noop, the containers start successfully. For example:

-					Test:     []string{"CMD", "node", `--eval='fetch("http://127.0.0.1:8080/health").then((r) => {if (r.status !== 200) throw new Error(r.status)})'`},
+					Test:     []string{"CMD", "node", `--version`},

Log (it's not pretty):

Health:
  FailingStreak: 2

  Log:

  - End: 2024-07-18T20:19:42.26441464+03:00
    ExitCode: 1
    Output: "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n
alScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
    Start: 2024-07-18T20:19:42.236295233+03:00

  - End: 2024-07-18T20:19:52.356312244+03:00
    ExitCode: 1
    Output: "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n
alScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
    Start: 2024-07-18T20:19:52.328284657+03:00

Ref: #2359

Activity

  1. sweatybridge commented on Jul 24, 2024

    @sweatybridge
    Contributor

    Could you report the podman version you are using? It seems fine on 5.0.2 based on the linked PR.

  2. thenbe commented on Jul 24, 2024

    @thenbe
    Author
    $ podman version
    Client:       Podman Engine
    Version:      5.1.2
    API Version:  5.1.2
    Go Version:   go1.22.5
    Built:        Tue Jan  1 03:00:00 1980
    OS/Arch:      linux/amd64
    
  3. thenbe commented on Jul 24, 2024

    @thenbe
    Author

    supabase-cli version: https://github.com/supabase/cli/tree/v1.187.3

    Better error logs:

    $ docker inspect --format '{{json .State.Health.Log}}' supabase_studio | jq
    [
      {
        "Start": "2024-07-24T11:48:20.066311323+03:00",
        "End": "2024-07-24T11:48:20.091714699+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:48:30.53996185+03:00",
        "End": "2024-07-24T11:48:30.564893597+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:48:41.071457477+03:00",
        "End": "2024-07-24T11:48:41.098401621+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:48:51.505640018+03:00",
        "End": "2024-07-24T11:48:51.582004828+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:49:02.012091056+03:00",
        "End": "2024-07-24T11:49:02.100969895+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:3000/api/profile\",\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      }
    ]
    
    $ docker inspect --format '{{json .State.Health.Log}}' supabase_pg_meta | jq
    [
      {
        "Start": "2024-07-24T11:48:30.490298743+03:00",
        "End": "2024-07-24T11:48:30.548112957+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:8080/health\").then((r)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:48:41.02117516+03:00",
        "End": "2024-07-24T11:48:41.086385686+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:8080/health\").then((r)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:48:51.54351294+03:00",
        "End": "2024-07-24T11:48:51.567904231+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:8080/health\").then((r)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:49:01.971229376+03:00",
        "End": "2024-07-24T11:49:02.022228162+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:8080/health\").then((r)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      },
      {
        "Start": "2024-07-24T11:49:12.526756454+03:00",
        "End": "2024-07-24T11:49:12.627659198+03:00",
        "ExitCode": 1,
        "Output": "[eval]:1\n'fetch(\"http://127.0.0.1:8080/health\").then((r)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSyntaxError: Invalid or unexpected token\n    at makeContextifyScript (node:internal/vm:185:14)\n    at node:internal/process/execution:107:22\n    at [eval]-wrapper:6:24\n    at runScript (node:internal/process/execution:101:62)\n    at evalScript (node:internal/process/execution:133:3)\n    at node:internal/main/eval_string:51:3\n\nNode.js v20.15.0"
      }
    ]
    
  4. arvalaan commented on Sep 3, 2024

    @arvalaan
    Contributor

    Experiencing this as well on a fresh installation of everything.

    Windows 11 (PowerShell)
    Supabase CLI 1.191.3
    Podman 5.2.2

    Starting Supabase with --ignore-health-check allows for everything to work properly.

  5. sweatybridge commented on Sep 11, 2024

    @sweatybridge
    Contributor

    should be resolved by #2656 in npx supabase@beta start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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