Citrinate / FreePackages

An ASF plugin for finding and redeeming free Steam games
Apache License 2.0
87 stars 2 forks source link

System.InvalidOperationException: UserData #3

Closed woctezuma closed 9 months ago

woctezuma commented 9 months ago
2023-10-01 11:41:07|dotnet-4340|ERROR|ASF|OnPICSChanges() System.InvalidOperationException: UserData
   at FreePackages.PackageFilter.IsRedeemableApp(PICSProductInfo app)
   at FreePackages.PackageHandler.HandleFreeApp(PICSProductInfo app)
   at FreePackages.PackageHandler.<>c__DisplayClass11_0.<HandleAppUpdates>b__3(PackageHandler x)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at FreePackages.PackageHandler.HandleAppUpdates(IReadOnlyDictionary`2 appChanges)
   at FreePackages.PackageHandler.OnPICSChanges(UInt32 currentChangeNumber, IReadOnlyDictionary`2 appChanges, IReadOnlyDictionary`2 packageChanges)
   at FreePackages.FreePackages.OnPICSChanges(UInt32 currentChangeNumber, IReadOnlyDictionary`2 appChanges, IReadOnlyDictionary`2 packageChanges)
   at ArchiSteamFarm.Core.Utilities.InParallel(IEnumerable`1 tasks)
   at ArchiSteamFarm.Plugins.PluginsCore.OnPICSChanges(UInt32 currentChangeNumber, IReadOnlyDictionary`2 appChanges, IReadOnlyDictionary`2 packageChanges)

FreePackages.cache:

{
    "LastChangeNumber": 20500304
}

Bot_FreePackages.db:

{
    "Activations": [
        "2023-10-01T00:52:53.8388963+02:00",
        "2023-10-01T00:52:47.1088732+02:00"
    ],
    "Packages": []
}
Citrinate commented 9 months ago

Does this happen every time you run ASF, and are there any errors before that? There should at least be some errors to the effect of "UserData is null", but there might be other serialization errors, or maybe "request failed" errors.

It's possible this error is normal. This is the error you'd get if the plugin failed to load data from https://store.steampowered.com/dynamicstore/userdata/ and the error should resolve itself eventually if the request failed.

The error might just be due to a Steam service outage, but regardless it's still an issue. The plugin currently doesn't do anything with the PICS changes it saw when it throws that error. It should really be saving them and going back to them later.

woctezuma commented 9 months ago

Does this happen every time you run ASF?

No.

are there any errors before that?

I did not see any other issue before I posted, but I might have missed one. I will run ASF again later and tell you more about it.

From what I can tell so far:

woctezuma commented 9 months ago

Earlier, I ran ASF with no issue, and free packages were found and added to my account.

Now, I start ASF, and I encounter the error message again, very early.

2023-10-01 22:48:45|dotnet-2952|INFO|Bot|Init() Connexion à ISteamUserAuth...
2023-10-01 22:48:45|dotnet-2952|INFO|Bot|Init() Succès !
2023-10-01 22:48:46|dotnet-2952|INFO|Bot|IsAnythingToFarm() Vérification de la première page des badges...
2023-10-01 22:48:47|dotnet-2952|INFO|Bot|UpdateBoosterInfos() BoosterInfos updated
2023-10-01 22:48:47|dotnet-2952|INFO|Bot|Run() Next booster will be crafted at 11:39:07
2023-10-01 22:48:48|dotnet-2952|INFO|Bot|IsAnythingToFarm() Vérification des autres pages de badges...
2023-10-01 22:48:50|dotnet-2952|INFO|Bot|Farm() Nous avons un total de 20 jeux (66 cartes) restants à traiter (~1 jour, 9 heures restants)...
2023-10-01 22:48:50|dotnet-2952|INFO|Bot|Farm() Algorithme de collecte choisi : Simple
2023-10-01 22:48:50|dotnet-2952|INFO|Bot|FarmSolo() Collecte en cours : 1231880 (Haiku, the Robot)
2023-10-01 22:48:52|dotnet-2952|INFO|Bot|ShouldFarm() Progression de la collecte pour 1231880 (Haiku, the Robot) : 2 cartes restantes
2023-10-01 22:48:52|dotnet-2952|INFO|Bot|FarmCards() Collecte toujours en cours : 1231880 (Haiku, the Robot)
2023-10-01 22:48:55|dotnet-2952|INFO|Bot|OnPersonaState() Announcing XXXXXXXXXXXXXXXXX (Wok) with inventory made out of XXX items in total on the listing...
2023-10-01 22:48:55|dotnet-2952|INFO|Bot|OnPersonaState() Succès !
2023-10-01 22:50:47|dotnet-2952|ERROR|ASF|OnPICSChanges() System.InvalidOperationException: UserData
   at FreePackages.PackageFilter.IsRedeemableApp(PICSProductInfo app)
   at FreePackages.PackageHandler.HandleFreeApp(PICSProductInfo app)
   at FreePackages.PackageHandler.<>c__DisplayClass11_0.<HandleAppUpdates>b__3(PackageHandler x)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at FreePackages.PackageHandler.HandleAppUpdates(IReadOnlyDictionary`2 appChanges)
   at FreePackages.PackageHandler.OnPICSChanges(UInt32 currentChangeNumber, IReadOnlyDictionary`2 appChanges, IReadOnlyDictionary`2 packageChanges)
   at FreePackages.FreePackages.OnPICSChanges(UInt32 currentChangeNumber, IReadOnlyDictionary`2 appChanges, IReadOnlyDictionary`2 packageChanges)
   at ArchiSteamFarm.Core.Utilities.InParallel(IEnumerable`1 tasks)
   at ArchiSteamFarm.Plugins.PluginsCore.OnPICSChanges(UInt32 currentChangeNumber, IReadOnlyDictionary`2 appChanges, IReadOnlyDictionary`2 packageChanges)

There was no other significant error (missing --cryptkey for AES) or significant warning (WarnAboutIncompleteTranslation(), ASFEnhance.EULA not agreed to, InitStart() for other bots which are not meant to automatically start at the launch of ASF).

Citrinate commented 9 months ago

I'm assuming that at least some of the other bots which don't automatically start do have the Free Packages plugin enabled? If so, then I'm able to reproduce this error.

I'll have a quick fix for this soon just to prevent the error. I still think this scenario needs to be handled better, but that will come later.

Citrinate commented 9 months ago

Quick fix is released in V1.0.1

woctezuma commented 9 months ago

I'm assuming that at least some of the other bots which don't automatically start do have the Free Packages plugin enabled? If so, then I'm able to reproduce this error.

Yes.

I will try your fix and close the issue meanwhile.

woctezuma commented 9 months ago

I'm assuming that at least some of the other bots which don't automatically start do have the Free Packages plugin enabled? If so, then I'm able to reproduce this error.

Yes.

Quick fix is released in V1.0.1

Thank you! I will try your fix and close the issue meanwhile.