# Can't promote second Farmer - or maybe error while mining

**URL:** <https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351>\
**Category:** Resolved Reports\
**Tags:** resolved\
**Created:** [February 26, 2016, 12:23pm UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351 "2016-02-26T12:23:42Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![talamatur](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/talamatur/32/48991_2.png) [@talamatur](https://discourse.stonehearth.net/u/talamatur)\
**Post date:** [February 26, 2016, 12:23pm UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/1 "2016-02-26T12:23:42Z")

</div>

**Summary:**  
I started a game. played it for 3 days. Had one Farmer (8villagers) and wasn’t able to promote a second Farmer.  
(save game attached)  
After saving and loading the same again, the problem is gone!

I also realized that many problems with “stucking orders” are removed after loading.

**Steps to reproduce:**  
Can’t say for sure

1. start with asccending race on forest map with medium dificult
2. geather plants, build a house and sleeping place
3. promote a farmer and patch 5 10x10felds with different crops (it should me to mutch for one farmer)  
a) give the villager a “upgraded worker outfit”
4. build a tool and promote a second farmer  
-\> second farmer stuck

**Expected Results:**  
Second farmer should abort his job (building, geathering…) drop his “upgraded worker outfit” and start promoting as a farmer.

**Actual Results:**  
Cant promote my hearthings to farmer

**Notes:**  
The problem is removed after reloading the attched save game.

There was also a lot of non used farmland. Maybe this somehow connected.

You can contact me for additional tests.

**Attachments:**  
[cant\_promote\_farmer.zip](https://discourse.stonehearth.net/uploads/short-url/s0NAN9eZ1tRfPFbimGlmU2jmH7f.zip) (5.2 MB)

**Version Number and Mods in use:**  
0.14.0 latest (2860) x64

**Script Errors**  
Maybe not related with this problem, but coming maybe 1min after the game was saved. (not coming again after loading!)

```auto
develop-2860 (x64)
...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: attempt to index local 'item' (a nil value)
stack traceback:
    ...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: in function <...th/ai/actions/pickup_placed_item_adjacent_action.lua:15>
    [C]: ?
    [C]: in function 'execute'
    ...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42>
    [C]: ?
    [C]: ?
    [C]: ?
    [C]: ?
    [C]: in function 'run'
    ...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141>
    [C]: ?
    ...
    [C]: in function 'run'
    stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520>
    [C]: in function 'xpcall'
    radiant/modules/common.lua:243: in function 'xpcall'
    stonehearth/components/ai/ai_component.lua:520: in function '_thread_main'
    stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246>
    [C]: in function 'xpcall'
    radiant/modules/common.lua:243: in function 'xpcall'
    stonehearth/services/server/threads/thread.lua:246: in function 'f'
    radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

```

---

<div class="post-metadata">

**Author:** ![Eddie](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@Eddie](https://discourse.stonehearth.net/u/Eddie)\
**Post date:** [February 27, 2016, 12:21am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/2 "2016-02-27T00:21:40Z")

</div>

**Summary:**

I believe this happened when my hearthlings were either mining out a section of iron ore, the stone around it, or maybe when trying to transport the loot back to the camp.

**Steps to reproduce:**  
1)  
2)  
3)

**Expected Results:**

**Actual Results:**

**Notes:**

```auto
develop-2860 (x64)
...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: attempt to index local 'item' (a nil value)
stack traceback:
	...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: in function <...th/ai/actions/pickup_placed_item_adjacent_action.lua:15>
	[C]: ?
	[C]: in function 'execute'
	...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42>
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: in function 'run'
	...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141>
	[C]: ?
	...
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:520: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:246: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

```

**Attachments:**

