Skip to content

[BUG] Supabase domain returns "An invalid response was received from the upstream server" while Studio works on localhost #173

Description

@Sergo0999

Title: Supabase domain returns "An invalid response was received from the upstream server" while Studio works on localhost

Body:

Hi Cole,

first of all, thanks a lot for this package – I have it running successfully on my main server. I’m trying to set up a second server and hit a consistent problem specifically with the Supabase domain.

Environment

  • OS: fresh Ubuntu 24.04 (no previous Docker install)
  • Docker: Docker version 29.1.2, build 890dcca
  • Docker Compose: Docker Compose version v5.0.0
  • Repo: coleam00/local-ai-packaged, branch stable
  • Commit on both servers: abcb22375623b45cf6376f623b63d19108f45f30
    (git rev-parse HEAD on the new and the working server)
  • Supabase images on the working server (for reference):
    supabase/realtime v2.57.2
    supabase/edge-runtime v1.69.15
    supabase/postgres-meta v0.93.1
    supabase/studio 2025.10.27-sha-85b84e0
    supabase/storage-api v1.28.2
    supabase/supavisor 2.7.3
    supabase/logflare 1.22.6
    supabase/gotrue v2.180.0
    supabase/postgres 15.8.1.085
    kong 2.8.1[1]

Both servers are configured from the same .env (copied and only secrets/domains changed). On the main server everything works via domains, including Supabase.

.env (Supabase‑related)

On both servers I keep:

SUPABASE_PUBLIC_URL=http://localhost:8000
# (domains are set via *_HOSTNAME variables, e.g. N8N_HOSTNAME, SUPABASE_HOSTNAME, etc.)

I never changed SUPABASE_PUBLIC_URL to my domain on the working server.

What I did on the new server

  1. Clean install of Docker CE + compose plugin.
  2. git clone -b stable https://[github](https://github.com/coleam00/local-ai-packaged).com/coleam00/local-ai-packaged.git
  3. cp .env.example .env and filled all required variables (no @ in POSTGRES_PASSWORD, etc.).
  4. python3 start_services.py --profile cpu
  5. DNS A‑records for n8n.<my-domain> and supabase.<my-domain> point to the server IP.

Current state

  • On the server itself:

    • curl -v http://localhost:5678 → n8n HTML (200 OK).
    • curl -v http://localhost:3000 → Supabase Studio HTML (200 OK).[2][1]

    So n8n and Supabase Studio are both healthy locally.

  • From the browser via domains:

    • https://n8n.<my-domain> → n8n UI opens fine.

    • https://supabase.<my-domain> → I consistently get:

      {
        "message": "An invalid response was received from the upstream server"
      }

Kong logs

The relevant lines from docker logs supabase-kong | tail look like:

connect() failed (111: Connection refused) while connecting to upstream, client: ..., server: kong,
request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "supabase.<my-domain>"

So Kong is trying to reach 127.0.0.1:3000 and gets connection refused, while Supabase Studio is actually running and answering correctly on the container / localhost:3000 from inside the host.

What I already tried

  • Completely removed Docker and all data, reinstalled Docker CE and compose.
  • Deleted supabase/ and re‑ran start_services.py --profile cpu multiple times.
  • Switched the new server to the same commit as the working one:
    git checkout abcb22375623b45cf6376f623b63d19108f45f30
  • Verified that n8n and Supabase Studio respond with 200 on ports 5678 and 3000 on the host.
  • Restored SUPABASE_PUBLIC_URL=http://localhost:8000 exactly as on the working server.

Result: the behavior on the new server stays the same – Supabase Studio works on http://localhost:3000, but any request to https://supabase.<my-domain> returns the JSON error "An invalid response was received from the upstream server" from Kong.

Question

Is this expected with the current Supabase/Kong configuration in local-ai-packaged, or is there a known fix so that the Supabase domain is proxied correctly (either via Kong or directly to Supabase Studio) out of the box?

Any pointers which upstream / route needs to be adjusted (or which env var I might be missing) would be super helpful.

Thanks in advance!


1
2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions