facebook-for-woocommerce icon indicating copy to clipboard operation
facebook-for-woocommerce copied to clipboard

Problems product sync on facebook catalog.

Open carobob opened this issue 4 years ago • 10 comments

🔎 Isolate the bug

  • [X] I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Facebook for WooCommerce.
  • [X] 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

When i create a product directly on my website (it almost never appears on my facebook catalog. Some do, some don't, with the exact same settings) i get this message : "Facebook for WooCommerce error: Unsupported post request. Object with ID '466759344249769' 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" When i create a product on my facebook catalog, it NEVER appears in my website catalog. I tried to contact the Woo Commerce support, but apart from asking me for the debug log, they didn't find anything.

##🚶‍♀️ Steps to reproduce

  1. Create a product on either one of the platform : facebook shop or woocommerce interface.
  2. The next step…

✔️ Expected behavior

Ideally, i want to create products on ONE place only (facebook catalog/website with woocommerce) without any copy, and see it syncronized on the other (facebook catalog/website with woocommerce)

🗃 Logs

10-23-2020 @ 12:39:40 - There was an error trying sync products using the Catalog Batch API for job f90446f396859e8fa4831ce0cf6eb781: GraphMethodException: Unsupported post request. Object with ID '466759344249769' 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 10-23-2020 @ 12:50:06 - There was an error trying sync products using the Catalog Batch API for job b9cb2f2cbbc385a309a26c51c18281ab: GraphMethodException: Unsupported post request. Object with ID '466759344249769' 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 10-23-2020 @ 12:50:27 - There was an error trying sync products using the Catalog Batch API for job f4743770f7e2583bd8a5044603080df0: GraphMethodException: Unsupported post request. Object with ID '466759344249769' 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 10-23-2020 @ 12:50:36 - There was an error trying sync products using the Catalog Batch API for job 166a0b1107600ba3053792bdc6aaebff: GraphMethodException: Unsupported post request. Object with ID '466759344249769' 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 10-23-2020 @ 12:53:23 - There was an error trying sync products using the Catalog Batch API for job 4c03fef483ffad4415583c1d80aee372: GraphMethodException: Unsupported post request. Object with ID '466759344249769' 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 10-23-2020 @ 13:20:00 - There was an error trying sync products using the Catalog Batch API for job 3e60edfac19bbbc752238c4586574fee: GraphMethodException: Unsupported post request. Object with ID '466759344249769' 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

carobob avatar Nov 10 '20 18:11 carobob

We have another instance of this issue in 4925901-zen where a merchant reported that not all of their products are syncing despite removing unsynced products, and adding them back again. We see the following in the product editor page:

Capture_2022-04-13 at 11 35 03@2x

According to the logs, products including a product that was not initially synced were submitted to Facebook. It looks like there may be an authentication issue that affects this process after the initial request. I see the following in the logs:

04-13-2022 @ 10:20:39 - Response
code: 200
message: OK
body: {"handles":["Aczq [REDACTED]"]}

04-13-2022 @ 10:25:37 - Request
uri: https://graph.facebook.com/v12.0/catalog:[REDACTED]:[REDACTED]==/?fields=id,product_group{id}
timeout: 500

04-13-2022 @ 10:25:37 - Response
code: 400
message: Bad Request
body: {"error":{"message":"Unsupported get request. Object with ID 'catalog:[REDACTED]:[REDACTED]==' 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":"[REDACTED]"}}

The site is currently running the following:

  • WooCommerce 6.3.1
  • WordPress 5.9.3
  • Facebook for WooCommerce 2.6.12

pauljacobson avatar Apr 13 '22 08:04 pauljacobson

Hey @pauljacobson, is this happening to all the products or only one?

I did some investigation with the the logs shared in 4925901-zd-woothemes, I see that it is only one request failing multiple times. The request is the following:

https://graph.facebook.com/v12.0/catalog:605944194160412:ODAyNTQ5NjAyMTU4NC8tL2JpYW5fMjk4Nw==/?fields=id,product_group{id}

Looking at the code, I see that there is a function making this request and it is trying to get the Facebook id (the product_id is encoded using base 64)

https://github.com/woocommerce/facebook-for-woocommerce/blob/9b12b0f833670950e8ef0970cd79049e9a3f8a95/includes/fbgraph.php#L601

When I looked at how it is formatted the variable $product_id, I can see that it is a combination between the SKU and the product id:

https://github.com/woocommerce/facebook-for-woocommerce/blob/267f12275f3cf2537276862508dd21bfe38c39cc/includes/fbutils.php#L98

So for the previous request:

https://graph.facebook.com/v12.0/catalog:605944194160412:ODAyNTQ5NjAyMTU4NC8tL2JpYW5fMjk4Nw==/?fields=id,product_group{id} the product ID decoded for ODAyNTQ5NjAyMTU4NC8tL2JpYW5fMjk4Nw== is 8025496021584/-/bian_2987, and splitted by parts are:

Product SKU: 8025496021584/-/bian Product ID: 2987

Checking the customer website that is a variable product for the product 2987.

So if this issue is happening with all the products it could relate to account permission, I would advise disconnecting the Facebook account and reconnecting and then trying the sync again.

If the problem is only affecting this variable, can we check if this product is created at all in FB marketplace? It could be that the FB plugin thinks that has been synced already and is trying to get a product that does not exist in the FB marketplace or that the customer has deleted manually in the FB marketplace creating this issue.

jorgemd24 avatar Apr 13 '22 11:04 jorgemd24

Hey @pauljacobson, is this happening to all the products or only one?

Hi @jorgemd24 This only seems to affect a couple products. I just focused on one product that was highlighted in the ticket notes.

If the problem is only affecting this variable, can we check if this product is created at all in FB marketplace? It could be that the FB plugin thinks that has been synced already and is trying to get a product that does not exist in the FB marketplace or that the customer has deleted manually in the FB marketplace creating this issue.

Ok, great, thank you for the suggestion. What is the best way to approach these scenarios?

pauljacobson avatar Apr 13 '22 13:04 pauljacobson

Hi @pauljacobson,

I could reproduce the same error following these steps:

  1. I go to the FB Marketplace.
  2. I delete the product with variations manually.
  3. I try to resync the product.
  4. If I check the logs, I see the same error mentioned before.

Simple products do not have that issue as FB does not allow them to be edited/deleted when they have been uploaded through WooCommerce but Variable products do not have that restriction.

I think the problem is because the product is deleted in FB and the FB plugin is still using the that ID to communicate with FB Marketplace and that's why the error says: Object with ID 'catalog:[REDACTED]:[REDACTED]== **does not exist, cannot be loaded**.....

So you could try to resync the product following these steps:

1 . Select the product and click "Exclude from FB sync":

image

  1. Go to the variable that is having the issue and update the SKU.

  2. Select the product and click "Include from FB sync":

image

After some time the product should be available in the FB Marketplace.

For the long term, we will look into adding the restriction to variable products so they can not be edited/deleted in FB Marketplace creating a conflict between FB and the plugin.

jorgemd24 avatar Apr 14 '22 11:04 jorgemd24

Hi @jorgemd24 We shared these steps with the user & they weren't sure about the 2nd step. Do they need to the change the SKU?

I've also tried to reset + delete the product from FB & resync but the problem is still there. I also got these:

  • None of the variations have IDs: https://d.pr/i/KCUfRC
  • In the sync log I get these for this particular product:
04-21-2022 @ 01:16:24 - Response
code: 400
message: Bad Request
body: {"error":{"message":"Unsupported get request. Object with ID 'catalog:605944194160412:ODAyNTQ5NjAxMDM1OS8tL3RvcnRfMjkzMA==' 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":"A4Abm6tBGTzi-MTFM49Sdoi"}}

04-21-2022 @ 01:16:24 - Request
uri: https://graph.facebook.com/v12.0/605944194160412/product_groups
body: Array
(
    [retailer_id] => 8025496010359_2929
    [variants] => Array
        (
            [0] => Array
                (
                    [product_field] => color
                    [label] => Colore
                    [options] => Array
                        (
                            [0] => tortora
                            [1] => avio
                            [2] => grigio
                        )

                )

        )

)
timeout: 500
method: POST
  • Also they get an additional variation created without any image: https://d.pr/i/bzzx8g

What do you suggest as the next step?

rashedripon avatar Apr 20 '22 23:04 rashedripon

Thanks @rashedripon,

"Unsupported get request. Object with ID 'catalog:605944194160412:ODAyNTQ5NjAxMDM1OS8tL3RvcnRfMjkzMA==' does not exist

I can reproduce that error when I delete the product manually in FB and then the plugin tries to sync, I am not sure what else could cause this error.

To try to narrow the issue, could you provide a bit more information about the following questions:

  • Are you getting this error when you create new products with variations?
  • Can you confirm that is only affecting variable products? or only specific products are affected?
  • Has the customer's other variables products shown correctly in FB? Or all variables products are affected?

Thanks!

jorgemd24 avatar Apr 25 '22 14:04 jorgemd24

I've forwarded two of the questions to the customer. I can answer the second question: as far as I've investigated the problem is only with variable products.

rashedripon avatar Apr 25 '22 22:04 rashedripon

Hi @jorgemd24

Are you getting this error when creating new products with variations?

This is not clear. We have a screenshot from the merchant showing a test product with variations in Facebook, but the Facebook data panel on the edit product side shows incomplete data, and clicking through to the parent link on Facebook does not indicated the existence of variations. This may indicate an update occurred between the time the screenshot was taken, and our investigation of the product.

Can you confirm this is only affecting variable products

This appears to be the case.

Has the customer's other variables products shown correctly in FB? Or all variables products are affected?

Out of 169 variable products, three are showing data in the synch product panel on the product edit screen correctly. Everything else shows only a link for the parent product.

From the logs: To expand on the log data in the comment above.

In response to the POST request to create the product group there is an error response. The full log is as follows:

05-02-2022 @ 01:48:11 - Response
code: 400
message: Bad Request
body: {"error":{"message":"Unsupported get request. Object with ID 'catalog:[redacted]:MjM2NV8zMDA0' 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":"[redacted]"}}

05-02-2022 @ 01:48:12 - Request
uri: https://graph.facebook.com/v12.0/[redacted]/product_groups
body: Array
(
    [retailer_id] => wc_post_id_3003
    [variants] => Array
        (
            [0] => Array
                (
                    [product_field] => color
                    [label] => Colore
                    [options] => Array
                        (
                            [0] => acciaio
                            [2] => argilla
                        )

                )

            [1] => Array
                (
                    [product_field] => custom_data:taglia
                    [label] => Taglia
                    [options] => Array
                        (
                            [0] => 12-14
                            [1] => 4-6
                        )

                )

        )

)
timeout: 500
method: POST

05-02-2022 @ 01:48:12 - Response
code: 400
message: Bad Request
body: {"error":{"message":"(#10800) Duplicate retailer_id when attempting to create a product group.","type":"OAuthException","code":10800,"error_data":{"product_group_id":5334813643230657},"fbtrace_id":"An60MdmLY9_XtcTe3RJOoEl"}}

This error can be corrected by following the steps:

  1. Stop synch
  2. Update SKU
    1. Resynch

Which results in the same POST request getting the response

05-02-2022 @ 01:54:37 - Response
code: 200
message: OK
body: {"id":"[redacted]"}

The subequent request to https://graph.facebook.com/v12.0/[redacted]/items_batch for "item_group_id":"updatedtest_[redacted_post_id]" appears to be successful - but does not result in any additional information arriving on the site, or in a variation being published on Facebook.

05-02-2022 @ 01:54:40 - Response
code: 200
message: OK
body: {"handles":["redacted"]}

nicdwilson avatar May 02 '22 00:05 nicdwilson

Thanks, @nicdwilson for the logs, they are really useful.

I have tried to replicate the problem but unfortunately, I haven't been able to do it. I see my variation products sync to FB.

Looking into the logs I see this error:

body: {"error":{"message":"(#10800) Duplicate retailer_id when attempting to create a product group.","type":"OAuthException","code":10800,"error_data":{"product_group_id":5334813643230657},"fbtrace_id":"An60MdmLY9_XtcTe3RJOoEl"}}

There is a similar issue that was reported before with the same error: https://github.com/woocommerce/facebook-for-woocommerce/issues/2050 in that case the issue was related to the attributes.

Out of 169 variable products, three are showing data in the synch product panel on the product edit screen correctly.

Could we compare the attributes and options of those 3 products that are synced with one that is not syncing? I am wondering if there is something different in those 3 products that are making them sync to FB.

Another question is: are those 3 products synced recently? or they were synced a long time ago?.

Can you have a look in Tools->Scheduled Actions->search for wc_facebook_regenerate_feed , and check if the job is pending to be run or if it was run recently?

image

jorgemd24 avatar May 06 '22 10:05 jorgemd24

Hi @jorgemd24 I've confirmed the presence of the scheduled action. The product variation SKUs contained backslashes, probably introduced by a spreadsheet. This is the only noticeable difference between successful and unsuccessful syncs. We have asked the customer to remove them. On sync, this resulted in the output "id":"8052873140170\\-\\ross_2893"

nicdwilson avatar May 09 '22 21:05 nicdwilson

It looks like this was fixed by removing backslashes. Other similar issues will be prevented by the metabox update in 2.6.6

budzanowski avatar Sep 07 '22 12:09 budzanowski