API 500 on GET only
Hi, I run twenty 0.52.8 via docker-compose, pretty much just the default
docker-compose.yml
that I found on your GitHub.
Now trying to use the REST API. I have set up my key and I can do POST just fine but GET gives me this behavior :
- first call after a docker compose up
gives me this : {"statusCode":400,"message":"Metadata cache version not found","error":"Bad Request"}
- all the following calls just give me a 500 with no output
My requests are as follows :
GET works fine with /rest/open-api/core
and /rest/open-api/metadata
, but for the rest of /rest/*
it's pretty much only 500's
I have tried with and without a reverse proxy, it doesn't change anything
here is my .env
file :
I don't know how to get logs other than docker compose logs
, which isn't very talkative29 Replies
Hey, can you try to flush your cache?
yarn command:prod cache:flush
hi @martmull !
after running this command, I get the same message as on the first start :
{"statusCode":400,"message":"Metadata cache version not found","error":"Bad Request"}
then it's only 500's againOk, and is your application working properly?
the application is working fine
Hey @BigBadVoodoo please try using latest 0.52.11
hi @prastoin, I just updated my install from 52.8 to 52.11, same behavior : first one 400 then only 500
Could you please share logs from your twenty-server container
When you say 400 then 500 only is that when hitting the api directly using curl on from the client ?
Sure, here it is full and this sample of the last messages :
I'm hitting the API from my own computer through
curl
. Twenty is installed on a remote VM. I also get the same result with the API tester found in the application in settings/playground/rest/coreI would tend to think that you're never really hitting twenty-server
Are you able to render the client ? ( would revoke just above affirmation )
do you mean accessing the web UI? Because this shows up just fine :

Seems like you're able to retrieve some data, so not only errors 500 ?
- Your server seems up and healthy
- Client is correctly rendered by the back
What's failling is when you try hitting the API REST directly ?
Yes, exactly, just the REST API.
my guess is a redis problem, redis logs don't show up any requests, maybe that's just normal.
GraphQL works fine, we don't find any logs to match with the 500's
we got 200 on api-core, 500 on other endpoints (example: notes, companies)
201 created when hitting /rest/companies with a correct POST
🤞
Ok cool, we have a better scope to work on !
Unless I'm mistaken Redis should be agnostic of any operation source, either grapql or rest should be iso for him 🤔
Lets upgrade your workspace to the latest version, v0.53.0 as we've merged several REST api fixes and refactor within it
But before could you please share your workspace version in database located at
database.core.workspace
table in order to assure a correct upgrade version ?I'm sorry but I'm not sure how to find this information, I tried to connect to the postgres db but I can't find my way in there, it all seems empty
No worries, are you connected to it using a db explorer or using psql ?
yes :

sorry it should be within default
default.core.workspace

it seems that the default is empty here
Have you browse through all of the others ? ( at least one depth )
template1 and postgres are empty too, which is weird because we do have persistent data in the application
should I upgrade to 0.53 anyway?
Feels like we're not inspecting the correct database
Yes lets try to upgrade, we might encounter some issue lets see
API works fine on 53.0 indeed !
thank you very much for your availability!
My pleasure !
If I was you I would still investigate a bit further in order to find your workspace version to double check it's not desynchronized from your current Twenty's instance version
Enjoy coding !
🎉
thanks, I'll check this out