# \`run\_second\_factor!\` failing when trying to promote admin

**URL:** <https://meta.discourse.org/t/run-second-factor-failing-when-trying-to-promote-admin/314516>\
**Category:** Product Support\
**Created:** [July 1, 2024, 9:30pm UTC](https://meta.discourse.org/t/run-second-factor-failing-when-trying-to-promote-admin/314516 "2024-07-01T21:30:13Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [July 3, 2024, 1:56pm UTC](https://meta.discourse.org/t/run-second-factor-failing-when-trying-to-promote-admin/314516/14 "2024-07-03T13:56:25Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/6/6/4/664ffef3c35557e57cc284f355d2456069ae240b.png)

This seems to be coming from the server. I can’t find that string in the database (say in customized text) or grepping all of /var/www/discourse

There is no Payload tab:

![image](https://global.discourse-cdn.com/meta/original/4X/9/6/9/969df99aebfc9c81bd17ffa720a6948b36f0e7cb.png)

**Wait!!!** I restored the database to another server and it properly redirects to the second factor page, which, after getting the second factor key, immediately changes the user’s admin status (no email required! which I didn’t know!).

So it’s something with . . . something, but a clean mostly-[standard install](https://meta.discourse.org/t/142537?silent=true) resolves the problem. In any case, not (obviously?) a :discourse: 🐛 . I changed the category.

The other potential explanation, which also seems far-fetched, is that there is something somehow wrong with the `UserSecondFactor` model, as I did a `UserSecondFactor.all.destroy_all;UserSecurityKey.all.destroy_all;` on my test server since it had a different domain name. I also used Google authenticator instead of my Yubi key.

---

_[View the full topic](https://meta.discourse.org/t/run-second-factor-failing-when-trying-to-promote-admin/314516)._
