smaitch / Grail

World of Warcraft addon to provide a database of quest information.
31 stars 20 forks source link

Retail: attempt to index field '?' (a nil value) #138

Closed StanoRiga closed 4 years ago

StanoRiga commented 4 years ago

Version: Grail 1.08 (Retail)

Error: 1x Grail\Grail-108.lua:3642: attempt to index field '?' (a nil value) [string "@Grail\Grail-108.lua"]:3642: in function _LearnWorldQuest' [string "@Grail\Grail-108.lua"]:3513: in function_AddWorldQuests' [string "@Grail\Grail-108.lua"]:2075: in function ?' [string "@Grail\Grail-108.lua"]:10580: in function_Tooltip_OnEvent' [string "@Grail\Grail-108.lua"]:11166: in function <Grail\Grail.lua:11166>

Locals: self =

{ QuestBreadcrumbsFor = defined @Grail\Grail.lua:9196 bitMaskClassPriest = 256 IsBugged = defined @Grail\Grail.lua:7067 bitMaskGenderMale = 8192 _RecordArtifactLevels = defined @Grail\Grail.lua:9794 bitMaskCompleted = 1 _PrepareWorldQuestSelfNewNPCs = defined @Grail\Grail.lua:3390 QuestLocationsAccept = defined @Grail\Grail.lua:9354 IsAvailable = defined @Grail\Grail.lua:7049 NO_SKILL = -1 _HandleEventGarrisonBuildingActivated = defined @Grail\Grail.lua:6754 bitMaskClassAll = 268443644 _HandleEventLootClosed = defined @Grail\Grail.lua:6782 bitMaskQuestLegendary = 4096 _RemoveDelayedNotification = defined @Grail\Grail.lua:5187 reputationFriends =
{ } NPC_TYPE_BY = "BY" NPC_TYPE_DROP = "DROP" _PostDelayedNotification = defined @Grail\Grail.lua:8463 _MarkQuestType = defined @Grail\Grail.lua:5556 receivedCalendarUpdateEventList = true bitMaskClassDeathKnight = 4 QuestNPCPrerequisiteTurnins = defined @Grail\Grail.lua:9525 _ProcessServerBackup = defined @Grail\Grail.lua:8885 bitMaskQuestVariableLevel = 4278190080 MeetsRequirementGroup = defined @Grail\Grail.lua:8045 _EvaluateCodeAsPrerequisite = defined @Grail\Grail.lua:6071 bitMaskInLog = 16 bitMaskQuestWeekly = 4 bitMaskHolidayNoble = 256 MeetsRequirementProfession = defined @Grail\Grail.lua:8130 DoesNPCExist = defined @Grail\Grail.lua:6036 npcNames =
{ } _AllEvaluateTrueS = defined @Grail\Grail.lua:3756 bitMaskQuestFailureWithAncestor = 67043200 verifyTable =
{ } _NPCToUse = defined @Grail\Grail.lua:8316 garrisonBuildingLevelMapping =
{ } bitMaskClassHunter = 16 _LoadContinentData = defined @Grail\Grail.lua:3218 bitMaskQuestRaid = 128 _LocationStructure = defined @Grail\Grail.lua:7612 _HandleEventAchievementEarned = defined @Grail\Grail.lua:6749 checksReputationRewardsOnAcceptance = true classToMapAreaMapping =
{ } verifyTableCount = 0 playerGenderBitMask = 8192 _ReputationExceeds = defined @Grail\Grail.lua:9982 bitMaskRaceUnused9 = 4096 zonesForLootingTreasure =
{ } bitMaskQuestMonthly = 8 mapAreaBaseClass = 200000 exists73 = true LearnObjectName = defined @Grail\Grail.lua:7538 _ContainsAliasNPC = defined @Grail\Grail.lua:5777 classToBitMapping =
{ } FriendshipReputationNameAndLevelName = defined @Grail\Grail.lua:10081 QuestBreadcrumbs = defined @Grail\Grail.lua:9190 NPCName = defined @Grail\Grail.lua:8268 experimental = false bitMaskRaceNightborne = 2 mapAreaBaseReputation = 400000 UnregisterObserverQuestStatus = defined @Grail\Grail.lua:10628 tooltipNPC = com_mithrandir_grailTooltipNPC { } _FactionsFromQuestGivers = defined @Grail\Grail.lua:7947 QuestOnAcceptCompletes = defined @Grail\Grail.lua:9537 bitMaskAncestorLevelTooHigh = 33554432 bitMaskRaceTroll = 16777216 bitMaskCanGetUnused2 = 65536 celebratingHolidayCache =
{ } bitMaskQuestMinLevel = 65280 bitMaskLevelTooHigh = 32768 IsGroup = defined @Grail\Grail.lua:7101 bitMaskCanGetUnused8 = 4194304 bitMaskCanGetUnused15 = 1073741824 MeetsRequirementGroupPossibleToComplete = defined @Grail\Grail.lua:8073 questReputations =
{ } _AddThreatQuests

smaitch commented 4 years ago

Can you try to add the following line so it becomes line 3641 in the Grail.lua file in the addon:

            self._worldQuestSelfNPCs[mapId] = self._worldQuestSelfNPCs[mapId] or {}

It would be the line right before:

            local coordinates = strformat("%.2f,%.2f", x * 100 , y * 100)

Then can you try to see if that fixes the problem. As you can guess I have not been able to recreate the problem at my end.

StanoRiga commented 4 years ago

Yes that does fix the Problem with line 6342, but then another one pops up that was not reported before.

1x Grail\Grail-108.lua:7535: attempt to concatenate local 'npcId' (a nil value) [string "@Grail\Grail-108.lua"]:7535: in function LearnNPCLocation' [string "@Grail\Grail-108.lua"]:3646: in function_LearnWorldQuest' [string "@Grail\Grail-108.lua"]:3513: in function _AddWorldQuests' [string "@Grail\Grail-108.lua"]:2075: in function?' [string "@Grail\Grail-108.lua"]:10581: in function `_Tooltip_OnEvent' [string "@Grail\Grail-108.lua"]:11167: in function <Grail\Grail.lua:11167>

Locals: self =

{ QuestBreadcrumbsFor = defined @Grail\Grail.lua:9197 bitMaskClassPriest = 256 IsBugged = defined @Grail\Grail.lua:7068 bitMaskGenderMale = 8192 _RecordArtifactLevels = defined @Grail\Grail.lua:9795 bitMaskCompleted = 1 _PrepareWorldQuestSelfNewNPCs = defined @Grail\Grail.lua:3390 QuestLocationsAccept = defined @Grail\Grail.lua:9355 IsAvailable = defined @Grail\Grail.lua:7050 NO_SKILL = -1 _HandleEventGarrisonBuildingActivated = defined @Grail\Grail.lua:6755 bitMaskClassAll = 268443644 _HandleEventLootClosed = defined @Grail\Grail.lua:6783 bitMaskQuestLegendary = 4096 _RemoveDelayedNotification = defined @Grail\Grail.lua:5188 reputationFriends =
{ } NPC_TYPE_BY = "BY" NPC_TYPE_DROP = "DROP" _PostDelayedNotification = defined @Grail\Grail.lua:8464 _MarkQuestType = defined @Grail\Grail.lua:5557 receivedCalendarUpdateEventList = true bitMaskClassDeathKnight = 4 QuestNPCPrerequisiteTurnins = defined @Grail\Grail.lua:9526 _ProcessServerBackup = defined @Grail\Grail.lua:8886 bitMaskQuestVariableLevel = 4278190080 MeetsRequirementGroup = defined @Grail\Grail.lua:8046 _EvaluateCodeAsPrerequisite = defined @Grail\Grail.lua:6072 bitMaskInLog = 16 bitMaskQuestWeekly = 4 bitMaskHolidayNoble = 256 MeetsRequirementProfession = defined @Grail\Grail.lua:8131 DoesNPCExist = defined @Grail\Grail.lua:6037 npcNames =
{ } _AllEvaluateTrueS = defined @Grail\Grail.lua:3757 bitMaskQuestFailureWithAncestor = 67043200 verifyTable =
{ } _NPCToUse = defined @Grail\Grail.lua:8317 garrisonBuildingLevelMapping =
{ } bitMaskClassHunter = 16 _LoadContinentData = defined @Grail\Grail.lua:3218 bitMaskQuestRaid = 128 _LocationStructure = defined @Grail\Grail.lua:7613 _HandleEventAchievementEarned = defined @Grail\Grail.lua:6750 checksReputationRewardsOnAcceptance = true classToMapAreaMapping =
{ } verifyTableCount = 0 playerGenderBitMask = 8192 _ReputationExceeds = defined @Grail\Grail.lua:9983 bitMaskRaceUnused9 = 4096 zonesForLootingTreasure =
{ } bitMaskQuestMonthly = 8 mapAreaBaseClass = 200000 exists73 = true LearnObjectName = defined @Grail\Grail.lua:7539 _ContainsAliasNPC = defined @Grail\Grail.lua:5778 classToBitMapping =
{ } FriendshipReputationNameAndLevelName = defined @Grail\Grail.lua:10082 QuestBreadcrumbs = defined @Grail\Grail.lua:9191 NPCName = defined @Grail\Grail.lua:8269 experimental = false bitMaskRaceNightborne = 2 mapAreaBaseReputation = 400000 UnregisterObserverQuestStatus = defined @Grail\Grail.lua:10629 tooltipNPC = com_mithrandir_grailTooltipNPC { } _FactionsFromQuestGivers = defined @Grail\Grail.lua:7948 QuestOnAcceptCompletes = defined @Grail\Grail.lua:9538 bitMaskAncestorLevelTooHigh = 33554432 bitMaskRaceTroll = 16777216 bitMaskCanGetUnused2 = 65536 celebratingHolidayCache =
{ } bitMaskQuestMinLevel = 65280 bitMaskLevelTooHigh = 32768 IsGroup = defined @Grail\Grail.lua:7102 bitMaskCanGetUnused8 = 4194304 bitMaskCanGetUnused15 = 1073741824 MeetsRequirementGroupPossibleToComplete = defined @Grail\Grail.lua:8074 questReputations =
{ } _AddThreatQuests

StanoRiga commented 4 years ago

I tried to fix the function "LearnNPCLocation" by adding npcId = npcId or '' in line 7535, but that led to other errors in "_AddNPCLocation" (as the empty ID is given to that function) and if I'm setting npcID there to 0 I have multiple errors in other lines (and as I am not sure what Im actually doing, I have undone my changes :) )

Btw: thank you for your quick reply

smaitch commented 4 years ago

For the line I asked you to add earlier, can you replace it with:

print("*** learning for", mapId)

Basically I would like to see what the last mapId is before the crash because I do not know where it is coming from. I know it should not be nil, but it seems to be something unexpected.

DiscordGregory commented 4 years ago

I have the same issue, I added the line you mentioned earlier and it says ***learning for 896

StanoRiga commented 4 years ago

In my case its the following print out

learning for 62 learning for 62 learning for 62 learning for 62 learning for 62 learning for 62 learning for 627 learning for 630 learning for 627 learning for 630 *** learning for 646

smaitch commented 4 years ago

Can you try to use the latest Grail on GitHub to see if the problem still occurs for you?

StanoRiga commented 4 years ago

Error message right after login and on every reload


2x Grail\Grail-109.lua:7597: attempt to compare number with nil
[string "@Grail\Grail-109.lua"]:7597: in function `_LocationKnown'
[string "@Grail\Grail-109.lua"]:4610: in function `_CleanLearnedDatabase'
[string "@Grail\Grail-109.lua"]:4735: in function `?'
[string "@Grail\Grail-109.lua"]:1585: in function `?'
[string "@Grail\Grail-109.lua"]:10590: in function `_Tooltip_OnEvent'
[string "@Grail\Grail-109.lua"]:11176: in function <Grail\Grail.lua:11176>

Locals:
self = <table> {
 QuestBreadcrumbsFor = <function> defined @Grail\Grail.lua:9206
 bitMaskClassPriest = 256
 IsBugged = <function> defined @Grail\Grail.lua:7077
 bitMaskGenderMale = 8192
 _RecordArtifactLevels = <function> defined @Grail\Grail.lua:9804
 bitMaskCompleted = 1
 _PrepareWorldQuestSelfNewNPCs = <function> defined @Grail\Grail.lua:3395
 QuestLocationsAccept = <function> defined @Grail\Grail.lua:9364
 IsAvailable = <function> defined @Grail\Grail.lua:7059
 NO_SKILL = -1
 _HandleEventGarrisonBuildingActivated = <function> defined @Grail\Grail.lua:6764
 bitMaskClassAll = 268443644
 _HandleEventLootClosed = <function> defined @Grail\Grail.lua:6792
 bitMaskQuestLegendary = 4096
 _RemoveDelayedNotification = <function> defined @Grail\Grail.lua:5197
 reputationFriends = <table> {
 }
 NPC_TYPE_BY = "BY"
 NPC_TYPE_DROP = "DROP"
 _PostDelayedNotification = <function> defined @Grail\Grail.lua:8473
 _MarkQuestType = <function> defined @Grail\Grail.lua:5566
 receivedCalendarUpdateEventList = false
 bitMaskClassDeathKnight = 4
 QuestNPCPrerequisiteTurnins = <function> defined @Grail\Grail.lua:9535
 _ProcessServerBackup = <function> defined @Grail\Grail.lua:8895
 bitMaskQuestVariableLevel = 4278190080
 MeetsRequirementGroup = <function> defined @Grail\Grail.lua:8055
 _EvaluateCodeAsPrerequisite = <function> defined @Grail\Grail.lua:6081
 bitMaskInLog = 16
 bitMaskQuestWeekly = 4
 bitMaskHolidayNoble = 256
 MeetsRequirementProfession = <function> defined @Grail\Grail.lua:8140
 DoesNPCExist = <function> defined @Grail\Grail.lua:6046
 npcNames = <table> {
 }
 _AllEvaluateTrueS = <function> defined @Grail\Grail.lua:3766
 bitMaskQuestFailureWithAncestor = 67043200
 verifyTable = <table> {
 }
 _NPCToUse = <function> defined @Grail\Grail.lua:8326
 garrisonBuildingLevelMapping = <table> {
 }
 bitMaskClassHunter = 16
 _LoadContinentData = <function> defined @Grail\Grail.lua:3221
 bitMaskQuestRaid = 128
 _LocationStructure = <function> defined @Grail\Grail.lua:7622
 _HandleEventAchievementEarned = <function> defined @Grail\Grail.lua:6759
 checksReputationRewardsOnAcceptance = true
 classToMapAreaMapping = <table> {
 }
 verifyTableCount = 0
 playerGenderBitMask = 8192
 _ReputationExceeds = <function> defined @Grail\Grail.lua:9992
 bitMaskRaceUnused9 = 4096
 zonesForLootingTreasure = <table> {
 }
 bitMaskQuestMonthly = 8
 mapAreaBaseClass = 200000
 exists73 = true
 LearnObjectName = <function> defined @Grail\Grail.lua:7548
 _ContainsAliasNPC = <function> defined @Grail\Grail.lua:5787
 classToBitMapping = <table> {
 }
 FriendshipReputationNameAndLevelName = <function> defined @Grail\Grail.lua:10091
 QuestBreadcrumbs = <function> defined @Grail\Grail.lua:9200
 NPCName = <function> defined @Grail\Grail.lua:8278
 experimental = false
 bitMaskRaceNightborne = 2
 mapAreaBaseReputation = 400000
 UnregisterObserverQuestStatus = <function> defined @Grail\Grail.lua:10638
 tooltipNPC = com_mithrandir_grailTooltipNPC {
 }
 _FactionsFromQuestGivers = <function> defined @Grail\Grail.lua:7957
 QuestOnAcceptCompletes = <function> defined @Grail\Grail.lua:9547
 bitMaskAncestorLevelTooHigh = 33554432
 bitMaskRaceTroll = 16777216
 bitMaskCanGetUnused2 = 65536
 celebratingHolidayCache = <table> {
 }
 bitMaskQuestMinLevel = 65280
 bitMaskLevelTooHigh = 32768
 IsGroup = <function> defined @Grail\Grail.lua:7111
 bitMaskCanGetUnused8 = 4194304
 bitMaskCanGetUnused15 = 1073741824
 MeetsRequirementGroupPossibleToComplete = <function> defined @Grail\Grail.lua:8083
 questReputations = <table> {
 }
 _AddThreatQuest
smaitch commented 4 years ago

Thanks...that is some progress. I have updated Grail to hopefully handle this as well. It seems your Grail.lua saved variables may be in a weird state. Can you upload that so I can test with it? I ask because I have not been able to reproduce the issues you are seeing on any of my characters.

StanoRiga commented 4 years ago

Sure :). Thank you for your support. Grail.zip

StanoRiga commented 4 years ago

Just saw the update to 1.08. This is the Grail.lua after the update. (just in case there are differences between them) Grail108.zip

smaitch commented 4 years ago

I did not mean the Grail.lua from the addons, but I meant the one found in

WoW/_retail_/WTF/Account/account name/SavedVariables/Grail.lua

where your WoW directory depends on where you have WoW installed, and the account name is the one that you use for logging into WoW on the character that has a problem. This Grail.lua is the saved variables for the addon that records the new quests and NPCs that it finds.

StanoRiga commented 4 years ago

Ah, sorry. My mistake. Now the right one. (I edited the char names as Im not able to send you this via PM Grail.zip )

smaitch commented 4 years ago

Thanks. The latest Grail on GitHub should fix this issue.