Guild Bank Snapshots

Guild Bank Snapshots

16.9k Downloads

[BUG] `bad argument #2 to 'format'`

tflo opened this issue ยท 16 comments

commented

Getting this error with 3.4.1, on client 10.0.0(36455):

Error inside
1x ...ace/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua:91: bad argument #2 to 'format' (string expected, got nil)
[string "=[C]"]: in function `format'
[string "@Interface/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua"]:91: in function `GetGuildID'
[string "@Interface/AddOns/GuildBankSnapshots/Modules/Database/Database.lua"]:196: in function `UpdateGuildDatabase'
[string "@Interface/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua"]:33: in function <...ace/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua:21>
[string "@Interface/SharedXML/EventUtil.lua"]:74: in function <Interface/SharedXML/EventUtil.lua:66>
[string "=[C]"]: ?
[string "@Interface/SharedXML/CallbackRegistry.lua"]:143: in function <Interface/SharedXML/CallbackRegistry.lua:142>
[string "=[C]"]: ?
[string "@Interface/SharedXML/CallbackRegistry.lua"]:146: in function `TriggerEvent'
[string "@Interface/SharedXML/GlobalCallbackRegistry.lua"]:9: in function <Interface/SharedXML/GlobalCallbackRegistry.lua:8>
[string "=[C]"]: in function `LoadAddOn'
[string "@Interface/AddOns/ArkInventory/Core/ArkInventory.lua"]:11121: in function `LoadAddOn'
[string "@Interface/AddOns/ArkInventory/Core/ArkInventory.lua"]:11150: in function `BlizzardAPIHook'
[string "@Interface/AddOns/ArkInventory/Core/ArkInventory.lua"]:2900: in function <Interface/AddOns/ArkInventory/Core/ArkInventory.lua:2869>
[string "=[C]"]: ?
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:66: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:61>
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:523: in function `EnableAddon'
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:626: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:611>

Locals:
(*temporary) = "%s - %s (%s)"
(*temporary) = nil
(*temporary) = "Azjol-Nerub"
(*temporary) = "Alliance"
(*temporary) = "string expected, got nil"

Unfortunately I'm unable to reliably reproduce it. There are sessions where the error doesn't come up. It can appear with different addon sets.

In a few tests without any other addons, I could not produce it. But this doesn't necessarily mean that it is an addon conflict, because sometimes it does not appear even with my normal addon sets.

It seems to me, if it shows up, that it is โ€“ most of the times โ€“ somewhere at or shortly after login.

โ€“ Tom

commented

Since we're just getting more and more errors, can I get a copy of your sv to mess around with?

commented

Try v3.4.2 and let me know if this error persists.

commented

With 3.4.2 I get Database.lua:59: bad argument #1 to 'pairs' (table expected, got nil) directly after login.

Error
4x ...Ons/GuildBankSnapshots/Modules/Database/Database.lua:59: bad argument #1 to 'pairs' (table expected, got nil)
[string "=[C]"]: in function `pairs'
[string "@Interface/AddOns/GuildBankSnapshots/Modules/Database/Database.lua"]:59: in function `DeleteCorruptedScans'
[string "@Interface/AddOns/GuildBankSnapshots/Modules/Database/Database.lua"]:24: in function `CleanupDatabase'
[string "@Interface/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua"]:16: in function <...ace/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua:14>
[string "=[C]"]: ?
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:66: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:61>
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:494: in function `InitializeAddon'
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:619: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:611>
commented

I think this is a result of the latest change I pushed to help prevent errors with invalid guilds. See if v3.4.3 works.

commented

With 3.4.3 getting Database.lua:58: 'for' limit must be a number

