Duplication of WooCommerce products after sending json data from .net app.
-
Hello guys,
I have made an update to the latest Cloudron yesterday but after we send json data that update WooCommerce products, from our .net app it duplicates the 1st badge (100 products) , instead of updating it and then the program gives error 500 (pasted below). Also, I am attaching the data we send for 5 products.
The error:
Грешка
Failed to send data to web site, Exception error: The remote server returned an error: (500) Internal Server Error.
OK
The data we send:
[{"CategoryGUID":"0c935c29-369c-44b2-95e1-9ac02ed27203","ManufacturerGUID":"00000000-0000-0000-0000-000000000000","ReferenceGUID":"c7670f17-1db6-41c0-9262-760d953124e6","Name":"BLUETOOTH СЛУШАЛКА БЯЛА 70mah /7701/","Description":"BLUETOOTH СЛУШАЛКА БЯЛА 70mah /7701/","Price":9.8,"Quantity":83,"Promotion":1,"PromotionPrice":7.990000,"PromotionStartDate":"2021-03-22","PromotionEndDate":"2021-03-29","QuantityType":1,"TradeMarkGUID":"00000000-0000-0000-0000-000000000000","TradeMarkName":""},{"CategoryGUID":"0c935c29-369c-44b2-95e1-9ac02ed27203","ManufacturerGUID":"00000000-0000-0000-0000-000000000000","ReferenceGUID":"7269967a-a019-42df-862c-1e0f2e27fc53","Name":"BLUETOOTH СЛУШАЛКА ЧЕРНА /7702/","Description":"BLUETOOTH СЛУШАЛКА ЧЕРНА /7702/","Price":18.25,"Quantity":29,"Promotion":0,"PromotionPrice":0.0,"PromotionStartDate":"1853-01-01","PromotionEndDate":"1853-01-01","QuantityType":1,"TradeMarkGUID":"00000000-0000-0000-0000-000000000000","TradeMarkName":""},{"CategoryGUID":"0c935c29-369c-44b2-95e1-9ac02ed27203","ManufacturerGUID":"00000000-0000-0000-0000-000000000000","ReferenceGUID":"295e782b-16a4-4772-bbb6-c6d0bc2f7f88","Name":"BLUETOOTH СЛУШАЛКА ЧЕРНА 70mah /7700/","Description":"BLUETOOTH СЛУШАЛКА ЧЕРНА 70mah /7700/","Price":9.8,"Quantity":53,"Promotion":1,"PromotionPrice":7.990000,"PromotionStartDate":"2021-03-22","PromotionEndDate":"2021-03-29","QuantityType":1,"TradeMarkGUID":"00000000-0000-0000-0000-000000000000","TradeMarkName":""},{"CategoryGUID":"bb589e70-a7a0-48ba-9d80-d0d2e5f1953b","ManufacturerGUID":"00000000-0000-0000-0000-000000000000","ReferenceGUID":"e3ccc6e8-d355-418d-be35-97143c1245bb","Name":"CORNETTO 110МЛ САНДВИЧ /NA/","Description":"CORNETTO 110МЛ САНДВИЧ /33/","Price":2.2,"Quantity":9,"Promotion":1,"PromotionPrice":1.100000,"PromotionStartDate":"2014-04-04","PromotionEndDate":"2014-05-02","QuantityType":1,"TradeMarkGUID":"00000000-0000-0000-0000-000000000000","TradeMarkName":""},{"CategoryGUID":"bb589e70-a7a0-48ba-9d80-d0d2e5f1953b","ManufacturerGUID":"00000000-0000-0000-0000-000000000000","ReferenceGUID":"ef73119c-ca8d-4337-9476-bd8d4c0b31e7","Name":"CORNETTO 120МЛ ВАНИЛИЯ /24/","Description":"CORNETTO 120МЛ ВАНИЛИЯ /24/","Price":2.0,"Quantity":82,"Promotion":0,"PromotionPrice":0.0,"PromotionStartDate":"1853-01-01","PromotionEndDate":"1853-01-01","QuantityType":1,"TradeMarkGUID":"00000000-0000-0000-0000-000000000000","TradeMarkName":""}]
In my opinion, the unique keys aren't working properly but I am not sure how the update to the latest Cloudron version caused this. I also noted the duplicated product categories aren't mapped at all and these products end in uncategorized (the general category).
-
@nebulon
Also, forgot to mention the update was from 6.1.2. to 6.2.4.{
"errorMessage": "",
"oldVersion": "6.1.2",
"newVersion": "6.2.4"
}This shows as my changelog:
{
"taskId": "2294",
"boxUpdateInfo": {
"version": "6.2.4",
"changelog": [
"ovh: object storage URL has changed from s3 to storage subdomain",
"ionos: add profit bricks object storage",
"update node to 14.15.4",
"update docker to 20.10.3",
"new base image 3.0.0",
"postgresql updated to 12.5",
"redis updated to 5.0.7",
"dovecot updated to 2.3.7",
"proxyAuth: fix docker UA detection",
"registry config: add UI to disable it",
"update solr to 8.8.1",
"firewall: fix issue where script errored when having more than 15 wl/bl ports",
"If groups are used, do not allow app installation without choosing the access settings",
"tls addon",
"Do not overwrite existing DMARC record",
"Sync dns records",
"Dry run restore",
"linode: show cloudron is installing when user SSHs",
"mysql: disable bin logs",
"Show cancel task button if task is still running after 2 minutes",
"filemanager: fix various bugs involving file names with spaces",
"Change Referrer-policy default to 'same-origin'",
"rsync: preserve and restore symlinks",
"Clean up backups function now removes missing backups",
"Avoid updown notifications on full restore",
"Add retries to downloader logic in installer",
"Fix ENOBUFS issue with backups when collecting fs metadata",
"Fix addon crashes with missing databases",
"Update mail container for LMTP cert fix",
"Fix services view showing yellow icon"
],
"sourceTarballUrl": "https://prod-cloudron-releases.s3.amazonaws.com/box-3ee3786936-4dffce0b71-6.2.4.tar.gz",
"sourceTarballSigUrl": "https://prod-cloudron-releases.s3.amazonaws.com/box-3ee3786936-4dffce0b71-6.2.4.tar.gz.sig",
"boxVersionsUrl": "https://s3.amazonaws.com/prod-cloudron-releases/versions.json",
"boxVersionsSigUrl": "https://s3.amazonaws.com/prod-cloudron-releases/versions.json.sig",
"unstable": false
}
} -
@vladimir said in Duplication of WooCommerce products after sending json data from .net app.:
@vladimir
Also, is it possible to see somewhere the older changelogs?You can see the changelogs for Cloudron at https://git.cloudron.io/cloudron/box/-/blob/master/CHANGES
-
@vladimir I’m not sure I see how Cloudron server could be responsible for this issue, but it’s definitely an interesting one. Are you sure Woocommerce didn’t auto-update on you perhaps? There was a WordPress 5.7 update and Woocommerce update similarity timed too, all within the last week. I’m wondering if one of those could perhaps be the issue.
When you get the 500 error from the client sending the data, where is the error seen in the logs on the server side? Do you see it in the Wordpress app logs? Or do you actually see it in the Cloudron server logs? Presumably if the client reports a 500, there should be something on the server side to match the timing of the error that could perhaps shed a bit more light on it.
Just some initial thoughts anyways.
-
@vladimir said in Duplication of WooCommerce products after sending json data from .net app.:
In my opinion, the unique keys aren't working properly but I am not sure how the update to the latest Cloudron version caused this
The only change I can think of is that the database was upgraded from MySQL 5.7 to MySQL 8. Could this cause some issues in your schema? Also, what is the 500 error in your application. It should be possible to figure out what is going wrong from that.
-
@girish
Hello,
After several hours of monitoring the problem was indeed in the 5.7 to 8 update of the database.Seems like the UUID is different. And there was no backwards compatibility with the UUID. And returns a different value, with a different value not being recognized in the particular product. So it creates a new product instead of updating it. Made a simple script and fixed the problem.
Wonder when you push php 8 if I will experience similar things
The fault is totally mine as I didn't have a staging site for this update.
-
@vladimir Usually for LAMP app, we tend to create separate apps. i.e LAMP 7.3, 7.4 and in the future 8, are totally separate apps. So, your app won't update automatically.
For addons which are shared across apps, we don't have a way to do this. I guess one idea is to have the app "pin" itself to a specific mysql version and that way we will have multiple mysql databases with different versions running in parallel. Doable but quite complicated! I think @luckow also reported that MySQL 8 broke his drupal app.
Good news is that I don't expect such a big upgrade any time soon.