1

Because of a bug (https://github.com/craftcms/cms/issues/7657), I got locked out from admin because no site seemed to be marked as primary in the DB, even though one of the site files clearly had a primary:true setting.

This is using latest craft as of writing, 3.6.9.

Changing the primary site directly in the sites-table will cause the problem (WEIRD!), logging me out and refusing to log me in again. This doesn't happen in my dev environment when switching the primary site, so I'm not sure what's up here...

jishi
  • 263
  • 1
  • 13
  • When you say that you can't log back in, do you have an error message? Can you add a screenshot? Have you tried clearing your cookies or logging in from a private browsing tab? – nstCactus Mar 09 '21 at 11:42
  • The error message is that the user doesn't exist. Can't reset email either, clearing browser data doesn't make a difference. Switching sites in the admin does far more than just updating the site table it seems, and in some odd occurences this state can happen even when applying project.yaml changes.

    However, I restored a backup and tried it again (via craft project-config/apply --force) and it successfully managed to switch primary site so I'm all good now.

    – jishi Mar 09 '21 at 12:56

1 Answers1

2

Craft 3.6.10 is out now with a fix for #7657. Note that the fix is not retroactive, so if you already have multiple sites in your project config YAML with primary: true, you should run php craft project-config/rebuild to fix that.

Brandon Kelly
  • 34,307
  • 2
  • 71
  • 137