Error: secretOrPrivateKey must have a value

System Information
  • 4.0.5:
  • 14.18.2:
  • 8.3.0:

upgraded to v4.0.5 from 4.0.2 and my admin login stopped working:
steps taken :

  • deleted .cache
  • deleted package-lock.json
  • deleted node_modules
    npm install
    npm run build

i added it to the admin.js as well
also tried resetting the admin password, nothing work, other users can’t login as well with the same error:

error: secretOrPrivateKey must have a value
Error: secretOrPrivateKey must have a value
at Object.module.exports [as sign] (/home/ubuntu/caster-backend/node_modules/jsonwebtoken/sign.js:107:20)
at Object.createJwtToken (/home/ubuntu/caster-backend/node_modules/@strapi/admin/server/services/token.js:33:14)
at /home/ubuntu/caster-backend/node_modules/@strapi/admin/server/controllers/authentication.js:45:38
at dispatch (/home/ubuntu/caster-backend/node_modules/koa-compose/index.js:42:32)
at /home/ubuntu/caster-backend/node_modules/@strapi/admin/server/controllers/authentication.js:37:16
at callback (/home/ubuntu/caster-backend/node_modules/koa-passport/lib/framework/koa.js:93:25)
at Strategy.strategy.success (/home/ubuntu/caster-backend/node_modules/passport/lib/middleware/authenticate.js:219:18)
at verified (/home/ubuntu/caster-backend/node_modules/passport-local/lib/strategy.js:83:10)
at /home/ubuntu/caster-backend/node_modules/@strapi/admin/server/services/passport/local-strategy.js:16:43
Help! Im stuck!

I’m having the same problem trying to deploy to Google App Engine right now.

Have you set the variable in your GCP environment variables?

Yes. I’m getting my secrets from Google Secret Manager, exporting them, and then running Strapi. It wouldn’t be running if it wasn’t getting the database password.

@DMehaffy any ideas? really behind in my project here

Did you fix your problem? We are facing the same problem here.