Error "attempt to index field 'owner' (a nil value) and my game crashes

Hi,
so this error message shows up a few minutes before my game crashes each time, though sometimes it crashes before it finishes loading my save or right at the main menu. My game is run via Steam and I have the latest updates. I’ve tried removing all my fields (farmer, trapper and shepherd) and making new ones but it didn’t change anything. Bellow the error is also a list of mods I use.

release-949 (x64)[M]
stonehearth/components/lease/lease_component.lua:62: attempt to index field ‘owner’ (a nil value)
stack traceback:
[C]: ?
stonehearth/components/lease/lease_component.lua:62: in function <stonehearth/components/lease/lease_component.lua:57>
(tail call): ?
stonehearth/ai/actions/reserve_entity.lua:33: in function <stonehearth/ai/actions/reserve_entity.lua:21>
[C]: in function ‘set_think_output’
…ehearth/ai/actions/find_path_to_reachable_entity.lua:69: in function ‘cb’
stonehearth/components/pathfinder/astar_search.lua:135: in function <stonehearth/components/pathfinder/astar_search.lua:120>
(tail call): ?

Mods:

  • Templates: Desert Watch Tower, Pottery Studio Rayya, Rayya Blacksmith, Hallgrímskirkja; Icelandic church, 段国ACE建筑-桥梁, Oasis Desert Series - Builds, Master Baits’ Hearth & Shrine Template Pack - Ascendency, Build me a Market Place, Rayya’s Latticework T1 Buildings, Rayya’s Speckle T1 Buildings, [Template Pack] Lake Town, Rayya’s Luxury Homes, Japanese Temple and Traditional Style House, Tree of life; The herbalist witch hut, Garden Hospital, House pack by Vuk, [ACE] TMD - Tier 2 Buildings, Northern Red Series - Builds, Wini´s Stonehearth Templates, Wini´s Little Castle, Marienburg Castle Template, Dragon’s castle, Japan style Castle, More Japanese template for Muramasa clan [ACE], Muramasa Tavern, Cider 最简单实用的小房子们~, Ascendancy Wishwood T1 Buildings, Market Place, TMD - Tier I-III Buildings, Silverthorn Tier 1 Buildings, Silverthorn Carpenter House, Skuldos - Basic Template Pack, Vasedro - Basic and High Template Packs, Riallwood - Basic and High Template Packs, City “Sapphire Down”, Rayya’s Compound T1 Buildings, Norman Homes, Egyptian Cult Temple for the Monkey, Chosen of the Desert 1-3, DFC Templates, Vaffel’s Pack 1, Painted Desert Builds, The Orient Awaits 1-2, Desert Garden Templates .

  • Gameplay and system: Authorized Community Expansion (ACE), LostEms, Glowy Windows, Fisher Job + Archipelago Biome, More Realistic Farming (MRF) [vanilla+ACE], Magma Biome, Persian Architecture Pack, Settlement Decor, Better Storage, Extra Map Options, Clan Muramasa.

It has nothing to do with “fields” in that sense. This is a bug from a previous version of ACE related to fuel in workshops. Try emptying all fuel-using workshops (setting their filter to None), saving, and reloading. Worst-case scenario I think is destroying and replacing any fuel-using workshops.

Thank you for the response. I tried your advice and unfortunately, it did not help. I still received an error message, but it was different from my previous one:

release-949 (x64)[M]
stonehearth/components/lease/lease_component.lua:62: attempt to index field ‘owner’ (a nil value)
stack traceback:
[C]: ?
stonehearth/components/lease/lease_component.lua:62: in function <stonehearth/components/lease/lease_component.lua:57>
(tail call): ?
stonehearth/ai/actions/reserve_entity.lua:33: in function <stonehearth/ai/actions/reserve_entity.lua:21>
[C]: in function ‘set_think_output’
stonehearth/ai/actions/pickup_item_action.lua:42: in function <stonehearth/ai/actions/pickup_item_action.lua:20>
[C]: in function ‘set_think_output’
…arth/ai/actions/pickup_item_into_backpack_action.lua:19: in function <…arth/ai/actions/pickup_item_into_backpack_action.lua:16>
[C]: in function ‘set_think_output’
…rth_ace/ai/actions/execute_restock_errand_action.lua:113: in function ‘_try_take_errand’
…rth_ace/ai/actions/execute_restock_errand_action.lua:71: in function <…rth_ace/ai/actions/execute_restock_errand_action.lua:66>
[C]: ?
[C]: in function ‘update’
radiant/modules/events.lua:59: in function ‘_update’
radiant/server.lua:67: in function <radiant/server.lua:64>

Also unrelated, but probably causing some other gameplay issues, the mod “Better Storage” is not compatible with ACE. Our compatibility list states as follows:

Very nice and popular, Better Storage adds lots of filters for individual items. It will, however, break filtering of certain items when used alongside ACE, preventing things from ever being stored in input bins (like Bolts of Cloth). The author has mentioned an ACE version a while ago but it has not been released so far.

So you should probably not use it anymore :<
(We have a list of compatible/incompatible mods in our discord server :merry: )

Noted. Didn’t know it was incompatible since I haven’t joined the discord server (didn’t know there was one until today). I’ll definitely go over all my mods to see which are ok and which aren’t anymore.

The fuel items themselves (wood, coal, etc.) might have broken leases. You might have to destroy all of the items that were being used as fuel in workshops.

This problem should only be happening for fueled workshops from a game that was saved in a previous version of ACE. Was this a game that was created only with the latest version? If so, that’s more concerning.

Oh boy, I’m not sure how to do that. I have a lot of wood and coal in a bunch of different containers all mixed with other stuff.
I’m running ACE version 0.9.5.4b and the About page says it’s 1.1.0 (release 949) x64
Edit: I’d like to add that I have auto-update enabled on Steam

The problematic fuel items would probably only be items that are failing to get restocked, as suggested by that error. So it would only be wood/coal/etc. that you emptied out of your fuel workshops that then stays on the ground and doesn’t get restocked.

Alright, I’ve re-emptied all my fuel-using workshops and used console commands to destroy what wood and other fuel I could find on the ground, then saved and restarted the game. It looks to have worked this time