/api/* routs always return 500

Hello i have tried to host supabase locally everything seems to be working except from supabase studio i keep getting 500 errors on /api/* routs which cause almost everything there to not function. i have tried to setup everything such that the connections string rather than being kong:8000 swapped it to localhost:8000 in environment variables but still the same issue. also tried recreating anon and service keys. but still same issue. am not sure if it is an issue of used services but here is my docker compose EDIT: deployment is done through coolify




172 Replies
inder
inder4d ago
Acc. to your compose file, SUPABASE_URLenv passed to studio service needs to be http://supabase-kong:8000 make sure to recreate studio container for changes to take place and refresh page in browser
Artist201
Artist201OP4d ago
it was as such i believe and i changed it but still doesn't work am going to try again now.
inder
inder4d ago
No it isn't the default. You have changed the kong service name and acc.to that the value needs to be what I mentioned above
Artist201
Artist201OP4d ago
am deploying through coolify, defaults are alittle different. just all services and their connection strings are renamed to supabase-*
inder
inder4d ago
Please always mention how you're self-hosting in original post. The value I mention should work but if you want to modify it later, you can use the randomized pattern they use
Artist201
Artist201OP4d ago
same issue
No description
No description
inder
inder4d ago
Did you take down studio and up again?
Artist201
Artist201OP4d ago
on all services. i did click on coolify "stop" and then "deploy" again am assuming it is doing the same
inder
inder4d ago
you can inspect the running container's env vars just to be sure Run docker ps --format={{.Names}} | grep studio
docker inspect <container_name> | jq .[].Config.Env
docker inspect <container_name> | jq .[].Config.Env
Artist201
Artist201OP4d ago
yup it is there
Artist201
Artist201OP4d ago
No description
inder
inder4d ago
Let me test it on my end. will get back to you
Artist201
Artist201OP4d ago
when going inside the container and using env or printenv i see none of the variable is this expected ?
inder
inder4d ago
I have a old studio img version and I see envs are printed. Haven't tested with the image version you're using
Artist201
Artist201OP4d ago
i can test with it, which one are you using ? i just copied the versions from supabase/docker github
inder
inder4d ago
its quite old on my local system supabase/studio:2025.08.04-sha-6e99ca6 @Artist201 Oh wait I think I found the issue
Artist201
Artist201OP4d ago
o,o
inder
inder4d ago
just confirming!
Artist201
Artist201OP4d ago
btw i just tested your studio version tables are working but the storage page isn't
No description
inder
inder4d ago
I looked at your screenshots, the api routes you face error on use STUDIO_PG_META_URL. Its something to do with the latest img version you're using because in the newer version of studio, it passes a connection string to pgmeta and I'm guessing the request is going to pgmeta service something is happening there. I'm setting up a coolify instance.
Artist201
Artist201OP4d ago
though it seems like an issue in the bucket
No description
inder
inder4d ago
When setting up your project on coolify, did you only update the image versions or something else as well? I'm trying to reproduce error.
Artist201
Artist201OP4d ago
hmmmm recreated my JWTSECRET and anonkey, servicekey and change the docker compose kong version and setup user as root otherwise it never functions ( wasted 2 days on this ) added port expose on kong ( you should just copy my whole kong service ) i think that's it
inder
inder4d ago
I will use the coolify template and match your image versions
Artist201
Artist201OP4d ago
alright i hope kong works X_x also am not sure if there is any need for recreating the secret and keys also be aware if you are using coolify with remote host not running as root you might face an endless number of permissions issues. if it is a local setup (coolify and the hosting server are on the same machine) all should be good i recreated everyhing to test the buckets seems to be working upload though fails but probably cause it is trying to use a domain rather than the IP so now am trying to give the site a domain and see if it functions properly
inder
inder4d ago
This is with old studio, right?
Artist201
Artist201OP4d ago
yes your version
inder
inder4d ago
It should work with ip as well. Make sure your SUPABASE_PUBLIC_URL env var is set to the ip address you're accessing studio on In coolify environment variables, its this env SERVICE_URL_SUPABASEKONG
inder
inder4d ago
Yeah its related to what I mentioned here
No description
inder
inder4d ago
In newer versions studio sends a db connection string to pgmeta service and it can't connect to db with the default values
Artist201
Artist201OP4d ago
yeah am seeing this weird thing in coolify
No description
Artist201
Artist201OP4d ago
No description
inder
inder4d ago
Its the domain coolify sets up instance on by default. You're running this locally, right? you're accesing this on an ipaddress like 192.x.x.x:8100? nevermind, saw your screenshot
Artist201
Artist201OP4d ago
yeah it is just using the wrong env so am just changing the compose no to reflect that waiting for it to deploy
inder
inder4d ago
this SUPABASE_PUBLIC_URL needs to be your ip This however is not the solution to your original problem its only your storage solution
Artist201
Artist201OP4d ago
interesting.. but why X_x yup the newer version doesn't work btw setup dozzle when reading logs it will make your life easier .. 😄
Artist201
Artist201OP4d ago
No description
inder
inder4d ago
I've used it in past but I usually use lazydocker. Don't have to switch between windows I'll explain this just checking if the solution I am applying works @Artist201 Add these env vars in studio service
- POSTGRES_PORT=5432
- POSTGRES_HOST=supabase-db
- POSTGRES_DB=postgres
- POSTGRES_PORT=5432
- POSTGRES_HOST=supabase-db
- POSTGRES_DB=postgres
This should solve your issue with latest studio version Explanation: https://github.com/supabase/supabase/issues/39593#issuecomment-3484722959 https://github.com/supabase/supabase/issues/39593#issuecomment-3485343711 And this was the PR: https://github.com/supabase/supabase/pull/40169
Artist201
Artist201OP4d ago
Nice ! thanks alot ! gonna try this after i resolve the upload issue X_X even after fixing the domain it still fails but fails weirdly there is no response code
inder
inder4d ago
Check your browser's local storage if there are failed upload entries present it usually stores them and tries to upload to the url which failed previously Is the upload being made to the old url again?
Artist201
Artist201OP4d ago
no the new one which am accessing from
inder
inder4d ago
share a screenshot
Artist201
Artist201OP4d ago
oh i thought i sent it
Artist201
Artist201OP4d ago
No description
Artist201
Artist201OP4d ago
it doesn't even show the used method very weird...
Artist201
Artist201OP4d ago
postman
No description
inder
inder4d ago
And what happens when you make request from browser directly in url input? Does it show 404?
Artist201
Artist201OP4d ago
this
inder
inder4d ago
directly in url input. Not a fetch request.
Artist201
Artist201OP4d ago
same
inder
inder4d ago
if postman can correctly make request, don't know why browser can't Weren't you accessing this project with ip address? have you set entries in hosts file?
Artist201
Artist201OP4d ago
my machine have a cf tunnel so i just gave it a domain to test what production issues i might have and am testing from it everything is working except the upload wait my env variables might be bugged let me test something
inder
inder4d ago
Could it be a CORS issue? That would explain why it is passing in postman but not on browser
Artist201
Artist201OP4d ago
in the browser and post man it gives the same result except from that fetch returns nothing shouldn't be cors thoguh cause it is the same domain
inder
inder4d ago
oh ok, I thought you only set tunnel url for env var But in the postman, you do get route not found. That means the request is reaching
Artist201
Artist201OP4d ago
yeah... i should have looked at the console
inder
inder4d ago
No description
Artist201
Artist201OP4d ago
can you upload ?
inder
inder4d ago
No description
Artist201
Artist201OP4d ago
hmmmm maybe updating the studio will fix it ? idk
inder
inder4d ago
Make sure to add those new env vars for pg-meta queries to work
Artist201
Artist201OP4d ago
ahhhhhhhhhh... http/https issue cause cf give me domain https by default but the url is in http that is why it keeps failing
inder
inder4d ago
I was going to ask you about that but I thought maybe url is supposed to be http
Artist201
Artist201OP4d ago
well it is xD how to update only the upload url thoguh ... i can set up ssl but it gonna take a minute
inder
inder4d ago
which upload url?
Artist201
Artist201OP4d ago
this
inder
inder4d ago
This url is created using SUPABASE_PUBLIC_URL so in your env vars just update the value for example: https://example.com or whatever you're accessing your studio on
Artist201
Artist201OP4d ago
it won't work as when it reaches coolify proxy it will se there is not any "https" certs since it is on local machine i guess i will set it up
inder
inder4d ago
on what url are you accessing studio locally? the one in your original screenshot (192.x.x.x:8100) or some other?
Artist201
Artist201OP4d ago
yeah
inder
inder4d ago
so why not simply use 192.x.x.x:8100?
Artist201
Artist201OP4d ago
but adding localhost/ip doesn't work properly from coolify interface as far as remember as when i put the url i have to say mydomain.com:8000 and not mydomain.com:8100
inder
inder4d ago
I am not aware of any issues with coolify on this so can't say
Artist201
Artist201OP4d ago
dw about it i have been fighting with it for a few days now xD
inder
inder4d ago
acc. to your docker-compose, you're exposing kong on 8100:8000 and going by the screenshot you added in the original post, in your SUPABASE_PUBLIC_URL you can add https://192.x.x.x:8100. I believe this should work
Artist201
Artist201OP4d ago
i tried it before, idk why it didn't work. did the domain bugout ( it keeps happening with supabase installation idk why) or a proxy issue. anyway
Artist201
Artist201OP4d ago
No description
Artist201
Artist201OP4d ago
i settedup http and here we go ! last step let me update studio oh btw edge function service broke down idk why xD
Artist201
Artist201OP4d ago
No description
Artist201
Artist201OP4d ago
it broke after i changed the url
inder
inder4d ago
Changing SUPABASE_PUBLIC_URL shouldn't have any effect on functions service Try restarting it. Maybe one time issue. You didn't change any other config for this? Volumes or command?
Artist201
Artist201OP4d ago
yeah nothing also does the logs page work for you ?
Artist201
Artist201OP4d ago
No description
Artist201
Artist201OP4d ago
or is it not supposed to be working for the self-hosted version
inder
inder4d ago
It does work. I can test it later. Away from pc right now
Artist201
Artist201OP4d ago
alright ty alot for your help ❤️
Artist201
Artist201OP4d ago
No description
inder
inder4d ago
?
Artist201
Artist201OP4d ago
this is the error from the logs page ^ and many other 500 when you query i thought it was working on the old studio version let me switch back and check
inder
inder4d ago
Ok, will take a look. I believe it must be an issue with env vars again
Artist201
Artist201OP4d ago
btw the one working fully for you is my compose ? or coolify template with just versions upgrade ?
inder
inder4d ago
I didn't check the logs page. It was coolify template with version upgrade. + new env vars in studio Btw, i noticed you have added open ai key as well. If you plan to use AI in studio, make sure to use this studio version https://github.com/supabase/supabase/issues/39664#issuecomment-3575914835
Artist201
Artist201OP4d ago
old studio version but all requests are resolved
No description
Artist201
Artist201OP4d ago
yeah kinda exited a little bit about that one
Artist201
Artist201OP4d ago
No description
Artist201
Artist201OP4d ago
so i noticed there was a change in envs as the LOGFLARE_API_KEY is depreciated and there is now public and private key. swapped them and made a new deployment. (the previous edge functions issue resolved itself on new deployment) as for the studio after adding the keys and removing LOGFLARE_API_KEY still not resolved
inder
inder4d ago
Did you add LOGFLARE_PUBLIC_ACCESS_TOKEN and LOGFLARE_PRIVATE_ACCESS_TOKEN token in both studio and analytics? Edit: I also had to add these values in environment variables Also in vector service, you have to add LOGFLARE_PUBLIC_ACCESS_TOKEN https://github.com/supabase/supabase/blob/8de52c4eb3184bf3480e70073e2a60a06555f983/docker/docker-compose.yml#L477-L478 And you will also need to update vector.yml file. I'm testing it now and will send you in a few minutes
inder
inder4d ago
After this take down containers and up again. Now logs show up
No description
Artist201
Artist201OP4d ago
i did everything except the vector, let me check it
Artist201
Artist201OP4d ago
i am receiving this in analytics i was receiving this before thoguht the service continue normally but now it cause the other services not to start...
No description
No description
inder
inder4d ago
Did you update the entire vector.yml file in persistent storage tab? And are you still on the same analytics version as the compose file you added above? supabase/logflare:1.22.6
Artist201
Artist201OP4d ago
yes, i just extended the health check time and it is passing and starting however.. still the logs page doesn't work
inder
inder4d ago
share your updated compose file
Artist201
Artist201OP4d ago
i found a typo redeploying...
inder
inder4d ago
There is one on line 144. Is that the one you found?
Artist201
Artist201OP4d ago
the double brackets
inder
inder4d ago
yeah
Artist201
Artist201OP4d ago
i hate how coolify just deploys now an older version of your compose and doesn't tell you yours is broken -_-
inder
inder4d ago
I wasn't even aware of this behavior. Thanks for letting me know. I don't use it regularly. You can run docker compose config at the location where coolify is storing these files.
Artist201
Artist201OP4d ago
this will validate ?
inder
inder4d ago
yeah
Artist201
Artist201OP4d ago
yaaay except the /api/platform/organizations/default-org-slug/entitlements
No description
inder
inder4d ago
I believe this is some api which only needs to be called on hosted platform.
Artist201
Artist201OP4d ago
the proxy bugged again so i used my local IP X_x hmmm so you get the same behavior ?
inder
inder4d ago
yeah it works absolutely fine with ip address/domain locally. did you also try uploading to storage with SUPABASE_PUBLIC_URL set to this ip? Haven't tested this with this latest image. But I believe it should be same. This api request is being made from studio itself. Also usually 404 errors in studio indicate resources which are only supposed to be called on hosted
Artist201
Artist201OP4d ago
no i didn't try with the IP iam trying to make it work with the domain now to test it again. if that succeeds i will test with the IP
inder
inder4d ago
I've tested it before and it does work. Just wanted to confirm if its working on your end.
Artist201
Artist201OP4d ago
btw you are running on a cloud server and everything worked fine, coolify installed locally on that server right ?
inder
inder4d ago
yes, coolify and supabase were on same server
Artist201
Artist201OP4d ago
just confirmed even on a domain, same issue for the entitlment path when you said for "hosted" did you mean their commercial deployment ?
No description
Artist201
Artist201OP4d ago
though everything seems to be working normally
Artist201
Artist201OP4d ago
though it some times does this i shouldn't see this page >.>
No description
Artist201
Artist201OP4d ago
alright here we go again X_x i down graded to my original compose studio version the current one they put for the AI stuff is broken and shows some menues from the commercial supabase in term of GUI everything seems to be working now
Artist201
Artist201OP4d ago
i noticed 2 things idk if they are supposed to be like this. 1- i can't reset the DB password 2-there is no pooler connections string
No description
No description
No description
Artist201
Artist201OP4d ago
i think this whole settings page is broken anyway i noticed in your old studio image i can't even access the settings page. nor do i see the pooler connection option.
Artist201
Artist201OP4d ago
and noticed this env var missing from environments variables
No description
Artist201
Artist201OP4d ago
even in their github repo
inder
inder4d ago
Logdrains are supported on selfhosted. It was added recently. Yes you can't make any configuration changes from studio And you won't see updated env vars on studio. Its not supposed to work on selfhosted. you won't see any updates on studio
Artist201
Artist201OP4d ago
@inder what about the pooler ?
inder
inder4d ago
if the container is healthy, its running, but you won't see any updates and you can't make any config changes from studio
Artist201
Artist201OP4d ago
so it is available but the studio don't show it at all
inder
inder4d ago
yes, not just for pooler you can't make any config changes for any service for example: auth etc. From self-hosted studio, you can only do db operations like sql queries, add/delete users, enable/disable extensions and storage uploads
Artist201
Artist201OP4d ago
eah... and changing just the env vars for db password for example will break things so i have to do it through container shell, right ?
Artist201
Artist201OP4d ago
no no no.. i won't reset all my data for a password change postgress password should changable through the container postgress shell
inder
inder4d ago
I have mentioned two ways in the link above
Artist201
Artist201OP4d ago
ah sorry
inder
inder4d ago
There is also a script linked in the gh comment. you can use that to automate this
Artist201
Artist201OP4d ago
and should be executed from supabase-db nice alright now everything is running yaaay is it safe to just remove supabase-auth and supabase-edge-function service ? as am not going to use them for now and i can save some resources.
inder
inder4d ago
yes its safe if you're not using them. You can also remove logs service as you're only running things locally analytics and vector
Artist201
Artist201OP4d ago
i probably shouldn't this local deployment is for testing i have my server
Artist201
Artist201OP4d ago
what about this ? and the supabase-rest service as a whole
No description
inder
inder4d ago
auth and edge-function are light. If you want to really save resources on your test machine, then logs is something you need to remove and enable it in production This is what exposes your db as API endpoints
Artist201
Artist201OP4d ago
oh right it is postgress://authenticator i thought it was http any way sorry i toke alot of your time T_T THANK YOU !
inder
inder4d ago
no worries!
Artist201
Artist201OP4d ago
and for the record the current version that should support open-ai key of the studio is kinda broken and shows stuff from commercial supabase and hides the log drains and many more issues supabase/studio:2025.08.04-sha-6e99ca6 this seems like the latest working one ( not sure about the AI stuff but works otherwise )
inder
inder4d ago
The one which was mentioned in the comment is broken? Just to be sure can you paste the version can you also add some screenshots
Artist201
Artist201OP4d ago
alright.. my vm network connection is slow so give me some time xD as the cash just restted 2025.08.04-sha-6e99ca6 works perfectly 2025.11.10-sha-5291fe3 works perfectly but shows you the settings page and the pooler connections option (otherwise everything works) 2025.11.24-sha-d990ae8 super messy
inder
inder4d ago
On the latest one, do AI features work? It was supposed to fix a small issue overriding a header
Artist201
Artist201OP4d ago
i will check when testing the latest one btw can you share your compose i am surprised kong worked for you without setting up the user to be root
inder
inder3d ago
I didn't make any other change except the versions + new env vars. And if I remember correctly, I didn't change kong version. So maybe in v3, they made some change internally I checked the latest version. And yeah logdrains destinations are not shown. Was there any other issue?
Artist201
Artist201OP3d ago
sorry the VM is too Slow T_T and settings page/connection string showing the pooler as far as i remember
inder
inder3d ago
This?
No description
Artist201
Artist201OP3d ago
yeah
inder
inder3d ago
You can ignore this. Its supposed to not work. Maybe they will hide this page in the future.
Artist201
Artist201OP3d ago
yeah there are many of those e.g.
No description
inder
inder3d ago
hmm, looks like there is an active PR where they're hiding these pages on self-hosted
Artist201
Artist201OP3d ago
when connecting using connection string postgresql://postgres:[YOUR_PASSWORD]@127.0.0.1:5432/postgres the 127.0.0.1 will be the same studio domain ?
and for the pooler just change the port to 6543 ? postgresql://postgres:[YOUR_PASSWORD]@127.0.0.1:6543/postgres cause coolify doesn't seem to allow enabling 2 ports to be public X_x
inder
inder3d ago
Yes the 127.0.0.1 will be the studio domain but the url is different and meaning of ports is different First when you connect via pooler, the url needs to be like this
postgresql://postgres.<POOLER_TENANT_ID>:[YOUR_PASSWORD]@127.0.0.1:5432/postgres
postgresql://postgres.<POOLER_TENANT_ID>:[YOUR_PASSWORD]@127.0.0.1:5432/postgres
This <POOLER_TENANT_ID> is present in your env vars. Take a look in your environment variables. If not present there, it must be present in supavisor service. Regarding ports refer to these docs for when to use which port: https://supabase.com/docs/guides/database/connecting-to-postgres#poolers
inder
inder3d ago
This is from your original compose file
No description
inder
inder3d ago
Also, I don't think coolify will block you to expose ports. If you're getting some error, then check if some other service is already exposed on that port
Artist201
Artist201OP3d ago
the domain automatically resolves to port 8000 thus it doesn't work i just verified that. currently i can only connect with the IP which i don't really like... thank you for the pooler info and yeah i probably will need to switch the port. but are all connections supposed to go through the studio or am supposed to connect directly to the supabase-db ? am trying to setup some proxy settings to allow traffic
inder
inder3d ago
no, all connection go through kong. The domain you see points to kong You will have to make direct connection to db. point your domain to server and connect on port 5432 or 6543 depending on your use case
Artist201
Artist201OP3d ago
am confused now. am i supposed to connect to my db through kong or directly
inder
inder3d ago
What I meant was that everything except direct db connection go through kong
Artist201
Artist201OP3d ago
and the pooler is still direct right ? connecting to port 5432 and 6543 should be directly to supabase-db that is what i understand now
inder
inder3d ago
Technically it is. But in postgres terms, a direct connection will be when connecting on port 5432. on port 6543, its in transaction mode
Artist201
Artist201OP3d ago
yeah no worries about that i just meant the connection should go directly toward the database now it is a simple task of just giving it a domain.
inder
inder3d ago
yes, you can use the same domain you were planning to use for supabase or use a subdomain. That doesn't matter

Did you find this page helpful?