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 :
curl -v -L -s -H "Accept: application/json" -H "Authorization: Bearer mybearertoken" https://crm.mydomain.local/rest/companies
curl -v -L -s -H "Accept: application/json" -H "Authorization: Bearer mybearertoken" https://crm.mydomain.local/rest/companies
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 :
TAG=v0.52.8

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=postgres-pass
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379
REDIS_HOST=redis://redis:6379

#SERVER_URL=http://localhost:3000
SERVER_URL=https://crm.mydomain.local
REACT_APP_SERVER_BASE_URL=https://crm.mydomain.local
SIGN_IN_PREFILLED=false

# Use openssl rand -base64 32 for each secret
APP_SECRET="appsecret="

STORAGE_TYPE=local

LOG_LEVELS=log,warn,error
TAG=v0.52.8

PG_DATABASE_USER=postgres
PG_DATABASE_PASSWORD=postgres-pass
PG_DATABASE_HOST=db
PG_DATABASE_PORT=5432
REDIS_URL=redis://redis:6379
REDIS_HOST=redis://redis:6379

#SERVER_URL=http://localhost:3000
SERVER_URL=https://crm.mydomain.local
REACT_APP_SERVER_BASE_URL=https://crm.mydomain.local
SIGN_IN_PREFILLED=false

# Use openssl rand -base64 32 for each secret
APP_SECRET="appsecret="

STORAGE_TYPE=local

LOG_LEVELS=log,warn,error
I don't know how to get logs other than docker compose logs, which isn't very talkative
29 Replies
martmull
martmull3w ago
Hey, can you try to flush your cache? yarn command:prod cache:flush
BigBadVoodoo
BigBadVoodooOP3w ago
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 again
martmull
martmull3w ago
Ok, and is your application working properly?
BigBadVoodoo
BigBadVoodooOP3w ago
the application is working fine
Prastoin
Prastoin3w ago
Hey @BigBadVoodoo please try using latest 0.52.11
BigBadVoodoo
BigBadVoodooOP3w ago
hi @prastoin, I just updated my install from 52.8 to 52.11, same behavior : first one 400 then only 500
Prastoin
Prastoin3w ago
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 ?
BigBadVoodoo
BigBadVoodooOP3w ago
Sure, here it is full and this sample of the last messages :
server-1 | [Nest] 1 - 05/13/2025, 1:33:55 PM LOG [TypeDefinitionsGenerator] Generating metadata objects: [blocklist, messageChannelMessageAssociation, view, noteTarget, workspaceMember, message, workflowAutomatedTrigger, opportunity, calendarEvent, workflowEventListener, apiKey, viewField, messageFolder, calendarChannel, taskTarget, workflow, workflowVersion, company, attachment, viewFilterGroup, calendarEventParticipant, note, auditLog, task, workflowRun, messageThread, viewSort, favorite, viewFilter, timelineActivity, calendarChannelEventAssociation, webhook, person, messageParticipant, connectedAccount, viewGroup, messageChannel, favoriteFolder]
server-1 | [Nest] 1 - 05/13/2025, 1:33:55 PM LOG [TypeDefinitionsGenerator] Extend object type definition with new relation fields
server-1 | metadata query time: 1.991262998431921 ms
server-1 | [Nest] 1 - 05/13/2025, 1:33:55 PM LOG [TypeDefinitionsGenerator] Generating metadata objects: [blocklist, messageChannelMessageAssociation, view, noteTarget, workspaceMember, message, workflowAutomatedTrigger, opportunity, calendarEvent, workflowEventListener, apiKey, viewField, messageFolder, calendarChannel, taskTarget, workflow, workflowVersion, company, attachment, viewFilterGroup, calendarEventParticipant, note, auditLog, task, workflowRun, messageThread, viewSort, favorite, viewFilter, timelineActivity, calendarChannelEventAssociation, webhook, person, messageParticipant, connectedAccount, viewGroup, messageChannel, favoriteFolder]
server-1 | [Nest] 1 - 05/13/2025, 1:33:55 PM LOG [TypeDefinitionsGenerator] Extend object type definition with new relation fields
server-1 | metadata query time: 1.991262998431921 ms
BigBadVoodoo
BigBadVoodooOP3w ago
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/core
Prastoin
Prastoin3w ago
I would tend to think that you're never really hitting twenty-server Are you able to render the client ? ( would revoke just above affirmation )
BigBadVoodoo
BigBadVoodooOP3w ago
do you mean accessing the web UI? Because this shows up just fine :
BigBadVoodoo
BigBadVoodooOP3w ago
No description
Prastoin
Prastoin3w ago
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 ?
BigBadVoodoo
BigBadVoodooOP3w ago
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
DemonNo0zy
DemonNo0zy3w ago
🤞
Prastoin
Prastoin3w ago
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 ?
BigBadVoodoo
BigBadVoodooOP3w ago
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
Prastoin
Prastoin3w ago
No worries, are you connected to it using a db explorer or using psql ?
BigBadVoodoo
BigBadVoodooOP3w ago
yes :
No description
Prastoin
Prastoin3w ago
sorry it should be within default default.core.workspace
BigBadVoodoo
BigBadVoodooOP3w ago
No description
BigBadVoodoo
BigBadVoodooOP3w ago
it seems that the default is empty here
Prastoin
Prastoin3w ago
Have you browse through all of the others ? ( at least one depth )
BigBadVoodoo
BigBadVoodooOP3w ago
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?
Prastoin
Prastoin3w ago
Feels like we're not inspecting the correct database Yes lets try to upgrade, we might encounter some issue lets see
BigBadVoodoo
BigBadVoodooOP3w ago
API works fine on 53.0 indeed ! thank you very much for your availability!
Prastoin
Prastoin3w ago
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 !
DemonNo0zy
DemonNo0zy3w ago
🎉
BigBadVoodoo
BigBadVoodooOP3w ago
thanks, I'll check this out

Did you find this page helpful?