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

Updating to 3.5.2 - Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /app/wp-content/plugins/auth0/lib/WP_Auth0_DBManager.php on line 225 #464

Closed
jessCmi opened this issue May 15, 2018 · 4 comments
Assignees
Milestone

Comments

@jessCmi
Copy link

jessCmi commented May 15, 2018

I have been trying to upgrade a client's site to the latest version of the plugin for a while now but it keeps killing the staging site. We followed the instructions for updating to 3.5, with the client creating a new API token and adding it to staging. Then when I push the updated plugin, we get this error: Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /app/wp-content/plugins/auth0/lib/WP_Auth0_DBManager.php on line 225 and the site is unusable.

Have you all seen this issue? Tell me if you need more info or know how we can deal with this.

@joshcanhelp
Copy link
Contributor

Hi @jessCmi ... apologies for the trouble here. What version are you upgrading from? And, if you have access to you PHP error logs, can you see if there is anything relevant happening at/around the same time?

In short, something during the upgrade process is failing and not being handled well. I made a note on my end to correct that (though this is the first report we've had of it). Worst case, I can provide steps on how to do these updates manually and skip this process to get you on the latest version.

Thanks!

@jessCmi
Copy link
Author

jessCmi commented May 16, 2018

Thanks for the quick response. That error is the only one showing up on the logs for the staging environment. I pasted in the whole thing below in case its helpful.

Error: Cannot use object of type stdClass as array in /app/wp-content/plugins/auth0/lib/WP_Auth0_DBManager.php on line 225

Call Stack:
    0.0006     394376   1. {main}() /app/wp-admin/plugins.php:0
    0.0006     395048   2. require_once('/app/wp-admin/admin.php') /app/wp-admin/plugins.php:10
    0.0006     395528   3. require_once('/app/wp-load.php') /app/wp-admin/admin.php:31
    0.0010     402088   4. require_once('/app/wp-config.php') /app/wp-load.php:37
    0.0014     404648   5. require_once('/app/wp-settings.php') /app/wp-config.php:3690
    0.2926    4524200   6. do_action() /app/wp-settings.php:327
    0.2926    4524576   7. WP_Hook->do_action() /app/wp-includes/plugin.php:453
    0.2926    4524576   8. WP_Hook->apply_filters() /app/wp-includes/class-wp-hook.php:310
    0.3002    4768496   9. WP_Auth0_DBManager->check_update() /app/wp-includes/class-wp-hook.php:286
    0.3002    4768496  10. WP_Auth0_DBManager->install_db() /app/wp-content/plugins/auth0/lib/WP_Auth0_DBManager.php:26

On my local setup I am also seeing this notice:

Notice: Undefined index: path in /app/wp-content/plugins/auth0/lib/WP_Auth0_Options.php on line 95

Call Stack:
    0.0006     394376   1. {main}() /app/wp-admin/plugins.php:0
    0.0006     395048   2. require_once('/app/wp-admin/admin.php') /app/wp-admin/plugins.php:10
    0.0006     395528   3. require_once('/app/wp-load.php') /app/wp-admin/admin.php:31
    0.0010     402088   4. require_once('/app/wp-config.php') /app/wp-load.php:37
    0.0014     404648   5. require_once('/app/wp-settings.php') /app/wp-config.php:3690
    0.2926    4524200   6. do_action() /app/wp-settings.php:327
    0.2926    4524576   7. WP_Hook->do_action() /app/wp-includes/plugin.php:453
    0.2926    4524576   8. WP_Hook->apply_filters() /app/wp-includes/class-wp-hook.php:310
    0.3002    4768496   9. WP_Auth0_DBManager->check_update() /app/wp-includes/class-wp-hook.php:286
    0.3002    4768496  10. WP_Auth0_DBManager->install_db() /app/wp-content/plugins/auth0/lib/WP_Auth0_DBManager.php:26
    0.3083    4779072  11. WP_Auth0_Options->get_web_origins() /app/wp-content/plugins/auth0/lib/WP_Auth0_DBManager.php:209

Maybe some of this is helpful, I appreciate you checking it out for me.

@joshcanhelp
Copy link
Contributor

@jessCmi - Thank you for that. The Notice: Undefined index error is known and being fixed in the next version.

I think the best bet here is to manually update the Application that your WP site is using, manually update the settings in your site, manually update the version number, then update the plugin. The steps are below:

Under Application Setup here, check step 10 and make sure you have that grant active.

On the same page, walk through section called Authorize the Application for the Management API and make all the changes there.

Now, go to http://YOUR_SITE_DOMAIN/wp-admin/options.php and search for "auth0_db_version". Change that to 17, scroll down, and click Save Changes.

You now be able to update the plugin without any issues. Once updated, go to the Auth0 settings page in wp-admin and change Advanced > "Widget URL" to https://cdn.auth0.com/js/lock/11.5/lock.min.js.

That should get you up-to-date with the latest! Let me know if you're still having issues or if that takes care of it for you.

@joshcanhelp
Copy link
Contributor

Fixed in #467, merged into dev and ready for release 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants