I flushed my redis db and now i get > "Metadata version not found for workspace"

Whatever i do i'm not able to restore or fix this. any advice?
15 Replies
Prastoin
Prastoin3w ago
Hello @Bartel Verkruijssen I'm not sure about this one, would run yarn command:prod migrate refill the cache @Weiko ?
Weiko
Weiko3w ago
@Bartel Verkruijssen try running yarn command:prod workspace:sync-metadata it should recompute the cache for you
Bartel Verkruijssen
let me try thanks that was the fix
Rishi S
Rishi S2d ago
Hey @prastoin @Weiko, I ran the same command in my root dir yarn command:prod workspace:sync-metadata, but I got the below error. Do you know what's the issue? node:internal/modules/cjs/loader:1080 throw err; ^ Error: Cannot find module '/Users/rishisoni/Documents/Projects/pi/stackline-new/packages/twenty-server/dist/src/command/command' at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v18.17.1
Prastoin
Prastoin2d ago
Hey @Rishi S, is it in local or in a docker container ? Please be sure to run the command in packages/twenty-server if in local
Amiteshwar
Amiteshwar20h ago
Hey @prastoin @Weiko, I get same error when users try to login. Errors while running in docker container. Works fine locally.: Role assignment error for user <user_id> in workspace <workspace_id>: Metadata version not found for workspace <workspace_id> [Nest] 1 - 04/19/2025, 5:26:00 AM ERROR [ExceptionsHandler] Metadata version not found for workspace <workspace_id> Error: Metadata version not found for workspace <workspace_id>
Prastoin
Prastoin20h ago
@Amiteshwar try reflushing your cache Using sync metadata command or cache flush This In local at path packages/twenty-server if in docker container in twenty-server container at root
Amiteshwar
Amiteshwar20h ago
ok. should i run this at the root directory of my app? packages/twenty-server sounds good
Prastoin
Prastoin20h ago
Ok let me know ! Enjoy coding !
Amiteshwar
Amiteshwar20h ago
@prastoin do i need to run the normal yarn command at project root (like in local setup) before the above command? Running the docker container in ec2. got this error upon running "yarn command:prod workspace:sync-metadata" in twenty-server: Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation) $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...
Prastoin
Prastoin20h ago
If running the project in local please run from twenty-server path, checking twenty-server package.json you should be able to find the command:prod script entry
cd packages/twenty-server && yarn command:prod workspace:sync-metadata
cd packages/twenty-server && yarn command:prod workspace:sync-metadata
If not please connect and exec the command from twenty-server or twenty-worker container Also should be able to find the package.json with script entry In local you need to build the app before npx nx build twenty-server
Amiteshwar
Amiteshwar20h ago
I'm running the app deployed (docker compose up) on an aws EC2 instance.
Prastoin
Prastoin20h ago
Ok then you need to connect to either your twenty-server or twenty-worker container And execute the command at container's root
$ docker exec -it twenty-server-1 yarn command:prod workspace:sync-metadata
$ docker exec -it twenty-server-1 yarn command:prod workspace:sync-metadata
Might not be accurate depending your instance You can also open a shell to your container etc etc
Amiteshwar
Amiteshwar16h ago
@prastoin this worked! Thank you
Prastoin
Prastoin13h ago
Great ! Enjoy coding !

Did you find this page helpful?