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 139 forks source link

Todays update generates lots of errors : Invalid Date Range for sale_price_start_date #53

Closed metuza closed 7 years ago

metuza commented 7 years ago

When i use the Force Product Resync from within plugin settings my debug log get filled with the below errors for each product (no issues with older version):

[25-Sep-2017 18:16:09 UTC] Facebook for WooCommerce
Invalid parameter

[25-Sep-2017 18:16:09 UTC] {"headers":{},"body":"{\"error\":{\"message\":\"Invalid parameter\",\"type\":\"FacebookApiException\",\"code\":100,\"error_subcode\":1803009,\"is_transient\":false,\"error_user_title\":\"Invalid Date Range\",\"error_user_msg\":\"The date range specified in property sale_price_start_date is invalid.\",\"fbtrace_id\":\"Ah+8YdOtRjM\"}}","response":{"code":500,"message":"Internal Server Error"},"cookies":[],"filename":null,"http_response":{"data":null,"headers":null,"status":null}}

Actually prices does not update correctly - I now have different prices in catalog, FB-shop and my webshop.

I tried to update a product from product editor but then i get also error: Facebook extension error: Facebook for WooCommerce Invalid parameter

Brgds Rune

dmitridr commented 7 years ago

Thanks for writing in, it could be a temporary issue with our APIs @mengyingdu is looking into it.

silksow commented 7 years ago

Confirmed here upon updating to 1.6.1 and updating a product with no changes. invalid parameter

mengyingdu commented 7 years ago

Thanks for your update, I'm currently working on a fix for it.

mengyingdu commented 7 years ago

Hi @silksow ,

I checked the product group id ( in your image) 1767398573300568 and its associated product item in your website and catalog https://publicbraintrust.com/product/calexit-dreaming-ss-fine-jersey-crew-4-3-oz-t-shirt/?attribute_color=White&attribute_size=2XL www.facebook.com/products/catalogs/842543035914835/products The price looks correct to me. 2XL 26.5 and other size 24.5

Is that you expected price? If you still have this issue, can you give us more details?

Thanks!

dmitridr commented 7 years ago

Looks like this is a problem with sales introduced in 1.6.0. We're working on a fix ASAP.

In the meantime a workaround is to set a sale price start or end date in the past for products that show this error.

silksow commented 7 years ago

I'm sorry about the confusion - Pricing seems fine for me (thank you for #11 fix btw!) but I don't know what the invalid parameter error is, specifically, only that it is new for me on upgrading to 1.6.1.

dmitridr commented 7 years ago

@silksow Could you post a screenshot of the configuration of a product for which you encounter this issue? We see this issue occurring for some others but we can't reproduce it ourselves.

silksow commented 7 years ago

Can you be more specific about what configs you want to see?

dmitridr commented 7 years ago

The sale price configuration, and anything related to the price.

silksow commented 7 years ago

I'm afraid I can't reproduce it in the products I've tested - it appears to be a cascade of errors on updating a product (although only the one "invalid paramenter" notice appears the one time) after upgrading to 1.6.1 from 1.5.1 and I'd really rather not spread the damage to the rest of my catalog. Don't you guys dump to a log? WooCom Status>Logs contains no new entries.

dmitridr commented 7 years ago

There should be an entry in the webserver logs if there was a problem. If you remember anything special about how you updated the product with what kind of data that led to your screenshot perhaps we could figure it out that way.

silksow commented 7 years ago

I do see a repeated WP mysql error from the last hour - not when I experienced the error notice

mengyingdu commented 7 years ago

We find there's potential issue with php date function and release v1.6.2 to fix it. Can you try and see whether your error logging happen again?

mengyingdu commented 7 years ago

v1.6.2

metuza commented 7 years ago

Yes seems to work ok now. I got only this new warning in my log about 20 times when i did a force product update: [03-Oct-2017 14:22:20 UTC] PHP Notice: Trying to get property of non-object in /xxx/www/xxx/wp-content/plugins/facebook-for-woocommerce/includes/fbproduct.php on line 230

Thanks..

dmitridr commented 7 years ago

Nice. Thanks for confirming @metuza, we'll fix the warning.

dmitridr commented 7 years ago

We fixed the warning in 1.6.3. Please re-open if you still have it after upgrading.