Error updating 3.1.7 to 4.0.10

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
KT_
Posts: 30
Joined: Tue Nov 21, 2017 5:28 pm

Error updating 3.1.7 to 4.0.10

Post by KT_ »

I've been using phpMyFAQ for many years, and try to upgrade regularly. Usually it goes (relatively) smoothly, aside of a few tweaks and bit of debugging here and there. But today I'm running into difficulty updating from 3.1.7 to 4.0.10.

I'm getting an error in update.js, at: await fetch("../api/setup/check"...
Screenshot 2025-08-29 at 3.04.17 PM.png
It's resulting in a 500 error for 'check':
Screenshot 2025-08-29 at 3.04.31 PM.png
I've got RewriteBase configured properly in .htaccess. (My installation is at myserver.com/kb/, so it's RewriteBase /kb/) It's properly routing /update, so I assume it's working. So I'm at a loss as to why it's not able to find /check, when .htaccess has the default:

Code: Select all

RewriteRule ^api/setup/(check|backup|update-database) api/index.php
That hasn't been changed. Am I missing something obvious? (I mean, I'm probably missing something obvious.)
You do not have the required permissions to view the files attached to this post.
KT_
Posts: 30
Joined: Tue Nov 21, 2017 5:28 pm

Re: Error updating 3.1.7 to 4.0.10

Post by KT_ »

Actually, when I click on the "check" error in Chrome's Network tab I get:

An error occurred: Unknown column 'twofactor_enabled' in 'field list' at line 311 at /[myserver.com]/kb/src/phpMyFAQ/Database/Mysqli.php

So I guess something is looking for a nonexistent column?
KT_
Posts: 30
Joined: Tue Nov 21, 2017 5:28 pm

Re: Error updating 3.1.7 to 4.0.10

Post by KT_ »

I added 'twofactor_enabled' to faquserdata and tried again. This time I got:

Update database failed: Duplicate entry 'layout.enableCookieConsent' for key 'faqconfig.PRIMARY'
Screenshot 2025-08-30 at 12.36.04 PM.png
You do not have the required permissions to view the files attached to this post.
KT_
Posts: 30
Joined: Tue Nov 21, 2017 5:28 pm

Re: Error updating 3.1.7 to 4.0.10

Post by KT_ »

I added 'twofactor_enabled' to faquserdata and tried again. This time I got:

Update database failed: Duplicate entry 'layout.enableCookieConsent' for key 'faqconfig.PRIMARY'
Screenshot 2025-08-30 at 12.36.04 PM.png
You do not have the required permissions to view the files attached to this post.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error updating 3.1.7 to 4.0.10

Post by Thorsten »

Hi,

sorry for the late reply, I was on vacation.

Are you still stuck in the update process?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
KT_
Posts: 30
Joined: Tue Nov 21, 2017 5:28 pm

Re: Error updating 3.1.7 to 4.0.10

Post by KT_ »

I rolled back to my 3.1.7. and restored my database from backup as the db seems to have gotten into an unusable state with the incomplete update.

I tried running the update again at that point but if I remember right I got the first (original) error about the unknown 'twofactor_enabled' so I just left it.

Hope you had a great vacation!
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error updating 3.1.7 to 4.0.10

Post by Thorsten »

Hi,

the column "twofactor_enabled" was introduced with 3.2. Are you still logged in then starting the update process?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
KT_
Posts: 30
Joined: Tue Nov 21, 2017 5:28 pm

Re: Error updating 3.1.7 to 4.0.10

Post by KT_ »

I believe I would have been logged in as I would have just set it to maintenance mode. I'm fairly certain(?) I hadn't updated to 3.2 or later at any point, and the control panel still shows 3.1.7.
Thorsten
Posts: 15744
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Error updating 3.1.7 to 4.0.10

Post by Thorsten »

Hi,

I think I know what happens here, could you please try to do the update without being loggedin?

Thanks in advance.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply