Instant Articles not working? Here is a fix for Caught Exception fatal error by Facebook Instant Articles.
By now you should have probably enabled Facebook’s mobile publishing format Instant Articles for speedy and mobile friendly serving. If not click here to learn how to sign up for Instant Articles and start publishing along with making money from Facebook. In this article we are going to discuss about fatal errors caused by Facebook’s Instant Articles.
Ever seen an fatal error like this uncaught exception or anything related to error in validating Facebook tokens or sessions?
Fatal error: Uncaught exception 'Facebook Exceptions FacebookAuthenticationException' with message "Error validating access token: The session has been invalidated because the user has changed the password. in /wordpress/../wp-content/plugins/fb-instant-articles/vendor/facebook/graph-sdk/src/Facebook/Exceptions/FacebookResponseException.php:89 Stack trace: #0 /wp-content/plugins/fb-instant-articles/vendor/facebook/graph-sdk/src/Facebook/FacebookResponse.php(210): Facebook Exceptions FacebookResponseE sdk/src/Facebook/FacebookResponse.php(82): Facebook FacebookResponse- decodeBody0 3 /srv/ in /srv/content/plugins/fb-instant-articles/vendor/facebook/graph sdk/src/Facebook/Exceptions/FacebookResponseException.php on line 89
Solving Instant Articles Fatal Errors
First of all it’s most important to understanding what’s causing the fatal error exception caught. Facebook’s Instant Articles for WP plugin that powers WordPress based websites to publish the articles instantly is notoriously quite backward in sense of using server-side authentication flow. If you happen to be an admin of the Facebook page that has Instant Articles publishing enabled and you do one of the following with your Facebook account, then you might run into multiple issues of expired access tokens as mentioned in Facebook’s developer guidelines here.
4 different scenarios of handling expired access tokens
- The token expires after
expirestime (2 hours is the default).
- The user changes her password which invalidates the access token.
- The user de-authorizes your app.
- The user logs out of Facebook.
If Instant Articles for WP plugin is breaking your (admin or dashboard’s) plugin page, and you are receiving errors that doesn’t even perish after deleting the plugin files from the WordPress’s plugin directory at your host; then it’s time to go the database way.
On your database – we are using PHPMyAdmin for MySQL in ServerPilot managed Digital Ocean VPS for TechSansar – search in tableprefix_options table for option_name Instant-Articles. You can directly find Instant-Articles values in WordPress database or can manually do SQL search as illustrated below.
Do not forget to take backup of your database or entire WordPress before committing changes in system files or database itself.
You the have options to either directly change the Facebook App ID and Secret Key or delete all Instant Article values and reinstall the plugin again from the scratch.
You can also remove all transient options that may be associated with Instant Article plugin, you can recognize them in one of these formats
However, these transient values may content meta or information regarding already created instant article from the published blog posts. But deleting these transient values in WordPress’s database should make the sky fall for you.
This method of changing plugin meta and values in WordPress database should work for all other plugins that cause such errors. Hope this solves your issues too.