• Resolved 4a4b

    (@4a4b)


    After an update to PHP 8.0 a user got a fatal error:

    [29-Nov-2022 08:05:42 UTC] PHP Fatal error:  Uncaught ValueError: Unknown format specifier " " in /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/class-wp2fa.php:525
    Stack trace:
    #0 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/class-wp2fa.php(525): sprintf('...', '...', '...')
    #1 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Admin/class-setup-wizard.php(569): WP2FA\WP2FA::get_wp2fa_email_templates('...')
    #2 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(928): WP2FA\Admin\Setup_Wizard::send_authentication_setup_email(65)
    #3 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(428): WP2FA\Authenticator\Login::email_authentication_page(Object(WP_User))
    #4 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(326): WP2FA\Authenticator\Login::login_html(Object(WP_User), '...', '...')
    #5 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(169): WP2FA\Authenticator\Login::show_two_factor_login(Object(WP_User))
    #6 /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/Authenticator/class-login.php(99): WP2FA\Authenticator\Login::clear_session_and_show_2fa_form(Object(WP_User))
    #7 /html/wordpress/wp-includes/class-wp-hook.php(307): WP2FA\Authenticator\Login::wp_login('...', Object(WP_User))
    #8 /html/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #9 /html/wordpress/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #10 /html/wordpress/wp-includes/user.php(110): do_action('...', '...', Object(WP_User))
    #11 /html/wordpress/wp-login.php(1221): wp_signon(Array, true)
    #12 {main}
      thrown in /html/wordpress/wp-content/plugins/wp-2fa/includes/classes/class-wp2fa.php on line 525

    I could not replicate the problem with my own account. After a downgrade to PHP 7.4.33 the user was able again to login.

    The site is part of a multisite installation

    WordPress: 6.0.3
    WP 2FA: 2.3.0
    Custom Theme

    • This topic was modified 1 year, 4 months ago by 4a4b.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor robertabela

    (@robert681)

    Hello @4a4b

    Thank you very much for using our plugin. I am sorry to read about your issue. Can you please answer the below questions so we can better understand the context of the issue?

    1) When you upgraded to PHP 8, were there other users who have encountered the same problem?

    2) Since you did not encounter the same problem with your account, can you highlight the differences between your account and the account of the other user?

    3) At what stage is the error reported? Is it reported when they try to log in, or when they are doing something else?

    4) Do you have a staging environment on which this can be easily reproduced? If yes, can you reproduce it each time?

    Looking forward to hearing from you.

    Thread Starter 4a4b

    (@4a4b)

    Hi @robert681

    1) When you upgraded to PHP 8, were there other users who have encountered the same problem?

    It was only one user

    2) Since you did not encounter the same problem with your account, can you highlight the differences between your account and the account of the other user?

    The other user is the only one who has choosen the method to get the 2FA code by email.

    3) At what stage is the error reported? Is it reported when they try to log in, or when they are doing something else?

    I found the corresponding entry in the access log – the user obviously tried to log in:

    ***.***.***.*** - - [29/Nov/2022:09:05:13 +0100] "POST /wp-login.php HTTP/2.0" 500 8623 "https://example.com/wp-login.php" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36" example.com

    4) Do you have a staging environment on which this can be easily reproduced? If yes, can you reproduce it each time?

    I have tested it now on a testing environment: I could reproduce the error 500 on PHP 8.0 with a user that has selected the method “one-time codes via email”.

    Plugin Contributor robertabela

    (@robert681)

    Sorry for the delay on this one @4a4b

    Thank you for the detail. We will set up a test environment and test this and include a fix in the next update.

    Please let us know if there is anything else we can do for you at the moment.

    Thank you for your patience and cooperation.

    Can confirm PHP8.x incompatibility. Got quite similar error:

    PHP Fatal error:  Uncaught ValueError: Missing format specifier at end of string in /var/www/patmos/wp-content/plugins/wp-2fa/includes/classes/Utils/class-date-time-utils.php:63

    @robert681 PHP 7.4 is EOL.

    • This reply was modified 1 year, 3 months ago by coodeis.
    Plugin Contributor robertabela

    (@robert681)

    Hello @xkouhiax

    Thank you for posting on this forum. If you have encountered any issues and needs support from us, please open your own forum thread, as per these forums’ guidelines.

    Thank you for your understanding and cooperation.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal error “Unknown format specifier”’ is closed to new replies.