Closed pepev12 closed 3 years ago
Im also having this error: Error with sending stock update to MKM: Anulada la solicitud: La solicitud fue cancelada. But it doesnt always happens, sometimes the tool update the batch just fine, So i understand this is something in mkm side, timeouts or other problems, maybe a setting for trying again when update fails may be usefull? regards,
an update about this, i finally figure out what was happening, the error was because some invalid characters in the comment section of the card,,, when the tool tried to update prices, mkm read the comment with an invalid character (although it was already there) and cancel the call, i made a cleanup of invalid characters and now its working perfectly, regards,
do you remember what were the invalid characters so that I could add some checks for that to avoid crashes?
mmm im not sure, weird unicode codes, i have an inventory export before changing them and in the csv they look like this: â ¢ But that's not what they looked like in mkm; At least one of them was like a black circle in the middle of the character space, but i have no idea how to type it,
I can recreate the problem using these characters inside comments, but I don't know how to fix it, somebody with more knowledge on .NET and it's XML libraries is needed.
That seems to be due to the unicode encoding of the char which takes 2 bytes instead of one and might be a bug in the library which creates the request or a wrong length param calculated.
Take a look at this line (83) in MKMInteract.cs:
request.ContentLength = body.Length;
This counts chars, not bytes. I think changing this to something like the line blow might fix it:
request.ContentLength = Encoding.Unicode.GetByteCount(body);
I haven't tested it, but this is the classic issue in this case.
Thanks, Encoding.UTF8.GetByteCount(body); works.
(I'll push the code in later with other changes & fixes, hopefully by end of the week)
Fixed in commit https://github.com/alexander-pick/MKMTool/commit/e024575c9efe25942e8530212d2d634fbc1e274d (available in version 0.8.0.0 or newer)
Hi all and thanks for your amazing work with this tool,
I'm having a problem updating prices, the prices are calculated ok, but every 100 lines i see this in the log:
Error with sending stock update to MKM: Los bytes que se van a escribir en la secuencia sobrepasan el tamaño de bytes especificado en el valor Content-Length.
which is spanish for: Bytes to be written to the stream exceed the Content-Length bytes size specified
I have updated prices before without issue, why is this? something about mkm not allowing me using the api? im in my daily limit,
thanks!