supabase: Self-host: Storage API is not working (Docker container unhealthy)

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I self-host Supabase with Docker on my machine as per the instructions on Supabase Docs. After successfully composing, the containers supabase/storage-api:v1.0.6 and supabase/studio are in an unhealthy status. I can create buckets in the dashboard but fail to create folders in the bucket or upload files.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Follow the instructions on the Supabase self-hosting Docker guide.
  2. Run docker-compose up.
  3. Check the status of the containers supabase/storage-api and supabase/studio.
  4. Try creating a bucket, then attempt to create a folder in the bucket or upload a file.

Expected behavior

The supabase/storage-api and supabase/studio containers should be in a healthy status, allowing the creation of folders and uploading of files within buckets.

Screenshots

image

System information

  • Operating System: Ubuntu 22.04.4 LTS
  • Kernel: Linux 5.15.0-107-generic
  • Browser (if applies) Chrome
  • Version of Node.js: v20.11.1

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

for supabase/studio, I think it is because of the starting period

I went inside the docker container and command

$ node -e "require('http').get('http://localhost:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"

it gave me no error so i increased timeout in health check condition as below to fix unhealthy

supabase-studio:
  image: 'supabase/studio:20240422-5cf8f30'
  healthcheck:
    test:
      - CMD
      - node
      - '-e'
      - "require('http').get('http://localhost:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"
    timeout: 15s
    interval: 5s
    retries: 5
  depends_on:
    supabase-analytics:
      condition: service_healthy

However it doesn’t work with storage-api. I tried to debug the same way but got below result

/app # wget --no-verbose --tries=1 --spider http://localhost:5000/status
Connecting to localhost:5000 ([::1]:5000)
wget: can't connect to remote host: Connection refused

tks @bachkukkik, I use that version supabase/studio:20250113-83c9420 and it works.

for supabase/studio, I think it is because of the starting period

I went inside the docker container and command

$ node -e "require('http').get('http://localhost:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"

it gave me no error so i increased timeout in health check condition as below to fix unhealthy

supabase-studio:
  image: 'supabase/studio:20240422-5cf8f30'
  healthcheck:
    test:
      - CMD
      - node
      - '-e'
      - "require('http').get('http://localhost:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"
    timeout: 15s
    interval: 5s
    retries: 5
  depends_on:
    supabase-analytics:
      condition: service_healthy

However it doesn’t work with storage-api. I tried to debug the same way but got below result

/app # wget --no-verbose --tries=1 --spider http://localhost:5000/status
Connecting to localhost:5000 ([::1]:5000)
wget: can't connect to remote host: Connection refused

Just to revisit my previous attempt, as of now i manage to get both studio and storage services a status of healthy. Note that if tag latest doesn’t work, you may need to specify a tag for example supabase/studio:20250113-83c9420

  supabase-studio:
    image: 'supabase/studio:20250113-83c9420'
    healthcheck:
      test:
        [
          "CMD",
          "node",
          "-e",
          "fetch('http://localhost:3000/api/profile').then((r) => {if (r.status !== 200) throw new Error(r.status)})"
        ]
      timeout: 15s
      interval: 5s
      retries: 5

  supabase-storage:
    image: 'supabase/storage-api:latest'
    healthcheck:
      test:
        [
          "CMD",
          "node",
          "-e",
          "fetch('http://localhost:5000/status').then((r) => {if (r.status !== 200) throw new Error(r.status)})"
        ]
      timeout: 15s
      interval: 5s
      retries: 5

@encima I use the healthcheck command in the docker compose file for studio container and get this error:

image

@RoadToDev101 that is expected yes. the studio is accessible through “studio” but not localhost.