alexander-pick / MKMTool

MKMTool ist a helper application I wrote for tinkering around with optimization of sale processes on magiccardmarket.eu and the idea of automisation of some tasks most people wouldn’t be able to get done by pure manpower.
GNU Affero General Public License v3.0
65 stars 15 forks source link

Crash after 14'000 prices update #17

Closed qalastar closed 4 years ago

qalastar commented 4 years ago

Hello,

First at all, thank you very much for this tool. It is really usefull for me.

Today, I try to update all prices of my inventory and after like 14'000 call to the MKM API, this bug appears :

Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à MKMTool.MKMMetaCard..ctor(XmlNode MKMArticle)
   à MKMTool.MKMBot.updatePrices()
   à MKMTool.MainView.<updatePriceButton_Click>b__22_0()
   à System.Threading.Tasks.Task.Execute()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   à MKMTool.MainView.<updatePriceButton_Click>d__22.MoveNext()
--- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
   à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

************** Assemblys chargés **************
mscorlib
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase : file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
MKMTool
    Version de l'assembly : 1.0.0.0
    Version Win32 : 0.7.0.1
    CodeBase : file:///C:/Users/Maxime/Downloads/MKMTool0.7.0.1/MKMTool.exe
----------------------------------------
System.Windows.Forms
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3416.0 built by: NET472REL1LAST_B
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3056.0 built by: NET472REL1
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3056.0 built by: NET472REL1
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3429.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3056.0 built by: NET472REL1
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Windows.Forms.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3056.0 built by: NET472REL1
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
mscorlib.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3056.0 built by: NET472REL1
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Data
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.7.3260.0 built by: NET472REL1LAST_C
    CodeBase : file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.

Par exemple :

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.

Do you have any clues of what's happening ? Do you need more inputs ?

tomasjanak commented 4 years ago

Hi, it seems like there is some card in your stock for which MKM is returning something we don't expect in the MKMtool. You are using the downloaded version, right? Please download this one: https://tomasjanak.github.io/MKMTool0.7.0.1_test.zip and try it again (if I'm wrong and you are compiling it from source yourself, let me know, I will post the source code changes). When it encounters the error, it should pop up an error window that will include an XML document with the card description. It will also write it in the error_log.txt file (in the same folder as the executable), so you can easily copy-paste it here so we can take a look at it. BTW, if you press "OK" once the error shows up, it will continue the price update, but if there is something very wrong with that particular card it might get priced very incorrectly.

qalastar commented 4 years ago

Hello,

Thanks for you answer. I did what you suggested. Here is the log :

20.08.2019 00:17:20, version: 0.7.0.1
Error with constructing MKMMeta card: <idArticle>464737532</idArticle><idProduct>370639</idProduct><language><idLanguage>2</idLanguage><languageName>French</languageName></language><comments></comments><price>0.08</price><count>1</count><inShoppingCart>false</inShoppingCart><product><idGame>9</idGame><enName>Sabin (8-019)</enName><locName>Sabin (8-019)</locName><image>/srv/home/www/img/items/1022/8/370639.jpg</image><expansion>Opus VIII</expansion><nr>019</nr><expIcon>499</expIcon><rarity>Common</rarity></product><lastEdited>2019-08-02T10:56:17+0200</lastEdited><condition>NM</condition><isFoil>false</isFoil><isSigned>false</isSigned><isAltered>false</isAltered>

I didn't continue the price update by clicking on the "OK" button to avoid any bad value.

tomasjanak commented 4 years ago

I see, it's having a problem with non-mtg card, right now we can process only M:tG. I'm going to bed now, I'll fix it tomorrow so that non-mtg cards are skipped.

tomasjanak commented 4 years ago

So I made the update...since up to now MKMTool's update price was actually processing other games as well, I've kept it that way, I guess nobody just noticed it or wasn't bothered by it. The problem with this particular game (Final Fantasy) was that the isPlayset flag is not present for those cards and we were automatically assuming that it exists. Now we properly check whether it exists or not, if not, it is ignored (the same goes for isFoil, isAltered, isSigned). So your Final Fantasy cards should now be price-updated as well, though I have not tested it, let me know if it causes some more problems. Download link is in the readme (https://tomasjanak.github.io/MKMTool0.7.0.2.zip).

qalastar commented 4 years ago

Hello,

Sorry for my late reply.

Thanks, it works well now.

Do you think that it is possible to add a minimum price for common and uncommon cards as well as the rare/mythic ? Sell cards at 2ct is too low for me and I think that it's a useful functionality for everybody :)

Thanks a lot.

Regards

tomasjanak commented 4 years ago

You can actually do that with the myStock.csv mechanism (description in https://github.com/alexander-pick/MKMTool#Price-Update , scroll down below the list of settings options). To get MinPrice for commons and uncommons, you just need a "Rarity" column filled in the myStock.csv and nothing else. So if you're not setting minimal prices for anything else, the file can look like this

Rarity,MinPrice Common,0.05 Uncommon,0.10

So just two columns, Rarity and MinPrice. Since nothing else is specified, all Commons will match the first line, setting min price to 5 cents and all uncommons will match the second line, setting minimal price to 10 cents. Note that it has to be comma separated and cents have to be separated by a full stop, not comma, no matter what you usually use as a decimal separator. Also, MKM has all kinds of additional rarities like Land, Token etc;, look at documentation for the Rarity here https://github.com/alexander-pick/MKMTool#CSV-Card-Lists-in-MKMTool - if you set just commons and uncommons, some things might slip through.