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

Malformed UTF-8 characters, possibly incorrectly encoded #2316

Closed
ispasvalentin22 opened this issue Feb 8, 2022 · 5 comments
Closed

Malformed UTF-8 characters, possibly incorrectly encoded #2316

ispasvalentin22 opened this issue Feb 8, 2022 · 5 comments
Labels

Comments

@ispasvalentin22
Copy link

ispasvalentin22 commented Feb 8, 2022

PHP Version

7.4.26

Shopware Version

6.4.7

Expected behaviour

Using the Admin API, trying to update product variants should work

Actual behaviour

Using the Admin API, trying to update product variants doesn't work and throws this error: "Malformed UTF-8 characters, possibly incorrectly encoded" which I saw it's happening when you send some non existing ids to shopware. The ids that I send to shopware are valid, I checked them.

How to reproduce

Use the endpoint /api/_action/sync to create some product variants, and then try to use it to update them and the error will happen.

Using v6.4.0 works fine.

@shyim
Copy link
Member

shyim commented Feb 9, 2022

This is related too #2289

Apply the patch from there to have the exception behind that.

@shyim shyim closed this as completed Feb 9, 2022
@ispasvalentin22
Copy link
Author

ispasvalentin22 commented Feb 9, 2022

This is related too #2289

Apply the patch from there to have the exception behind that.

@shyim
Thanks for reply. So what will be the new behaviour after that patch? I am sending some wrong ids and after this, the error will be more helpful and tell me what's wrong?

@shyim
Copy link
Member

shyim commented Feb 9, 2022

You should see the SQL error which is happening with your API request

@ispasvalentin22
Copy link
Author

@shyim
Can you think of a reason why I encounter this only only on v6.4.7? While doing the same thing on v6.4.0 it works fine.
I applied the patch as you said and now I can see this in the logs but I don't understand what is wrong:

An exception occurred while executing 'INSERT INTO product_configurator_setting (id, version_id, product_id, product_version_id, property_group_option_id, created_at) VALUES ('RQ\u0013�THp�p�Y�\u0016�@','\u000f�\u001c��jK¾K��u,4%','B���(�C\\r���ؔd�M','\u000f�\u001c��jK¾K��u,4%','\fi�Cp�OA��r.s�Ȗ','2022-02-09 21:25:36.633');':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'B\\xB0\\x82\\xE9(\\xCEC\\x0D\\x91\\xAA\\xAD\\xD8\\x94d\\xAFM-\\x0F\\xA9\\x1C\\x' for key 'product_configurator_setting.uniq.product_configurator_setting.prod_id.vers_id.prop_group_id'","status":"500","title":"Internal Server Error"}]}]}},"deleted":[],"extensions":[],"notFound":[],"success":false},400],"class":"Symfony\\Component\\HttpFoundation\\JsonResponse","file":"/app/platform/src/Core/Framework/Api/Controller/SyncController.php","function":"__construct","line":174,"type":"->"},{"args":[{"data":{"anotherExternalProductId":{"extensions":[],"result":[{"entities":[],"errors":[]}]},"excludeFromResponse":{"extensions":[],"result":[{"entities":[],"errors":[{"code":"0","detail":"An exception occurred while executing 'INSERT INTO product_configurator_setting (id, version_id, product_id, product_version_id, property_group_option_id, created_at) VALUES ('RQ\u0013�THp�p�Y�\u0016�@','\u000f�\u001c��jK¾K��u,4%','B���(�C\r���ؔd�M','\u000f�\u001c��jK¾K��u,4%','\fi�Cp�OA��r.s�Ȗ','2022-02-09 21:25:36.633');':\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'B\xB0\x82\xE9(\xCEC\x0D\x91\xAA\xAD\xD8\x94d\xAFM-\x0F\xA9\x1C\x' for key 'product_configurator_setting.uniq.product_configurator_setting.prod_id.vers_id.prop_group_id'","status":"500","title":"Internal Server Error"}]}]}}

@shyim
Copy link
Member

shyim commented Feb 9, 2022

We added a unique key there to forbid duplicate keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants