T
Twenty2mo ago
baon99

Try to update .43 to .44 with yarn command:prod upgrade error APP_VERSION is not defined

I did these two command on local setup yarn database:migrate:prod yarn command:prod upgrade But got error on second command: Error in workspace xxxx: cannot run upgrade command when APP_VERSION isn not defined, please double check your env variables. Am I missing something in the env?
14 Replies
Prastoin
Prastoin2mo ago
On what twenty's version Are you pulling from dockerhub or building from scratch?
baon99
baon99OP2mo ago
building from scratch. v.43
Prastoin
Prastoin2mo ago
Ok ! You now need to define an APP_VERSION env var starting from 0.43 As now workspace are getting versionned in db to avoid invalid upgrade ( also to ease upcoming auto migrate tool ) 0.43 upgrade won't validate workspace version only populate their cols in base You can use your own semver On our side we infer and define APP_VERSION in dockerfiles during cd from related git tag name
baon99
baon99OP2mo ago
Thank! Adding APP_VERSION to env works.
Prastoin
Prastoin2mo ago
Please keep in mind that you will to update each time you upgrade twenty in order to workspace de get migrated Also I was wrong it should follow twenty's version you're building from in order for the upgrade to run successfully
soundworker2003
I have got the same problem. Also upgrade from 0.43.0 to 0.44.0 . I modified 'TAG=v0.44.0' in .env. And 'yarn database:migrate:prod' is good, but when I try 'yarn command:prod upgrade' , got the same error.
baon99
baon99OP4w ago
If doing local setup then use APP_VERSION=0.43.0, check database if workspace version is updated
Prastoin
Prastoin4w ago
Please use 0.44 latest patch not 0 When working on docker images APP_VERSION is already computed in the env variable
soundworker2003
Thanks I updated from 0.42.0 to 0.43.0. Everything was ok during upgrading, except this error:
[Nest] 2722 - 04/06/2025, 2:00:12 PM LOG [WorkspaceDatasourceFactory] Creating workspace data source for workspace 4372600c-2555-46de-9af4-b7f44a0aa61e and metadata version 75
[Nest] 2722 - 04/06/2025, 2:00:13 PM LOG [AddTasksAssignedToMeViewCommand] Error in workspace 4372600c-2555-46de-9af4-b7f44a0aa61e.
[Nest] 2722 - 04/06/2025, 2:00:13 PM LOG [AddTasksAssignedToMeViewCommand] Command completed!
[Nest] 2722 - 04/06/2025, 2:00:12 PM LOG [WorkspaceDatasourceFactory] Creating workspace data source for workspace 4372600c-2555-46de-9af4-b7f44a0aa61e and metadata version 75
[Nest] 2722 - 04/06/2025, 2:00:13 PM LOG [AddTasksAssignedToMeViewCommand] Error in workspace 4372600c-2555-46de-9af4-b7f44a0aa61e.
[Nest] 2722 - 04/06/2025, 2:00:13 PM LOG [AddTasksAssignedToMeViewCommand] Command completed!
But it said upgrading completed at last. Will this affect updating from 0.43 to 0.44? how to find out workspace version in database? Thanks
soundworker2003
I updated to 0.44. But can't find version number in Admin Panel. Either Env Variables or Health Status is clickable.
No description
baon99
baon99OP4w ago
Its in Core Tables -> workspace. I used DBeaver
soundworker2003
thanks
Andreas
Andreas6d ago
@baon99 @soundworker2003 @prastoin - did you set the APP_VERSION=0.44 in .env? Or where did you set the APP_VERSION? Like this or? TAG=v0.44.0 APP_VERSION=0.44
Prastoin
Prastoin6d ago
APP_VERSION has to be a valid semver It's a twenty-server env variable e.g APP_VERSION=0.51.14 For a global definition better to be set in the .env If it's for a given command depending on your os could be set in cli directly APP_VERSION=1.0.0 my_command @Andreas issue here was that he was upgrading using 0.44.0 and not 0.44 latest patch which is 0.44.19 We should update docs to be stricter on the version to target while upgrading or refactor the docker hub versioning to be agnonistic of the patch version by maintaining major.minor mirrors getting hydrated each time we add patch

Did you find this page helpful?