Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login error on the site #2662

Closed
Git-Hub-Ivan opened this issue Sep 28, 2023 · 9 comments
Closed

Login error on the site #2662

Git-Hub-Ivan opened this issue Sep 28, 2023 · 9 comments
Assignees
Labels
Milestone

Comments

@Git-Hub-Ivan
Copy link

Updated PhpMyFaq from 3.1.13 to 3.2.1 => Ok
Updated the main page (Ctrl+F5) => Ok (everything looks correct - FAQs are displayed)
I'm trying to log in and get an error in the browser with the text:

phpMyFAQ Fatal error

Uncaught exception: 'TypeError'

Message: 'pg_result_status(): Argument #1 ($result) must be of type PgSql\Result, bool given'

Stack trace:

#0 /var/www/phpmyfaq/src/phpMyFAQ/Database/Pgsql.php(107): pg_result_status()
#1 /var/www/phpmyfaq/src/phpMyFAQ/User/UserData.php(208): phpMyFAQ\Database\Pgsql->query()
#2 /var/www/phpmyfaq/src/phpMyFAQ/User.php(538): phpMyFAQ\User\UserData->load()
#3 /var/www/phpmyfaq/src/phpMyFAQ/User/CurrentUser.php(124): phpMyFAQ\User->getUserByLogin()
#4 /var/www/phpmyfaq/src/phpMyFAQ/User/UserAuthentication.php(69): phpMyFAQ\User\CurrentUser->login()
#5 /var/www/phpmyfaq/index.php(176): phpMyFAQ\User\UserAuthentication->authenticate()
#6 {main}

Thrown in '/var/www/phpmyfaq/src/phpMyFAQ/Database/Pgsql.php' on line 107

When I try to open the FAQ or another link from the main page, I get an error referring to:
"Thrown in '/var/www/phpmyfaq/src/phpMyFAQ/Database/Pgsql.php' on line 107"

  • phpMyFAQ version = 3.2.1

  • PHP version = 8.1

  • Database = PostgreSQL 15.4

  • Elasticsearch no

  • OS: [Windows 11]

  • Browser [Firefox, Chrome]

  • Version [Last]

I guess the error is hiding between the lines 62 and 112 in the file "/var/www/phpmyfaq/src/phpMyFAQ/Database/Pgsql.php"

P.S.: A few days ago I did the same update for PhpMyFaq+MySQL = Everything works fine
P.P.S: Thank you so much for your work!!!

@thorsten thorsten self-assigned this Sep 28, 2023
@thorsten thorsten added the Bug label Sep 28, 2023
@thorsten thorsten added this to the 3.2.2 milestone Sep 28, 2023
@thorsten
Copy link
Owner

@MyStoreroom did you run update.php on that installation?

@Git-Hub-Ivan
Copy link
Author

Yes, of course. I did it according to the instructions
I copied and pasted the necessary part of the link:
image

@thorsten
Copy link
Owner

Do you have direct access to your database?

@Git-Hub-Ivan
Copy link
Author

Yes, I have direct access to the database. But I have already restored the server from the snapshot.
I can try to recreate the situation soon if necessary. What data do you need?

@thorsten
Copy link
Owner

Awesome, please check if the table faquserdata contains the following two columns:

  • twofactor_enabled
  • secret

Thanks in advance!

@Git-Hub-Ivan
Copy link
Author

Hello @thorsten
Sorry for the delay, there were problems accessing the server - now I have a local server image for experiments.
Let me make a clarification...
The first time I tried to update PhpMyFaq in the third step, I got an error:
image

After that, I ran the update again and everything was successful:
image

But when I try to log in or open any FAQ, I get the error described above
After the update, the "faquserdata" table does not contain the "twofactor_enabled" and "secret" columns:
image

Let me know if you need any more information

@thorsten
Copy link
Owner

thorsten commented Oct 2, 2023

One of the update queries fails on PostgreSQL, I'll check that.

@thorsten
Copy link
Owner

thorsten commented Oct 2, 2023

@MyStoreroom fixed 2 update queries, should work now :-)

@Git-Hub-Ivan
Copy link
Author

I confirm - fixed
image

Thanks for the quick fix!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants