Code Monkey home page Code Monkey logo

Comments (10)

bachkukkik avatar bachkukkik commented on July 28, 2024 2

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

from supabase.

encima avatar encima commented on July 28, 2024 1

@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.

from supabase.

encima avatar encima commented on July 28, 2024

Thanks for opening @RoadToDev101
This is a bug in the self-hosted docker-compose as the storage api seems not to listen on localhost, so it reports as unhealthy when it is fine.
This can be confirmed with docker logs $STORAGE_CONTAINER_ID

We will make a PR to address this. That said, the issue of not being able to create folders cannot be reproduced, can you provide logs from the storage container, please?

from supabase.

RoadToDev101 avatar RoadToDev101 commented on July 28, 2024

Hi @encima,

This is the log I get from the storage container when render the storage page on dashboard and create a new bucket name 'design_views'

{"level":30,"time":"2024-06-18T01:26:18.129Z","pid":1,"hostname":"a122cace4088","msg":"Server listening at http://0.0.0.0:5000"} {"level":30,"time":"2024-06-18T01:28:10.474Z","pid":1,"hostname":"a122cace4088","reqId":"req-1","tenantId":"stub","project":"stub","reqId":"req-1","type":"request","req":{"traceId":"req-1","method":"GET","url":"/bucket","headers":{"host":"storage:5000","x_forwarded_proto":"http","x_forwarded_host":"kong","x_forwarded_port":"8000","x_real_ip":"192.168.48.11","x_client_info":"supabase-js-node/2.41.1","accept":"*/*","user_agent":"node"},"hostname":"storage:5000","remoteAddress":"192.168.48.12","remotePort":43888},"res":{"statusCode":200,"headers":{"content_type":"application/json; charset=utf-8","content_length":"2"}},"responseTime":40.07513475418091,"msg":"stub | GET | 200 | 192.168.48.12 | req-1 | /bucket | node"} {"level":30,"time":"2024-06-18T01:28:26.236Z","pid":1,"hostname":"a122cace4088","reqId":"req-2","tenantId":"stub","project":"stub","reqId":"req-2","type":"request","req":{"traceId":"req-2","method":"POST","url":"/bucket","headers":{"host":"storage:5000","x_forwarded_proto":"http","x_forwarded_host":"kong","x_forwarded_port":"8000","x_real_ip":"192.168.48.11","content_length":"107","content_type":"application/json","x_client_info":"supabase-js-node/2.41.1","accept":"*/*","user_agent":"node"},"hostname":"storage:5000","remoteAddress":"192.168.48.12","remotePort":53754},"res":{"statusCode":200,"headers":{"content_type":"application/json; charset=utf-8","content_length":"23"}},"responseTime":131.50732326507568,"msg":"stub | POST | 200 | 192.168.48.12 | req-2 | /bucket | node"} {"level":30,"time":"2024-06-18T01:28:26.252Z","pid":1,"hostname":"a122cace4088","reqId":"req-3","tenantId":"stub","project":"stub","reqId":"req-3","type":"request","req":{"traceId":"req-3","method":"GET","url":"/bucket","headers":{"host":"storage:5000","x_forwarded_proto":"http","x_forwarded_host":"kong","x_forwarded_port":"8000","x_real_ip":"192.168.48.11","x_client_info":"supabase-js-node/2.41.1","accept":"*/*","user_agent":"node"},"hostname":"storage:5000","remoteAddress":"192.168.48.12","remotePort":53754},"res":{"statusCode":200,"headers":{"content_type":"application/json; charset=utf-8","content_length":"200"}},"responseTime":5.60968017578125,"msg":"stub | GET | 200 | 192.168.48.12 | req-3 | /bucket | node"} {"level":30,"time":"2024-06-18T01:28:26.349Z","pid":1,"hostname":"a122cace4088","reqId":"req-4","tenantId":"stub","project":"stub","reqId":"req-4","type":"request","req":{"traceId":"req-4","method":"POST","url":"/object/list/design_views","headers":{"host":"storage:5000","x_forwarded_proto":"http","x_forwarded_host":"kong","x_forwarded_port":"8000","x_real_ip":"192.168.48.11","content_length":"89","content_type":"application/json","x_client_info":"supabase-js-node/2.41.1","accept":"*/*","user_agent":"node"},"hostname":"storage:5000","remoteAddress":"192.168.48.12","remotePort":53754},"res":{"statusCode":200,"headers":{"content_type":"application/json; charset=utf-8","content_length":"2"}},"responseTime":7.82005500793457,"msg":"stub | POST | 200 | 192.168.48.12 | req-4 | /object/list/design_views | node"}

After that, I try to create a new folder in this bucket, the frontend shows that it created but when I reload, the folder is not there (I think it is not actually create the folder). And when I try uploading the file, it just spinning forever. And in these 2 actions, there is no log in the storage container.

image

Plus the studio container also unhealthy, but when check the log, it seems there is no problem. I hope this help.

image

from supabase.

encima avatar encima commented on July 28, 2024

thanks @RoadToDev101 , those logs show success for the storage requests so that certainly is weird!
Is there some issue with the volume mounting? Are you able to create a folder when you call the storage API directly?

from supabase.

RoadToDev101 avatar RoadToDev101 commented on July 28, 2024

Hi @encima,

I try to fetch the bucket api on Postman but I cant due to "Invalid authentication credentials". I try both Anon and Service Key for authorization. See the image below

image

The jwt in .env :
JWT_SECRET=girSzUKW1c937xjnJhKhuqLLM4WPIjNXrV8Odvra ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzE4NjQzNjAwLAogICJleHAiOiAxODc2NDEwMDAwCn0.STjbgWo03Cn8SRaRAn2bqw0M1io-k6g8GJkHAeUwXY4 SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogInNlcnZpY2Vfcm9sZSIsCiAgImlzcyI6ICJzdXBhYmFzZSIsCiAgImlhdCI6IDE3MTg2NDM2MDAsCiAgImV4cCI6IDE4NzY0MTAwMDAKfQ.aq4Nv_JAsUJAJxwvr5Ro6GDyXVbyoGb9ij2UN40kJ_Y

Am I do it wrong?

image

from supabase.

RoadToDev101 avatar RoadToDev101 commented on July 28, 2024

@encima, so strange... I can upload the image through my NodeJS app.

image

from supabase.

encima avatar encima commented on July 28, 2024

@RoadToDev101 thanks for the update. so it works using the supabase client is that right? does it still fail with the dashboard?

from Postman, it looks like the credentials are probably failing due to them being incorrectly encoded or not picked up properly.

from supabase.

encima avatar encima commented on July 28, 2024

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

Are you connecting to storage from within the studio container? Either way, localhost will not work as it is not exposed there (unless on the storage container). You can use the same command but use studio instead of localhost

from supabase.

RoadToDev101 avatar RoadToDev101 commented on July 28, 2024

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

from supabase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.