woocommerce / facebook-for-woocommerce

A first-party extension plugin built for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/facebook/
GNU General Public License v2.0
211 stars 136 forks source link

2 Errors Reconnecting To Facebook: Permissions Error and Could Not Retrieve Facebook Business Extension System User #2148

Closed theabhig closed 1 year ago

theabhig commented 2 years ago

πŸ”Ž Isolate the bug

✍️ Describe the bug

There are 2 separate error messages, but I suspect they may be related so I have submitted these as a single issue.

My test site had an existing, working connection. These errors happened after I disconnected and tried to reconnect.

When I tested this on a site with a brand new connection, I wasn't able to replicate the issue and connected fine.

First error - Permissions error: access_denied, reason: user_denied

When I disconnected from Facebook and tried to reconnect from WP-Admin > Marketing > Facebook, I was first greeted by this screen:

Screenshot 2022-02-03 at 08 47 54

When I clicked on cancel, it gave me this error:

Annotation on 2022-02-03 at 08-49-45

And the connection wasn't established.

Second error - Could not retrieve Facebook Business Extension System User

After the first error, I went to siteurl/wp-admin/options.php and changed the wc_facebook_external_business_id field to a random string of 13 characters.

I then went back to Marketing > Facebook to try to connect again.

This time, I was able to go through the connection wizard on Facebook successfully.

Screenshot 2022-02-03 at 09 23 25

However when I clicked on Done, I was met with this error:

Annotation on 2022-02-03 at 08-50-09

From the Facebook Business System Users, I can see a new system user was created and it has been granted access to my page, catalog, and pixel:

Annotation on 2022-02-03 at 10-02-33

But it does not connect my site to Facebook Business Manager.

There isn't an option on my Business Manager to delete System Users but I also tried following the steps in the documentation to remove the app and extension completely and try again - https://woocommerce.com/document/facebook-for-woocommerce-uninstall-plugin-and-remove-woocommerce-facebook-app/ - but this also didn't work.

πŸšΆβ€β™€οΈ Steps to reproduce

First error - Permissions error: access_denied, reason: user_denied

  1. From a site with a working Facebook connection, disconnect the site.
  2. Try to reconnect

Second error - Could not retrieve Facebook Business Extension System User

  1. After following the steps for the first error, navigate to siteurl/wp-admin/options.php and change the wc_facebook_external_business_id field to a random 13 character string and press Save
  2. Navigate to Marketing > Facebook and try to reconnect
  3. Follow the prompts on the connection wizard and click Done.
  4. This should generate the error Could not retrieve Facebook Business Extension System User

βœ”οΈ Expected behavior

The expected behaviour is that the extension will successfully reconnect to Facebook

πŸ—ƒ Logs

The 42006 errors match the times I was getting the second error message.

02-03-2022 @ 08:50:59 - Failed to connect to Facebook. Reason: Permissions error: access_denied, reason: user_denied
02-03-2022 @ 08:51:39 - Failed to connect to Facebook. Reason: Permissions error: access_denied, reason: user_denied
02-03-2022 @ 08:57:20 - Failed to connect to Facebook. Reason: {
    "message": "(#42006) There was an error adding FBE\/EBC business assets to the system user.",
    "type": "OAuthException",
    "code": 42006,
    "fbtrace_id": "AqIjd-lztvJBS6HgpzR1aRe"
}
02-03-2022 @ 08:57:33 - Failed to connect to Facebook. Reason: Permissions error: access_denied, reason: user_denied
02-03-2022 @ 08:59:35 - Failed to connect to Facebook. Reason: {
    "message": "(#42006) There was an error adding FBE\/EBC business assets to the system user.",
    "type": "OAuthException",
    "code": 42006,
    "fbtrace_id": "AMml76WFHx0MpMy13mYvJWV"
}
02-03-2022 @ 09:07:55 - Failed to connect to Facebook. Reason: {
    "message": "(#42006) There was an error adding FBE\/EBC business assets to the system user.",
    "type": "OAuthException",
    "code": 42006,
    "fbtrace_id": "A_exBfrGgs_H0B3Hofy85iQ"
}
02-03-2022 @ 09:21:43 - Failed to connect to Facebook. Reason: Permissions error: access_denied, reason: user_denied
02-03-2022 @ 09:21:56 - Failed to connect to Facebook. Reason: Permissions error: access_denied, reason: user_denied
02-03-2022 @ 09:23:34 - Failed to connect to Facebook. Reason: {
    "message": "(#42006) There was an error adding FBE\/EBC business assets to the system user.",
    "type": "OAuthException",
    "code": 42006,
    "fbtrace_id": "ATQC5VpUg5MJwbw7ru9JTNz"
}
02-03-2022 @ 09:48:21 - Failed to connect to Facebook. Reason: Permissions error: access_denied, reason: user_denied
02-03-2022 @ 09:50:28 - Failed to connect to Facebook. Reason: {
    "message": "(#42006) There was an error adding FBE\/EBC business assets to the system user.",
    "type": "OAuthException",
    "code": 42006,
    "fbtrace_id": "ArNAt_OTePxJmZYcZoMuI6I"
}
` ### WordPress Environment ### WordPress address (URL): https://theabhigfbtest.mystagingwebsite.com Site address (URL): https://theabhigfbtest.mystagingwebsite.com WC Version: 6.1.1 REST API Version: βœ” 6.1.1 WC Blocks Version: βœ” 6.5.2 Action Scheduler Version: βœ” 3.4.0 WC Admin Version: βœ” 3.0.3 Log Directory Writable: βœ” WP Version: 5.9 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: βœ” Language: en_US External object cache: βœ” ### Server Environment ### Server Info: nginx PHP Version: 7.4.27 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 7.80.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 5.5.5-10.4.22-MariaDB-log Max Upload Size: 2 GB Default Timezone is UTC: βœ” fsockopen/cURL: βœ” SoapClient: βœ” DOMDocument: βœ” GZip: βœ” Multibyte String: βœ” Remote Post: βœ” Remote Get: βœ” ### Database ### WC Database Version: 6.1.1 WC Database Prefix: wp_ Total Database Size: 4.38MB Database Data Size: 2.38MB Database Index Size: 2.00MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.17MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.13MB + Index: 0.13MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_hfcm_scripts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 1.06MB + Index: 0.06MB + Engine InnoDB wp_postmeta: Data: 0.14MB + Index: 0.11MB + Engine InnoDB wp_posts: Data: 0.06MB + Index: 0.06MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points_log: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_exported_csv_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_pickup_locations_geodata: Data: 0.02MB + Index: 0.05MB + Engine InnoDB ### Post Type Counts ### afadv_qty: 1 attachment: 24 jp_pay_product: 1 page: 9 post: 1 product: 20 product_variation: 7 revision: 2 shop_order: 4 wc_order_status: 8 wc_pickup_location: 2 ### Security ### Secure connection (HTTPS): βœ” Hide errors from visitors: βœ” ### Active Plugins (4) ### Facebook for WooCommerce: by Facebook – 2.6.9 WooCommerce Stripe Gateway: by WooCommerce – 6.1.0 WooCommerce Shipping & Tax: by WooCommerce – 1.25.22 WooCommerce: by Automattic – 6.1.1 ### Inactive Plugins (13) ### Addify - Advanced Product Quantity: by Addify – 1.2.0 Akismet Anti-Spam: by Automattic – 4.2.2 Header Footer Code Manager: by 99robots – 1.1.16 Jetpack: by Automattic – 10.7-a.1 WooCommerce Blocks: by Automattic – 6.9.0 WooCommerce Checkout Field Editor: by WooCommerce – 1.6.1 WooCommerce Customer/Order/Coupon Export: by SkyVerge – 5.3.2 WooCommerce Distance Rate Shipping: by Automattic – 1.0.26 WooCommerce Local Pickup Plus: by SkyVerge – 2.9.4 WooCommerce One Page Checkout: by Automattic – 1.7.11 WooCommerce Order Status Manager: by SkyVerge – 1.13.2 WooCommerce PayPal Payments: by WooCommerce – 1.6.5 WooCommerce Points and Rewards: by WooCommerce – 1.6.43 ### Dropin Plugins (2) ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Settings ### API Enabled: – Force SSL: – Currency: GBP (Β£) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #5 - /shop/ Cart: #6 - /cart/ Checkout: #7 - /checkout/ My account: #8 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 3.9.1 Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: βœ” ### Templates ### Overrides: – ### Action Scheduler ### Complete: 220 Oldest: 2022-01-04 20:40:53 +0000 Newest: 2022-02-03 09:49:08 +0000 Pending: 3 Oldest: 2022-02-04 08:20:28 +0000 Newest: 2022-02-04 08:20:28 +0000 ### Status report information ### Generated at: 2022-02-03 09:50:48 +00:00 `

Other instances

Similar errors have also been reported:

4724760-zen 4724725-zen 4742974-zen 4741909-zen https://wordpress.org/support/topic/could-not-retrieve-facebook-business-extension-system-user/

amElnagdy commented 2 years ago

4724760-zen

raifd commented 2 years ago

4704268-zen

amElnagdy commented 2 years ago

https://wordpress.org/support/topic/permissions-error-access_denied-reason-user_denied/

jobthomas commented 2 years ago

I see that the latest release of Facebook is from 20 days ago - @theabhig @amElnagdy @raifd care to search Zendesk/forums back 20 days to see if this is connected to that release? (or is that the other instances/part)?

raifd commented 2 years ago

@jobthomas Just searched Zendesk and the first tickets regarding this seem to have appeared yesterday. I do not think this is related to the update!

jobthomas commented 2 years ago

Hmmm, is there another extension/core update that could cause this, or are we thinking this is on the Facebook side?

raifd commented 2 years ago

Is there any way we can find out what updates were pushed yesterday? My initial thought on this was some kind of Facebook Service being down, not sure though.

theabhig commented 2 years ago

It seems to only happen when reconnecting an existing connection. If it was something on the Facebook end being down, I would have thought it wouldn't allow me to set up a connection with a new site, but I was able to do that with no issue.

The earliest ticket I found was from Monday, which references the first error message: 4705156-zen

It did strike me as odd that we suddenly started seeing an influx in the last day or so when the extension was last updated a few weeks ago, which suggests it might be something on Facebook's end in terms of how they handle reconnection.

anant1811 commented 2 years ago

I suspect this might be due to some changes on FB side, since on 4685206-zen β€” I was able to connect my own FB account without issue but the customer's account is returning the same error reported here. I've asked them to try and check if creating a new catalog helps, they still have to reply on that though.

daniyalahmadk commented 2 years ago

https://wordpress.org/support/topic/integration-with-facebook-3/

luanluta commented 2 years ago

https://wordpress.org/support/topic/something-went-wrong-when-connecting-to-facebook-56/

jrick1229 commented 2 years ago

https://wordpress.org/support/topic/algo-deu-errado-ao-conectar-ao-facebook-ou-something-went-wrong-when-connecting/

jrick1229 commented 2 years ago

Not sure if this is related, but Graph API v5.0 expired on the same day when we started seeing these issues: https://developers.facebook.com/docs/graph-api/changelog/version5.0

matecocidocontortafritas commented 2 years ago

Hola, estoy teniendo el mismo problema desde temprano

mariluciani commented 2 years ago

Hi Guys,

Today the system works! I was able to correctly reconnect!

Thank you have a nice day

Marina

matecocidocontortafritas commented 2 years ago

El error sigue persistiendo, a alguno mas le sigue pasando? Gracias de ante mano

teteraazul commented 2 years ago

Prueba de nuevo, a mi me ha funcionado.

FabricioCapelini commented 2 years ago

the errors continue for me.

matecocidocontortafritas commented 2 years ago

image

me sigue persistiendo este error

moh04213 commented 2 years ago

Hi Guys,

Today the system works! I was able to correctly reconnect!

Thank you have a nice day

Marina

the error continue for me, could you tell us what did you do ?

0xatok commented 2 years ago

before I had a problem like this image Then I tried to reconnect but a problem happened like this. image

NathalyaVides commented 2 years ago

Reported here too: https://wordpress.org/support/topic/facebook-for-woocommerce-doesnt-work/

tysonL1010 commented 2 years ago

Bump, I have the same issue.

I had my facebook business manager/assets connected to an old shopify store, and I have since tried to migrate the connection to a new woocommerce/wordpress store. I think because my facebook busienss manager was already connected to shopify previously, it is causing errors when connecting to wordpress.

I am wondering if anyone else has these characteristics when facing the same issue?

tysonL1010 commented 2 years ago

I have found a workaround. I can connect my facebook business account to wordpress, by using the facebook for wordpress plugin.

rashedripon commented 2 years ago

Reported here as well: https://wordpress.org/support/topic/pixel-is-not-integrated-into-my-page/

delegacz commented 2 years ago

It seems to only happen when reconnecting an existing connection. If it was something on the Facebook end being down, I would have thought it wouldn't allow me to set up a connection with a new site, but I was able to do that with no issue.

The earliest ticket I found was from Monday, which references the first error message: 4705156-zen

It did strike me as odd that we suddenly started seeing an influx in the last day or so when the extension was last updated a few weeks ago, which suggests it might be something on Facebook's end in terms of how they handle reconnection.

Not really only for reconnects, This happens for me with a brand-new connection err

tysonL1010 commented 2 years ago

Not sure if this is related, but Graph API v5.0 expired on the same day when we started seeing these issues: https://developers.facebook.com/docs/graph-api/changelog/version5.0

I did a little more digging and found this page.

https://developers.facebook.com/docs/graph-api/guides/versioning

_"The goal for having versioning is for developers building apps to be able to understand in advance when an API or SDK might change. They help with web development, but are critical with mobile development because a person using your app on their phone may take a long time to upgrade (or may never upgrade).

Each version will remain for at least 2 years from release giving you a solid timeline for how long your app will remain working, and how long you have to update it to newer versions."_

As mentioned by [jrick1229] earlier in this thread, graph api v5.0 was discontinued on the same day issues started to arise. Can someone on the development team comment on whether the issues from the woocommerce plugin is related to v5.0 becoming expired?

anant1811 commented 2 years ago

4715548-zen as well.

jacoswan commented 2 years ago

Similar issue in 4761087-zen

pauljacobson commented 2 years ago

We have reports here too:

matecocidocontortafritas commented 2 years ago

Es increible que aun esto este sucediendo.

aheckler commented 2 years ago

4757110-zen

budzanowski commented 2 years ago

Can someone on the development team comment on whether the issues from the woocommerce plugin is related to v5.0 becoming expired?

The plugin is using API version 11.0 so this does not look related. https://github.com/woocommerce/facebook-for-woocommerce/blob/master/includes/fbgraph.php#L29

sukafia commented 2 years ago

Typically, the first error Permissions error: access_denied, reason: user_denied is shown when the user doesn't grant FB permission (e.g started the setup & cancelled: https://d.pr/i/ng80zf)

EtiennePoolman commented 2 years ago

One more report in 4741909-zd-woothemes

solstudioim commented 2 years ago

Oddly, I wasn't able to replicate the problem (disconnecting an existing connection and reconnecting).

Even, the I didn't see the first error, thus I didn't get the second error about the system user.

Here's the screencast: https://d.pr/i/exGiKk

budzanowski commented 2 years ago