Details
2x ...Ons/GuildBankSnapshots/Modules/Database/Database.lua:58: 'for' limit must be a number
[string "@Interface/AddOns/GuildBankSnapshots/Modules/Database/Database.lua"]:58: in function `DeleteCorruptedScans'
[string "@Interface/AddOns/GuildBankSnapshots/Modules/Database/Database.lua"]:19: in function `CleanupDatabase'
[string "@Interface/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua"]:16: in function <...ace/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua:14>
[string "=[C]"]: ?
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:66: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:61>
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:494: in function `InitializeAddon'
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:619: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:611>
commented

Just looked at the SV file and noticed that apparently I have not yet made a snapshot of the Horde guild, only of the Alliance one. Maybe the absence of a snapshot has to do with the issues?

(I started using your addon only 2 days ago.)

commented

v3.4.4

No, there isn't a problem with missing guilds. I had to change the format of the database to prevent invalid guilds from causing display errors. As a result, I missed a few other places where tables are assumed to exist, but no longer do. I played around with your SVs and I believe I have things functioning. Though, my track record lately has been error after error, so crossing my fingers. :)

commented

OK, now it works again (i.e. I can open the GUI with /gbs), and the old error is back:

GuildBankSnapshots.lua:86: bad argument #2 to 'format' (string expected, got nil)

Details
2x ...ace/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua:86: bad argument #2 to 'format' (string expected, got nil)
[string "=[C]"]: in function `format'
[string "@Interface/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua"]:86: in function `GetGuildID'
[string "@Interface/AddOns/GuildBankSnapshots/Modules/Database/Database.lua"]:197: in function `UpdateGuildDatabase'
[string "@Interface/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua"]:32: in function <...ace/AddOns/GuildBankSnapshots/GuildBankSnapshots.lua:21>
[string "@Interface/SharedXML/EventUtil.lua"]:74: in function <Interface/SharedXML/EventUtil.lua:66>
[string "=[C]"]: ?
[string "@Interface/SharedXML/CallbackRegistry.lua"]:143: in function <Interface/SharedXML/CallbackRegistry.lua:142>
[string "=[C]"]: ?
[string "@Interface/SharedXML/CallbackRegistry.lua"]:146: in function `TriggerEvent'
[string "@Interface/SharedXML/GlobalCallbackRegistry.lua"]:9: in function <Interface/SharedXML/GlobalCallbackRegistry.lua:8>
[string "=[C]"]: in function `LoadAddOn'
[string "@Interface/AddOns/ArkInventory/Core/ArkInventory.lua"]:11136: in function `LoadAddOn'
[string "@Interface/AddOns/ArkInventory/Core/ArkInventory.lua"]:11165: in function `BlizzardAPIHook'
[string "@Interface/AddOns/ArkInventory/Core/ArkInventory.lua"]:2914: in function <Interface/AddOns/ArkInventory/Core/ArkInventory.lua:2883>
[string "=[C]"]: ?
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:66: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:61>
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:523: in function `EnableAddon'
[string "@Interface/AddOns/Accountant_Classic/Libs/AceAddon-3.0-13/AceAddon-3.0.lua"]:626: in function <...ccountant_Classic/Libs/AceAddon-3.0/AceAddon-3.0.lua:611>

Locals:
(*temporary) = "%s - %s (%s)"
(*temporary) = nil
(*temporary) = "Azjol-Nerub"
(*temporary) = "Alliance"
(*temporary) = "string expected, got nil"

I tried it on 4 or 5 different toons:

  • The error comes always after login
  • If I reload then, the error does not come
  • Logging in with only GuildBankSnapshots enabled does not produce the error

So, it is possible that there is a conflict with another addon. Strange though that the error is absent after reloading (also with the normal addons loaded).

commented

Seems it is conflicting with ArkInventory. Did a few logins without ArkInventory, and the error did not appear!

commented

I believe one of the addons you are using is loading Blizzard_GuildBankUI before I have data that I need, so I've added a delay to that in v3.4.5.

commented

Just posted at the same time as you. See above.

commented

Yes, Ark is the addon I tested with.

commented

Congrats, it's fine now: 3 tests and could login with Ark and GuildBankSnapshots without error.

Seems your bad track record is over now :)

Many thanks for your efforts!

commented

Thanks for your patience.

commented

It was a pleasure.