#Unable to register first user

8 messages · Page 1 of 1 (latest)

grave trout
#

Using default payload user system
Unable to register the first user when deployed to cloud - receive the following error on call /api/users/first-register

  at /home/node/node_modules/payload/src/fields/validations.ts:322:55
  at Array.filter (<anonymous>)
  at relationship (/home/node/node_modules/payload/src/fields/validations.ts:304:41)
  at Object.field.validate (/home/node/node_modules/payload/src/fields/config/sanitize.ts:56:46)
  at promise (/home/node/node_modules/payload/src/fields/hooks/beforeChange/promise.ts:125:44)
  at processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async Promise.all (index 0)
  at traverseFields (/home/node/node_modules/payload/src/fields/hooks/beforeChange/traverseFields.ts:60:3)
  at beforeChange (/home/node/node_modules/payload/src/fields/hooks/beforeChange/index.ts:34:3)
  at create (/home/node/node_modules/payload/src/collections/operations/create.ts:174:29)```
open zinc
#

Are you able to access the admin panel? I've always just registered the first user through there

grave trout
#

I get redirected to the first user screen /admin/create-first-user where it fails to register the user - also happens on my local
On my local - I registered the first user on 1.6.16 which worked - will try to downgrade

open zinc
#

The latest version is 1.16.22, you could try using that? Why would you downgrade? Also maybe a stupid question but do you have your Payload config defined? And do you have the config path environment variable set up?

haughty garden
#

hmm what has a config property

#

just weird it happens on a collection config

open zinc
#

Mmm, yeah, we might need to see your config

grave trout
#

Ok, I have found the issue. The plugin for last modified by from https://payloadcms.com/docs/plugins/overview was also adding it to the users - probably causing the validation to fail. So I created the first user way ahead and didn't go though that flow after while adding features/plugins. Thanks for helping !

Payload CMS

Plugins provide a great way to modularize Payload functionalities into easy-to-use enhancements and extensions of your Payload apps.