• Resolved therealgilles

    (@chamois_blanc)


    Hello,

    I just got the following database error while trying to log in using oauth2:

    WordPress database error Unknown column 'code_challenge' in 'field list' for query INSERT INTO wp_oauth_authorization_codes (authorization_code, client_id, user_id, redirect_uri, expires, scope, code_challenge, code_challenge_method) VALUES ('<hidden_value>', '<hidden_value>', '210', 'https://<app_url>/oauth_redirect/', '2020-12-05 18:34:53', 'basic', '', '') made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), apply_filters('template_include'), WP_Hook->apply_filters, wpoauth_server_template_redirect_intercept, require_once('/plugins/wp-oauth-server/library/class-wo-api.php'), WPOAuth2\Server->handleAuthorizeRequest, WPOAuth2\Controller\AuthorizeController->handleAuthorizeRequest, WPOAuth2\ResponseType\AuthorizationCode->getAuthorizeResponse, WPOAuth2\ResponseType\AuthorizationCode->createAuthorizationCode, WPOAuth2\Storage\Wordpressdb->setAuthorizationCode

    Any advice?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    After looking at the code, I was able to workaround the bug by deactivating and re-activating the plugin.

    Confirmed. Looks like plugin updates via CLI or web UI fail to activate DB migration routines.

    Plugin Author Justin Greer

    (@justingreerbbi)

    Thank you both for the info and sorry for the issues. We will be running some tests to see why this is happening.

    The update routine would be running alongside the install but clearly, something is out of order for certain installs.

    I will have a look today and get out a fix ASAP.

    Plugin Author Justin Greer

    (@justingreerbbi)

    We have tracked down the issue and cause of the problems.

    Details of the issue

    During an update using auto-update, WordPress’s mass update, or FTP, the DB updater does not run as expected due to WP hooks not being triggered.

    Solution / Workaround

    Manually deactivate and reactive the plugin seems to solve the issue. This will trigger the DB upgrade script using the expected hook.

    We are working on a new release that addresses this issue now and for future releases.

    Thread Starter therealgilles

    (@chamois_blanc)

    Thanks for the update and details Justin.

    As far as I can see, the plugin does not allow me to enable the new ‘auto-updates’ (I guess because I am using the pro version) and I am not sure what “WordPress’s mass update” means. As far as I recall, I saw plugin updates were available, went to the dashboard update page, selected the plugin updates available, and then clicked the update button. Does that fit in your description?

    Plugin Author Justin Greer

    (@justingreerbbi)

    @chamois_blanc yes. We discovered that the register_activation_hook function provided by WP does not run all the time on any updates. Albeit something that started in 2010, this is the first time we are running into the issue.

    • This reply was modified 3 years, 8 months ago by Justin Greer.
    Plugin Author Justin Greer

    (@justingreerbbi)

    Starting with 4.1.5, the plugin checks for a DB version so that all db upgrades are run accordingly.

    I just pushed the 4.1.5 update that contains this DB update fix. This will ensure that these issues never happen again on a plugin update where DB modifications are required.

    Thread Starter therealgilles

    (@chamois_blanc)

    Hi Justin,

    I updated to the latest release and saw this in my debug.log file:

    WordPress database error Table '<database>.wp_oauth_clients' doesn't exist for query ALTER TABLE wp_oauth_clients MODIFY client_id VARCHAR(191); made by require_once('wp-admin/admin.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/wp-oauth-server/wp-oauth-server.php'), require_once('/plugins/wp-oauth-server/wp-oauth-main.php'), _WO, WO_Server::instance, WO_Server->__construct, WO_Server->check_db, WO_Server->upgrade

    Maybe a piece is still missing?

    • This reply was modified 3 years, 8 months ago by therealgilles.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Problem with recent release’ is closed to new replies.