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

Unable to sync product catalog when sync is enabled (Graph API returns Unknown Error) #2627

Closed
2 tasks done
oceanlivingfoods opened this issue Sep 4, 2023 · 11 comments
Closed
2 tasks done
Assignees
Labels
needs feedback The issue/PR needs a response from any of the parties involved in the issue.

Comments

@oceanlivingfoods
Copy link

oceanlivingfoods commented Sep 4, 2023

🔎 Isolate the bug

  • I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Facebook for WooCommerce.
  • I have confirmed this occurs when only WooCommerce and Facebook for WooCommerce are active and when using a default WordPress or WooCommerce theme.

✍️ Describe the bug

IMPORTANT: Please review the Wordpress Forums thread at https://wordpress.org/support/topic/unable-to-sync-catalog/#post-17008247

The Facebook Sync issue exhibits itself as several defects:

  1. New products can be added to the Facebook catalog via Facebook Sync when first created, but the Catalog sync fails for all existing products when the Catalog is synced manually with the "Sync Products" button. The Graph API returns the following error (I verified that the ID 5645229045522422 is a valid and active product in the catalog that was originally added by the WooCommerce plugin)
08-12-2023 @ 00:55:15 – Response code: 400 message: Bad Request body: {“error”:{“message”:”Unsupported post request. Object with ID ‘5645229045522422’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api”,”type”:”GraphMethodException”,”code”:100,”error_subcode”:33,”fbtrace_id”:”AYYjQZbZhtIDV7o5vhx2dBA”}}
  1. Editing a product with Facebook Sync enabled returns an "Unknown Error" when the product is saved.
  2. After removing the Facebook metadata from a Woocommerce product, when editing the product with Facebook Sync enabled, the Woocommerce for Facebook plugin never attempts to sync the product again.

All possible permissions have been granted to the Facebook for WooCommerce plugin, the plugin was reinstalled several times, and the catalog was recreated from scratch. None of these attempts at fixing the issue were successful.

The Facebook Commerce Manager reports the following "Something went wrong" error for all Sync attempts by the WooCommerce for Facebook plugin:

Product updates
Some items couldn't be added or updated because of the following errors: Unknown Error(10 products affected)
Something went wrong

I have made 5 attempts at contacting Facebook customer service for this issue, but they have all stop responding after a few days after requesting that I submit a screen recording and screenshots describing the issue. They have failed to follow up with me after 3 weeks of reporting the issue to them and sending the requested screen recording and screenshots.

🚶‍♀️ Steps to reproduce

  1. Enable debugging in WooCommerce.
  2. Create a catalog product, enable sync, and save the product.
  3. Verify that the product has been created in the Facebook Catalog.
  4. Edit the product and save it.
  5. Verify that the WooCommerce logs report an error from Graph API as described above.
  6. Press the "Sync Products" button in the WooCommerce for Facebook plugin settings.
  7. Verify that the changes to the product have not been synced to the Facebook catalog.
  8. Inspect the WooCommerce logs and verify that an error was returned by the Graph API as described above.
  9. Find the handle ID in the WooCommerce logs, then verify that the handle is returning an error in the Commerce Manager "Handles" section for that catalog as described above.
  10. Using the WooCommerce tools, attempt to "Delete All Products" from the Facebook Catalog.
  11. Inspect the WooCommerce logs and verify that an error was returned by the Graph API.
  12. Go to the Commerce Manager and verify that none of the products were deleted.

✔️ Expected behavior

The Facebook Catalog should remain in sync with the WooCommerce products when Sync is enabled both globally and for each product.

🗃 Logs

All logs and details can be found at https://wordpress.org/support/topic/unable-to-sync-catalog/#post-17008247
@rawdreeg
Copy link
Contributor

rawdreeg commented Sep 6, 2023

Thanks for reaching out. I have tried connecting using a clean account, and I was able to perform all API operations (Sync on connection, manual sync, manual delete of a single product, and catalog delete using the tool ) without any errors.

I looked at the Facebook documentation, and they say that "this error may occur if your access token is not added as a system user with appropriate permissions to the ad account that owns a Custom Audience."

The System user is created and automatically assigned to your account during the connection steps. I suspect there is some error in your account that FB needs to investigate and resolve. Two things you could maybe try:

  1. Reset your connection settings by navigating to your Dashboard -> WooCommerce -> Status -> Tools -> Facebook: Reset connection settings -> Click on reset settings. Then try to reconnect your FB business account

  2. You can verify that the ad account in Business Manager and verify that all system users appear under the ad account as Admin:

  • Click on Business Settings
  • Click the ad account
  • Select Add people
  • Search for system users and add them as Admins
  • Retry your API call

@rawdreeg rawdreeg added needs feedback The issue/PR needs a response from any of the parties involved in the issue. and removed needs investigation labels Sep 6, 2023
@oceanlivingfoods
Copy link
Author

oceanlivingfoods commented Sep 6, 2023 via email

@oceanlivingfoods
Copy link
Author

oceanlivingfoods commented Sep 6, 2023 via email

@rawdreeg
Copy link
Contributor

rawdreeg commented Sep 6, 2023

This is how mine looks:

Screenshot 2023-09-06 at 14 59 00

Can you try giving the connected user full control?

@oceanlivingfoods
Copy link
Author

oceanlivingfoods commented Sep 7, 2023 via email

@rawdreeg
Copy link
Contributor

rawdreeg commented Sep 7, 2023

Thanks for the feedback, @oceanlivingfoods. It's hard to pinpoint the issue as I can't reproduce any errors, which points to a potential issue with your account.

Some users have had issues with FB because they did not have 2FA enabled on their business accounts. Besides that, I have no idea what the issue may be. I suggest contacting Facebook support. I am closing this issue as this cannot be addressed by changing the plugin. Feel free to reopen if you have more information on this.

@rawdreeg rawdreeg closed this as completed Sep 7, 2023
@oceanlivingfoods
Copy link
Author

oceanlivingfoods commented Sep 7, 2023 via email

@rawdreeg
Copy link
Contributor

rawdreeg commented Sep 7, 2023

What about the missing system user? Should that have been created when the
plugin was connected

Yes. That was my expectation as well. My business account didn't create a system user on connection, but the generated token worked perfectly for me. They may have changed how this works.

How can I create it manually?
You can follow the instructions from Meta: https://www.facebook.com/business/help/503306463479099?id=2190812977867143.

Once you retrieve the token, you can update the wc_facebook_access_token value in the options table (or navigate to /wp-admin/options.php). If this doesn't work, you can disconnect your Facebook connection and reconnect afresh.

@oceanlivingfoods
Copy link
Author

oceanlivingfoods commented Sep 14, 2023 via email

@oceanlivingfoods
Copy link
Author

oceanlivingfoods commented Dec 10, 2023

@rawdreeg This is still an issue on my site, even after completely removing the catalog on Facebook, creating a new catalog, uninstalling and re-installing the plugin, and re-adding the products in WooCommerce. Here are the main issues:

  1. WooCommerce for Facebook plugin can create a product, and the new product appears in the Commerce Manager catalog, but any updates to the product that was just created by the plugin returns the following error:
12-10-2023 @ 04:08:08 - Request
method: POST
uri: https://graph.facebook.com/v17.0/7100195296754519
user-agent: Facebook-for-WooCommerce/3.1.5 (WooCommerce/8.3.1; WordPress/6.4.2)
body: {"name":"Test Book","description":"Test Book","image_url":"https:\/\/rawvegan.love\/wp-content\/uploads\/2023\/08\/French-Cuisine-Cover.png","additional_image_urls":"","url":"https:\/\/rawvegan.love\/shop\/test-book\/","category":"Uncategorized","product_type":"Uncategorized","brand":"RawVegan.Love","retailer_id":"wc_post_id_2595","price":199,"currency":"USD","availability":"in stock","visibility":"hidden","sale_price_start_date":"1970-01-29T00:00+00:00","sale_price_end_date":"2038-01-17T23:59+00:00","sale_price":0}
duration: 0.57398s

12-10-2023 @ 04:08:08 - Response
code: 400
message: Bad Request
body: {"error":{"message":"Unsupported post request. Object with ID '7100195296754519' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"AlQDP5C-jlIN0IuuoW900EZ"}}

12-10-2023 @ 04:08:08 - Updated product  7100195296754519 on Facebook has failed.

When I try to look up the handle for the Graph API on Facebook, Facebook shows an error page (the handle lookup screen appears to be broken on Facebook).

Screenshot 2023-12-09 201848

  1. Any product where I "Reset the Facebook metadata" in the "Facebook Product Sync" section of the product page permanently prevents that product from being synced again, either by updating the product or using the manual "Sync Products" button in the Product Sync tab of the plugin. And yes, the "Sync and hide in catalog" option is enabled for all of those products.

  2. Products that were created by the plugin are not deleted from the Catalog using the "Delete product(s) from Facebook" link on the Product page. It only resets the "Facebook Product Sync" section to say This product is not yet synced to Facebook, and I cannot get the product to re-sync. Here is the error:

12-10-2023 @ 05:07:45 - Request
method: DELETE
uri: https://graph.facebook.com/v17.0/7100195296754519
user-agent: Facebook-for-WooCommerce/3.1.5 (WooCommerce/8.3.1; WordPress/6.4.2)
body:
duration: 0.17197s

12-10-2023 @ 05:07:45 - Response
code: 400
message: Bad Request
body: {"error":{"message":"Unsupported delete request. Object with ID '7100195296754519' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"AmhaRoiVw5VWIYIag0_74eJ"}}

12-10-2023 @ 05:07:45 - {"response_data":{"error":{"message":"Unsupported delete request. Object with ID '7100195296754519' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"AmhaRoiVw5VWIYIag0_74eJ"}}}
12-10-2023 @ 05:07:45 - Request
method: DELETE
uri: https://graph.facebook.com/v17.0/7100195246754524?deletion_method=delete_items
user-agent: Facebook-for-WooCommerce/3.1.5 (WooCommerce/8.3.1; WordPress/6.4.2)
body:
duration: 0.24293s

This is an integration that was working for over a year, and broke maybe in May or April of this year. Deleting and recreating my catalog again is not an option, as it takes several months for Facebook to re-approve the site, and the Instagram and Facebook side of things are working perfectly, with many tagged products in my posts and Checkout enabled within Instagram. I lost months of sales trying to fix this issue myself when I started the Catalog again from scratch trying to fix the sync issue.

Right now, the plugin can only be used to create products on the catalog, but not update or delete products, even those that were created by the plugin. This was working properly earlier in 2023 without any changes to my products.

One other thing that I noticed is that the WooCommerce for Facebook plugin is listed as a System user for the Pixel, which is working fine, but not for the Catalog (see screenshot). However, it doesn't make sense that the Facebook for WooCommerce app would be allowed to create products but not update or delete them.

Screenshot 2023-12-09 211503
Screenshot 2023-12-09 211638
Screenshot 2023-12-09 211704

I understand that you're not able to recreate this issue with a brand new account, but that doesn't help me, because I can't create my entire catalog and website from scratch again. This was working properly before some sort of update happened, and broke most likely because Facebook published a newer version of GraphAPI, which requires more explicit permissions for apps.

I noticed another user reported the same issue at #2656, so I believe this issue is not isolated to my installation.

What else do you need me to provide in order to fix this problem? My system report has not changed from the one that I pasted earlier in this thread. I am willing to hop on a Zoom call so that you can look at my database and whatever else you need in order to debug the problem.

@oceanlivingfoods
Copy link
Author

It looks like this was resolved on the Facebook side by allowing legacy updates to the Graph API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs feedback The issue/PR needs a response from any of the parties involved in the issue.
Projects
None yet
Development

No branches or pull requests

2 participants