AsyncErr: Expecting itemstack, itemstring, table or nil. item=farming:raspberries #492
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#492
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some time ago I had an error reading
Unfortunately I don't know what exactly the player did. There are carrot related lines in the log the minutes before, so at least someone had probably carrots in their hands:
Noone could make heads or tails of it and I forgot about it. May have been a special breed of carrots. Yesterday, it happened again, rapsberries this time. No player claimed they had done anything relating to raspberries.
How can I keep carrots and raspberries from rebelling?
https://forum.minetest.net/viewtopic.php?p=394145#p394145
Maybe what type of block at those coords can give a clue? Flowerpot or something?
2021-09-27 04:17:36: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Expecting itemstack, itemstring, table or nil. item=farming:seed_wheat
2021-09-29 09:52:04: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Expecting itemstack, itemstring, table or nil. item=farming:carrot
2021-10-31 01:58:18: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Expecting itemstack, itemstring, table or nil. item=farming:potato
2022-01-08 10:53:48: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Expecting itemstack, itemstring, table or nil. item=farming:carrot
any infos about a player you could ask or coords to check what nodes are there?
2022-02-26 22:45:32: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Expecting itemstack, itemstring, table or nil. item=farming:pea_pod
Created a new PR for adding extra info for this (the old one somehow got into a weird state)
your-land/minetest#2
The trigger is a
flowerpot:empty
, in a protected area, with e.g. a carrot in hand, while not havingprotection_bypass
.I thought it might have something to do w/ the flowerput possibly having been placed w/ worldedit or via a schematic, but that doesn't seem to be the case.
Finally a solution.
Aleks555 found a repro: #1760
flux fixed it here: https://github.com/minetest-mods/flowerpot/pull/13
There was technically a second trigger for the same behavior, which was if any player right-clicked an empty flower pot while holding an unknown item.
great timing, didnt phillip trade his now unknown item flight potion today? I think he wanted to keep it to put it into an itemframe 😆
@AliasAlreadyTaken we aren't done with this yet, I can't replicate the crash running only
default_game
, it's gotta be in connection w/ another mod. Possibly, other code could generate the same crash. Doubt I'll track it down tonight.After disabling all of the yl mods and half of the others, at least the error message changed:
2022-04-15 10:03:40: ERROR[Main]: ServerError: AsyncErr: Lua: item_OnPlace: Expecting itemstack, itemstring, table or nil. item=farming:carrot
{
"areas",
"beds",
"binoculars",
"boats",
"bones",
"bucket",
"butterflies",
"carts",
"creative",
"default",
"doors",
"dungeon_loot",
"dye",
"env_sounds",
"farming",
"fire",
"fireflies",
"flowerpot",
"flowers",
"game_commands",
"give_initial_stuff",
"intllib",
"keys",
"map",
"mtg_craftguide",
"player_api",
"screwdriver",
"sethome",
"sfinv",
"spawn",
"stairs",
"tnt",
"vessels",
"walls",
"weather",
"wool",
"worldedit",
"worldedit_commands",
"worldedit_shortcommands",
"xpanes",
"yl_npc",
"yl_tools"
}
areas and flowerpot need to be in for the repro, worldedit to read out stuff.
flowerpot has no dependency to biome_lib, but stops loading when biome lib is not present. Why?
name = flowerpot
depends = default
optional_depends = moretrees, dryplants, poisonivy, farming, flowers
description = A stylish flowerpot that can contain most plants.
Attached my test mod "doomcarrot"
Can crash the protected flowerpot, protected flowerpot + flux fix and pure MTG just by placing it because it returns the unexpected true at on_place.
So far I found those combinations
moretrees, dryplants, and poisonivy depend on biome_lib. minetest's mod dependency resolution is a bit screwy - if an optional_depend is present but can't be loaded, the mod fails to load. the solution is to make sure moretrees, dryplants, and poisonivy are also removed.
@Bla interesting, that's certainly related, but not the same behavior that's crashing the flowerpot. this is the code that i've been using to test the crashy behavior we're seeing:
@flux that was a reply to Alias post about the changed error code he got I just forgot to quote but added it now per edit.
There's no way we can detect such a construction in the code automatically. We'd have to go through each and every on_rightclick. Can we automatically execut each on_rightclick of every node, entity and whatever else there is? Yes, we can, but we can't guess each path that might lead to a return without xy-ing the test.
What is "false" supposed to mean in this case anyways? I assume the modmaker wanted to say "nil", but since nil is evil they went with false?
After all, this is IMO an engine bug or at least something that needs to be handled in the engine. No need to silently remove the false and insert a nil instead, but at least failing with a less
incredibly unhelpful message
would be nice. Is there a technical reason why MT doesn't say which node is involved or what position or what player?No, Im pretty sure that can happen for alot of the on_ events not just rightclick & place and you would also need to recheck with every mod update.
I guess its more convinient to read, like I used true as value for the doomcarrot because the crash happens at that point
the expected return values are not even documented in lua_api.txt.
Was curious what happens if you return nil, on_place does nothing not even crash.
temporary fix until flux PR is accepted upstream:
2691bd83e1
flux PR upstream:
https://github.com/minetest-mods/flowerpot/pull/13
Upstream PR got merged, though I still want to spend some more time figuring out the exact locus of the crash
Heh, even before I could ship the replacement!
Nice, I'll remove the replacement and use default again.
That's incredibly fast for minetest.
I agree, there needs to be some more research, I'd like to know why it doesn't happen when you grab flowerpot from CDB and use it in MTG without any other mod. There needs to be some other influence, but so far my tests were inconclusive.
Alright, convinced myself there isn't another real "part" to this bug. What's going on w/ e.g. a carrot, is in the carrot's
on_place
logic, if the carrot can't be planted, it invokes thepointed_thing
'son_rightclick
action, if there is one, and returns the result.Upstream engine bug should say, "returning invalid values from
on_place
and the like should give a more meaningful error message".Sounds like its fixed. I'll close until it happens again.