Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

Hi, I have recently upgraded my clients board from 3.2.8 to 3.2.9 by adopting the official Guide. Everything seems fine, but when I tried to login the board ACP, then the login screen appears again and again. When I try to use the forget password option, then I got this error.


SQL ERROR [ mysqli ]

Unknown column 'user_email_hash' in 'where clause' [1054]

An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists.


I tried to register as a new user, then I also got the same error.


Board URL is

https://forum.PAKDEFENSE.com

Please try to solve this problem....


Regards,

User avatar
EA117
Registered User
Posts: 1411
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by EA117 »

The user_email_hash column was indeed being intentionally removed, as part of https://tracker.phpbb.com/browse/PHPBB3-16167. But that change was ultimately released in phpBB 3.3.0, not phpBB 3.2.9. Taking a quick look at the official phpBB 3.2.9 release code, I don't see where anything about that change "leaked" into the phpBB 3.2.9 release. The column is not removed by phpBB 3.2.9 migration.

What is the phpBB version showing as in your ACP? (e.g. just "3.2.9", or maybe "3.2.9-RC1", etc.) Was there possibly an attempt to go to phpBB 3.3.0 first, and somehow later decided to use phpBB 3.2.9 instead? Just trying to picture reasons why the column would now be missing on a phpBB 3.2.9 board.

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

I cannot login to ACP and I have uploaded the 3.2.9 files in the board, so I am sure its version is 3.2.9.

I performed the clean installation via FZ FTP. Everything was fine during the install and I don't see any error. Now, this problem comes from nowhere.

I have also checked by uploading the cookie.php file, but cookie settings are same as before.

Now, I don't know what to do...

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

WebDoc121 wrote:
Fri Jan 10, 2020 4:46 am
I cannot login to ACP and I have uploaded the 3.2.9 files in the board, so I am sure its version is 3.2.9.

I performed the clean installation via FZ FTP. Everything was fine during the install and I don't see any error. Now, this problem comes from nowhere.

I have also checked by uploading the cookie.php file, but cookie settings are same as before.

I have also try to repair the database tables in mysql, but problem stays where it was before

Now, I don't know what to do...



User avatar
EA117
Registered User
Posts: 1411
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by EA117 »

If you don't think you've had significant activity on the board since the update, I'd probably just use the file system and database backup to return the board to it's original phpBB 3.2.8 state, and then probably also look at the phpbb_users table to confirm that the user_email_hash column really was there prior to the update. Before then performing the phpBB 3.2.9 update again, since I have no reason to think that installing phpBB 3.2.9 will remove that column. Maybe download and extract the phpBB 3.2.9 files for upload again, just as a safety measure.

If users have been at the board for a while, there could be something more surgical you could do. But it's a bit risky since who knows what else is actually wrong right now besides the one thing you've noticed. But you could make a database backup of the phpBB 3.2.9 board, and use a good comparison program (BeyondCompare, or your favorite diff tool) to compare that backup to the pre-upgrade phpBB 3.2.8 database backup. To get a sense of whether it's really just "that one column got dropped for some reason, but everything else is just expected user activity since the update." Versus whether you're seeing a lot of other columns and/or rows missing from important tables, and this happens to be "the first one we've noticed."

In the extremely lucky event you find that it really is just this one column missing, it looks like if you put the empty column back using phpMyAdmin or similar, there appears to be a phpBB /bin/phpbbcli.php fixup:recalculate-email-hash CLI option that would let you regenerate the data for specifically this column.

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

This method is very much complicated. Is there any simple way around to solve the issue.

User avatar
warmweer
Jr. Extension Validator
Posts: 4313
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by warmweer »

WebDoc121 wrote:
Fri Jan 10, 2020 6:06 am
This method is very much complicated. Is there any simple way around to solve the issue.
???
I think EA117 explained a) a possible cause and b) a solution quite well.
The bottom line is that there is a problem and in order to fix that you'll either have to retry the update (with the risk that the problem persists) or follow EA117's advice and risk identifying the "origin" of the cause and being able to solving it permanently.
The method described is not complicated at all, in fact I had a different method in mind, involving a different (perhaps slightly more thorough) comparison method which would probably yield the same results but take 20x longer.
And if you think EA117's method is complicated, then you certainly don't want to try my alternative ;) (which is a lot more intrusive).
We should embrace problems, without which there wouldn't be any solutions.

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

I have also saved the backup before installing the update. How can I restore the backup?

User avatar
janus_zonstraal
Registered User
Posts: 4229
Joined: Sat Aug 30, 2014 1:30 pm

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by janus_zonstraal »

WebDoc121 wrote:
Fri Jan 10, 2020 9:51 am
I have also saved the backup before installing the update. How can I restore the backup?
Did you backup the files and the database?
Sorry! My English is bat ;) !!!

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

Yes, I have backup the database before updating the board via ACP backup and restore option and I have also made backup of the files such as config.php, store, images, files, etc

User avatar
janus_zonstraal
Registered User
Posts: 4229
Joined: Sat Aug 30, 2014 1:30 pm

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by janus_zonstraal »

Sorry I don't know if you can restore a backup from a other version in the ACP.
I always restore the database in phpmyadmin.
Maybe someone else knows this.


Otherwise you have to download the backup, you find him in the store folder.
and upload them in phpmyadmin.
Also restore all the files from your old version (not only the config.php, store, images, files, etc)
Sorry! My English is bat ;) !!!

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

Let's say I restore the backup using phpmyadmin. Will this resolve the missing database table issue permanently?

User avatar
janus_zonstraal
Registered User
Posts: 4229
Joined: Sat Aug 30, 2014 1:30 pm

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by janus_zonstraal »

No it only restore the board to the last version, keep in mind that you also loose all the post made since the update!
Sorry! My English is bat ;) !!!

WebDoc121
Registered User
Posts: 67
Joined: Tue Feb 26, 2019 5:09 am

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by WebDoc121 »

The all issue is missing one column database table user_hash_email. will Restoring the backup resolve the issue?

User avatar
david63
Registered User
Posts: 17442
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Unable to login to ACP got Error SQL ERROR [ mysqli ] Unknown column 'user_email_hash' in 'where clause' [1054]

Post by david63 »

WebDoc121 wrote:
Fri Jan 10, 2020 12:41 pm
will Restoring the backup resolve the issue?
It might. It will also depend on whether that column in the user table is in the backup that you use.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Post Reply

Return to “[3.2.x] Support Forum”