One word of explanation. It is suspected what could be the reason we are currently seeing this issue but I needed some time to confirm. There were no changes to the plugin but there was one change to the connection bridge that is used to authenticate the plugin with the Facebook services. That change that was introduced was concerned, only, with what is being logged and how the logging is happening. No business logic was changed.

Previously all of the errors during the connection stage that have been observed have been lumped into one Something went wrong when connecting to Facebook! Please try again. And the details have been lost.

The connection is a multistage process and any of the stages could fail. With the recent change, each stage can generate a separate error. The gist of the error is what people are seeing currently under the Something went wrong... After clicking Go back to my site the plugin will catch all of the additional details from the connection process - this can be seen in the logs. Hopefully, this will allow reacting better, in a more granular way, to the problems merchants are facing.

tamas-andrei commented 2 years ago

152785684-341a80df-7f56-4522-8721-20ae921d62e4

02-10-2022 @ 13:30:00 - There was an error trying sync products using the Catalog Batch API for job 09d9d66f009bf40297202b601c577381: Cannot create the API instance because the access token is missing. 02-10-2022 @ 13:37:56 - There was an error trying sync products using the Catalog Batch API for job 1e2187859f400defe16f55e49d1d4fd1: Cannot create the API instance because the access token is missing. 02-10-2022 @ 13:38:04 - There was an error trying sync products using the Catalog Batch API for job 2797d1e61b645d879ea9fb4598239aea: Cannot create the API instance because the access token is missing. 02-10-2022 @ 21:07:19 - Unable to detect valid feed configuration: No catalog ID

matecocidocontortafritas commented 2 years ago

es increible que aun no haya una solucion para esto

tamas-andrei commented 2 years ago

No one find a solution for this problem?

mehmetertugrul commented 2 years ago

Hello, the problem still persists. All my 10 different woocommerce projects have the same issue. Urgent solution needed.

tysonL1010 commented 2 years ago

Try Facebook for WORDPRESS. It seems to work this way

tamas-andrei commented 2 years ago

I try Facebook for WORDPRESS and this is working but the product are not imported to the magazin.

mehmetertugrul commented 2 years ago

Woocommerce for wordpress is a workaround but Facebook Conversions API is not working. This causes a lot of money to be spent in the advertising stages.

tysonL1010 commented 2 years ago

you can set up conversion api through the facebook for wordpress plugin. It seems to be working fine unless you know something I don't

Flyerg commented 2 years ago

Hello, the plugin was connected, I had to disconnect it and when I try to connect it again I get the same errors. I already tried everything but I can't solve it, if someone finds a way please share, thanks!

thracefulton commented 2 years ago

It appears that the merchant in 4785585-zen was able to resolve their (suspected) instance of this error using the following steps:

  1. From Facebook Business Manager, navigate to More Tools β†’ Business Settings β†’ Brand Safety β†’ Domains (alternatively, go to Commerce > All Tools > Business Settings > Brand Safety > Domains)
  2. Use one of 3 options to Verify your domain.
  3. Reinstall plugin/reinitialize the "Get Started" wizard

UPDATE: Another merchant, in 4789752-zen, attempted this process and was unable to resolve the issue.

thracefulton commented 2 years ago

And another instance in 4789752-zen

EricaKuschel commented 2 years ago

4757110-zen

I am having the customer try out the workaround.

julonde commented 2 years ago

I would like to help. Please, if someone is that nice and explain me what this "4789752-zen" is. (I am new here in Github) I have the same trouble since 7 Days. I tried everything, that was recommand and maybe even more, i doesnΒ΄t help. Sometime the Error Changed a bit but all in all the Shop does not connected to FB. With one Shop of my clients itΒ΄s working, on the other Shop itΒ΄s not. Unfortunatly they are too diffrent from the theme, plugin, installation and Co. to compare. On both Shops i installed the Woocommerce Facebook Plugin New - no Reconnection. As far as i know, this plugin was not in use ever on the Wordpress installations.