`WQAchievements.lua:2698: attempt to index field '?' (a nil value)`
tflo opened this issue · 12 comments
I'm getting frequently (but not always) this error:
WQAchievements.lua:2698: attempt to index field '?' (a nil value)
10x WQAchievements/WQAchievements.lua:2698: attempt to index field '?' (a nil value)
[string "@WQAchievements/WQAchievements.lua"]:2698: in function `CheckMissions'
[string "@WQAchievements/WQAchievements.lua"]:475: in function <WQAchievements/WQAchievements.lua:430>
Locals:
self = <table> {
watched = <table> {
}
IsQuestFlaggedCompleted = <function> defined @WQAchievements/WQAchievements.lua:2763
UpdateCustomRewards = <function> defined @WQAchievements/Options.lua:1470
SetRewardLinkByID = <function> defined @WQAchievements/WQAchievements.lua:2325
EnableModule = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:328
modules = <table> {
}
GetRewardForID = <function> defined @WQAchievements/WQAchievements.lua:951
IterateEmbeds = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:438
ToggleGet = <function> defined @WQAchievements/Options.lua:1255
CreateCustomQuest = <function> defined @WQAchievements/Options.lua:1341
debug = false
isQuestPinActive = <function> defined @WQAchievements/WQAchievements.lua:2752
slash = <function> defined @WQAchievements/WQAchievements.lua:485
SetDefaultModulePrototype = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:405
Show = <function> defined @WQAchievements/WQAchievements.lua:776
itemList = <table> {
}
defaultModuleState = true
AnnouncePopUp = <function> defined @WQAchievements/WQAchievements.lua:2180
IsEnabled = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:447
ExpansionList = <table> {
}
ScheduleTimer = <function> defined @Ace3/AceTimer-3.0/AceTimer-3.0.lua:94
DisableModule = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:346
missionList = <table> {
}
CreateCustomMissionReward = <function> defined @WQAchievements/Options.lua:1600
GetArgs = <function> defined @Ace3/AceConsole-3.0/AceConsole-3.0.lua:140
data = <table> {
}
questList = <table> {
}
ZoneIDList = <table> {
}
EmissaryReward = <function> defined @WQAchievements/WQAchievements.lua:2423
CreateCustomReward = <function> defined @WQAchievements/Options.lua:1459
SetEnabledState = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:420
IsTransmogable = <function> defined @WQAchievements/WQAchievements.lua:1365
enabledState = true
link = <function> defined @WQAchievements/WQAchievements.lua:937
playerName = "Slythe-AzjolNerub"
event = Frame {
}
optionsFrame = Frame {
}
links = <table> {
}
db = <table> {
}
IterateModules = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:433
baseName = "WQAchievements"
faction = "Alliance"
SortOptions = <function> defined @WQAchievements/Options.lua:1662
L = <table> {
}
Achievements = <table> {
}
Reward = <function> defined @WQAchievements/WQAchievements.lua:1221
UpdateCustomMissions = <function> defined @WQAchievements/Options.lua:1529
CheckWQ = <function> defined @WQAchievements/WQAchievements.lua:787
AddToys = <function> defined @WQAchievements/WQAchievements.lua:615
AddMounts = <function> defined @WQAchievements/WQAchievements.lua:542
OnInitialize = <function> defined @WQAchievements/WQAchievements.lua:293
NewModule = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:231
CreateCustomMission = <function> defined @WQAchievements/Options.lua:1515
CreateQTip = <function> defined @WQAchievements/WQAchievements.lua:1841
AddPets = <function> defined @WQAchievements/WQAchievements.lua:570
GetModule = <function> defined @Ace3/AceAddon-3.0/AceAddon-3.0.lua:206
CheckMissions = <function> defined @WQAchievements/WQAchievements.lua:2596
GetOptions = <function> defined @WQAchievements/Options.lua:1228
AddEmissaryReward = <function> defined @WQAchievements/WQAchievements.lua:771
defaultModuleLibraries = <table> {
}
T
As this is inside the AllTheThings branch of the AllTheThings conditional, I get it only with ATT loaded.
First I thought it was due to their recent API changes, but in isolation the AllTheThings.SearchForLink(itemLink)
function seems to work properly (also returning something in field [1]
), at least with some arbitrary item links I've tried it with. (No exhaustive tests though.)
Second, I thought that I get it only on my clothies (Mage, Lock), hence tied to some specific transmog rewards, but recently I've seen it also on my Rogue.
So, I can't provide much useful information at the moment.
WQAchievements v10.1.5-1; WoW Retail 10.1.7.51313.
Since server restart and patch last night (I'm in Europe) it is harder to debug, as I'm having login issues, occasional weird taint issues (one of them allegedly from WQA with c_resume()
), client settings are messed up, and our error is less reliably to reproduce.
But, what I've found out so far should be good enough:
Your solution does not prevent the error, however this seems to prevent it:
if not searchForLinkResult or not searchForLinkResult[1] then
(and I guess that's how you meant it). More precisely: with the or
version I have never seen the error, whereas without modification (or with your and
version) I did get the error, although, as said, less frequently than before the server restart/patch.
This means that I can't say with absolute certainty that the 'or
version' is the definitive fix, but since I'm 99% sure it's a timing issue, and your retry
flag seems to trigger scheduled retries, I'd say it's safe enough to consider it a fix.
I couldn't reproduce the error with any character.
Yes, the error is a bit shy:
- I've only been seeing it for a few weeks, with no apparent trigger/cause.
- It does not happen on all toons, but it has happened on more and more toons over the past few weeks.
- Even on toons where it does occur, it is intermittent (even more so since last night's patch).
I suspect the size of the ATT database and server lag (or absence of server lag) play a role.
Quoting myself:
I say "seems" because I've only tested it on two toons.
This is no longer true. I've now played most of my 17 Lv70 toons with the fix/hack as posted above, and I've never seen the error again. And everything WQA works fine, including custom mission notifications from Draenor and Shadowlands. So replace "seems" with "definitely".
I couldn't reproduce the error with any character.
Could you please change line 2695 to this instead of your timer solution?
if not searchForLinkResult and not searchForLinkResult[1] then
I think with the delay, no matter how long, it could still be possible that ATT can't provide the information we need and the error still happens.
When you use /wqa or click the minimap icon to show the popup after the error: do you still get the error?
When you use /wqa or click the minimap icon to show the popup after the error: do you still get the error?
no, the error don't bug WQ. Its just an error ^^
When you use /wqa or click the minimap icon to show the popup after the error: do you still get the error?
The error is already there when the UI appears, so it seems to get thrown at login, or at entering world, or at addon loading time. My WQA delay for the list is set to 30 seconds, which is 12–15 seconds after the UI appears (with my full addon set loaded).
When I call the list again via click on the LDB button, the error does not come again.
@Urtgard, your question brought me to something: A timing issue with ATT still reading its cache at login and WQA requesting information too early?
And indeed, a delay of just 1 frame for the event-triggered CheckMissions function seems to do the trick for me:
diff --git a/WQAchievements/WQAchievements.lua b/WQAchievements/WQAchievements.lua
--- a/WQAchievements/WQAchievements.lua
+++ b/WQAchievements/WQAchievements.lua
@@ -473,5 +473,5 @@
self.db.global.completed[id] = true
elseif name == "GARRISON_MISSION_LIST_UPDATE" then
- self:CheckMissions()
+ C_Timer.After(0, function() WQA:CheckMissions() end)
end
end
Maybe a longer delay would be safer, IDK.
I say "seems" because I've only tested it on two toons. However, both toons produce the error reliably without the delay.
Thanks for the extra infos. I hope this week I find some time to take a closer look.
Let me know if you see the problem again.
Played the rest of the day after my post, and almost the whole day and half the night yesterday, on numerous different toons, and didn't see the error once 😁 (with or not searchForLinkResult[1]
)
FYI, the above mentioned taint with c_resume()
and WQA as the blamed addon didn't come back.
But, since the patch last week, I get on average 1 to 2 taint notifications (without anything actually blocked) per session, and with a different addon blamed each time. It's almost as if the client would go through all my loaded addons and blame one after the other for some random tainted path. Usually it's with c_resume()
or function UNKNOWN()
.
Smells like Blizz has messed up again.