**Version Number and Mods in use:**  
I’m running the Alpha 15 test build.  
**System Information:**

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/jomaxro/32/47935_2.png) [@jomaxro](https://discourse.stonehearth.net/u/jomaxro)\
**Post date:** [February 27, 2016, 12:22am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/3 "2016-02-27T00:22:53Z")

</div>

Hey there @Eddie, welcome to the Discourse! Thanks for the report - I merged it here as it appears to be the same error.

---

<div class="post-metadata">

**Author:** ![Kittyodoom](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kittyodoom/32/61413_2.png) [@Kittyodoom](https://discourse.stonehearth.net/u/Kittyodoom)\
**Post date:** [February 28, 2016, 4:59am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/4 "2016-02-28T04:59:18Z")

</div>

So, got an error log from this version:

```auto
develop-2860 (x64)
...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: attempt to index local 'item' (a nil value)
stack traceback:
	...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: in function <...th/ai/actions/pickup_placed_item_adjacent_action.lua:15>
	[C]: ?
	[C]: in function 'execute'
	...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42>
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: in function 'run'
	...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141>
	[C]: ?
	...
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:520: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:246: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

```

---

<div class="post-metadata">

**Author:** ![8BitCrab](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/8bitcrab/32/48512_2.png) [@8BitCrab](https://discourse.stonehearth.net/u/8BitCrab)\
**Post date:** [February 28, 2016, 5:01am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/5 "2016-02-28T05:01:24Z")

</div>

hey @Kittyodoom,

just moved your post over here as its the same error. any clue what was happening when you got the error?

---

<div class="post-metadata">

**Author:** ![Kittyodoom](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kittyodoom/32/61413_2.png) [@Kittyodoom](https://discourse.stonehearth.net/u/Kittyodoom)\
**Post date:** [February 28, 2016, 5:02am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/6 "2016-02-28T05:02:03Z")

</div>

Had a few things going on, but believe it was from moving a silkweed

---

<div class="post-metadata">

**Author:** ![Minerexstacy](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@Minerexstacy](https://discourse.stonehearth.net/u/Minerexstacy)\
**Post date:** [February 28, 2016, 5:49am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/7 "2016-02-28T05:49:54Z")

</div>

**Summary:** Not really sure what happened, but it seems like I was mining and the hearthlings were trying to pick up the drops (Happened 3 times)

**Steps to reproduce:**

1. ???
2. 
3. 

**Expected Results:**???

**Actual Results:**???

**Notes:** Started a brand new world, and first error I get after I cut down a tree, then start mining.

**Attachments:** [http://pastebin.com/BWbdXfVB](http://pastebin.com/BWbdXfVB)

**Version Number and Mods in use:** 2860

**System Information:** Intel i5, GeForce 520

---

<div class="post-metadata">

**Author:** ![Kittyodoom](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/kittyodoom/32/61413_2.png) [@Kittyodoom](https://discourse.stonehearth.net/u/Kittyodoom)\
**Post date:** [February 28, 2016, 6:16am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/8 "2016-02-28T06:16:15Z")

</div>

Also, it’s been an hour, and these still haven’t been placed:

![](https://us1.discourse-cdn.com/flex022/uploads/stonehearth/original/3X/a/9/a9197b74ba948b9f296ca1e6f55bfa3b6ad4e5db.png)

(Mason and Weaver Workbenches)

---

<div class="post-metadata">

**Author:** ![bigband17](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@bigband17](https://discourse.stonehearth.net/u/bigband17)\
**Post date:** [February 29, 2016, 10:32pm UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/9 "2016-02-29T22:32:21Z")

</div>

```auto
develop-2860 (x64)
...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: attempt to index local 'item' (a nil value)
stack traceback:
	...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: in function <...th/ai/actions/pickup_placed_item_adjacent_action.lua:15>
	[C]: ?
	[C]: in function 'execute'
	...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42>
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: in function 'run'
	...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141>
	[C]: ?
	...
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:520: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:246: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

```

```auto
develop-2860 (x64)
(8682931 Beth Dorril) (stonehearth:pickup_item_adjacent) bad frame transition to "stop" from "starting_thinking"
stack traceback:
	[C]: ?
	[C]: in function 'execute'
	...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42>
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: in function 'run'
	...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141>
	[C]: ?
	[C]: ?
	...
	[C]: in function 'run'
	stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/components/ai/ai_component.lua:520: in function '_thread_main'
	stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246>
	[C]: in function 'xpcall'
	radiant/modules/common.lua:243: in function 'xpcall'
	stonehearth/services/server/threads/thread.lua:246: in function 'f'
	radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14>

```

---

<div class="post-metadata">

**Author:** ![MooOooN](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@MooOooN](https://discourse.stonehearth.net/u/MooOooN)\
**Post date:** [March 10, 2016, 8:47pm UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/10 "2016-03-10T20:47:55Z")

</div>

**Summary:**  
Hi Support! Great game I just started playing today. While i was giving different commands which included creating two wooden swords and gathering berries, an Engine Error window popped up with some issue. I don’t know how to reproduce. My game is working fine (to the extent I know) and I don’t know if any of my people have messed something up.

This is my first time playing and [this](https://www.dropbox.com/s/jo0bvzt3yhvrpc9/zxcs.png?dl=0) is how far I have played.

Loving this game.

Cheers!

**Attachments:**  
Apparently I am new and not allowed to upload log file. Content is in the Notes section.

**Note:**  
The bug i received is [stonehearth.log](https://www.dropbox.com/s/2u01ctqpjmgrbja/stonehearth.log?dl=0) file. You will find the error i received at _2016-03-09 17:08:00.703391_ . Though there are some other things like Unexpected error for Analytics in this log file.

**Version Number and Mods in use:**  
Version: Stonehearth v0.14.0\_dev.2860  
Mods:  
candledark.smod  
frostfeast.smod  
radiant.smod  
rayyas\_children.smod  
rayyas\_children\_ui.smod  
stonehearth.smod  
**System Information:**  
OS: Windows 10 Home 64-but  
Processor: Intel® Core™ i3-4000M CPU @ 2.40GHz (4CPUs), ~2.4GHz  
Memory: 12288MB RAM  
Page file: 6423MB used, 7636MB available  
DirectX Version: 12

Display: Intel® HD Graphics 4600  
Display Memory: 6214 MB  
Dedicated Memory: 112 MB  
Shared Memory: 6102 MB  
Current Mode: 1366 x 768 (32 bit) (60Hz)

---

<div class="post-metadata">

**Author:** ![Relyss](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/relyss/32/41785_2.png) [@Relyss](https://discourse.stonehearth.net/u/Relyss)\
**Post date:** [March 9, 2016, 9:19pm UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/11 "2016-03-09T21:19:26Z")

</div>

Hello @MooOooN, welcome to the forum 😄

Let’s see… The errors seem to be:  
`-- Script Error (lua) Begin ------------------------------- ...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: attempt to index local 'item' (a nil value) stack traceback: ...th/ai/actions/pickup_placed_item_adjacent_action.lua:22: in function <...th/ai/actions/pickup_placed_item_adjacent_action.lua:15> [C]: ? [C]: in function 'execute' ...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42> [C]: ? [C]: ? [C]: ? [C]: ? [C]: in function 'run' ...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141> [C]: ? ... [C]: in function 'run' stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520> [C]: in function 'xpcall' radiant/modules/common.lua:243: in function 'xpcall' stonehearth/components/ai/ai_component.lua:520: in function '_thread_main' stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246> [C]: in function 'xpcall' radiant/modules/common.lua:243: in function 'xpcall' stonehearth/services/server/threads/thread.lua:246: in function 'f' radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14> -- Lua Error End ------------------------------- generating traceback... generating traceback... -- Script Error (lua) Begin ------------------------------- (2731 Mell Inverse) (stonehearth:pickup_item_adjacent) bad frame transition to "stop" from "starting_thinking" stack traceback: [C]: ? [C]: in function 'execute' ...ut_another_restockable_item_into_backpack_action.lua:56: in function <...ut_another_restockable_item_into_backpack_action.lua:42> [C]: ? [C]: ? [C]: ? [C]: ? [C]: in function 'run' ...tonehearth/services/server/tasks/run_task_action.lua:143: in function <...tonehearth/services/server/tasks/run_task_action.lua:141> [C]: ? [C]: ? ... [C]: in function 'run' stonehearth/components/ai/ai_component.lua:536: in function <stonehearth/components/ai/ai_component.lua:520> [C]: in function 'xpcall' radiant/modules/common.lua:243: in function 'xpcall' stonehearth/components/ai/ai_component.lua:520: in function '_thread_main' stonehearth/services/server/threads/thread.lua:249: in function <stonehearth/services/server/threads/thread.lua:246> [C]: in function 'xpcall' radiant/modules/common.lua:243: in function 'xpcall' stonehearth/services/server/threads/thread.lua:246: in function 'f' radiant/lib/env.lua:15: in function <radiant/lib/env.lua:14> -- Lua Error End -------------------------------`

I’m not sure if it’s relevant since there have been 4 more releases since your version, but thanks for reporting anyway. I’ll try to search if someone had reported it already or if it has been fixed.

**Edit:** merged here due to same lua errors.

---

<div class="post-metadata">

**Author:** ![MooOooN](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@MooOooN](https://discourse.stonehearth.net/u/MooOooN)\
**Post date:** [March 11, 2016, 6:07am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/12 "2016-03-11T06:07:00Z")

</div>

> [@Relyss](#):
>
> \<…ut\_another\_restockable\_item\_into\_backpack\_action.lua:42\>

Appreciate it! 🙂

---

<div class="post-metadata">

**Author:** ![yshan](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.stonehearth.net/yshan/32/18457_2.png) [@yshan](https://discourse.stonehearth.net/u/yshan)\
**Post date:** [March 11, 2016, 6:28am UTC](https://discourse.stonehearth.net/t/cant-promote-second-farmer-or-maybe-error-while-mining/20351/13 "2016-03-11T06:28:47Z")

</div>

Hi,  
I put in a fix for this in 2876. Please let me know if you run into this bug again after updating the game.  
Thanks  
-Yang
