twenty icon indicating copy to clipboard operation
twenty copied to clipboard

After Update from 50.5 to 51.5 > User Data gone, Error "Cannot convert undefined or null to object"

Open horschdel opened this issue 5 months ago • 2 comments

Hi,

I have tried updating Twenty 50.5 to 51.5 to slowly make my way up to the newest version and struggle with making the update work.

It's currently running in docker and after changing the .env to the newest version, Twenty does start and I can login with my username & password, but no data is shown. My custom categories in the sidebar are loaded, including my custom data models.

The error on the page says:

Cannot convert undefined or null to object

In the twenty-server-1 log file, it says:

TypeError: Cannot convert undefined or null to object

        at Function.keys (<anonymous>)

        at PermissionsService.userHasObjectRecordsPermission (/app/packages/twenty-server/dist/src/engine/metadata-modules/permissions/permissions.service.js:112:82)

        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

        at async GraphqlQueryFindManyResolverService.validateObjectRecordPermissionsOrThrow (/app/packages/twenty-server/dist/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.js:107:35)

        at async GraphqlQueryFindManyResolverService.execute (/app/packages/twenty-server/dist/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.js:55:46)

        at async Object.usageRequests (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-resolver-builder/factories/find-many-resolver.factory.js:33:20)

        at async field.resolve (/app/node_modules/@envelop/on-resolve/cjs/index.js:36:42)

        at async /app/node_modules/@graphql-tools/executor/cjs/execution/promiseForObject.js:18:35

        at async Promise.all (index 6)

using docker exec, I ran the following commands (multiple times) inside the twenty-server-1 container:

yarn database:migrate:prod

yarn command:prod upgrade

And even

yarn command:prod workspace:sync-metadata

Any ideas on how to fix this? Been loving Twenty so far, but have been struggling a little with the update process, to be honest.

Edit: When running "yarn command:prod upgrade" I get the following message:

Upgrading workspace XXXXXXXXXX 1/1
Upgrade for workspace XXXXXXXXXX ignored as is already at a higher version.

Additionally, searching for (eg.) People results in a list but clicking on the link to open the Person results in the error again.

horschdel avatar Jun 03 '25 08:06 horschdel

Any idea what might be going on / how to fix this?

horschdel avatar Jun 09 '25 14:06 horschdel

Just checking in to see if anyone has an idea.

horschdel avatar Jun 16 '25 15:06 horschdel

Just in case anyone else has the same issue:

I started with an earlier backup and worked my way to the current version, one 0.0.x-version at a time, testing each version, and usually going into the container (docker exec -it TWENTY-SERVER-CONTAINER-NAME sh) running:

yarn database:migrate:prod

yarn command:prod upgrade

Took a while but that ended up being the only way to go.

horschdel avatar Jul 19 '25 08:07 horschdel

Closing as stale

Bonapara avatar Oct 08 '25 09:10 Bonapara

I am getting a similar issue with this, where the GQL query response says {"errors":[{"message":"Cannot convert undefined or null to object"}]}

when I create a user after creating a workspace.

Payload is

Image

Can anyone help and has any idea @Bonapara @horschdel

I have hosted on my server, and I am using node_env=production

Paraagg avatar Oct 08 '25 14:10 Paraagg