Page 1 of 1

Server: Too many blocks

PostPosted: Thu Sep 11, 2014 14:47
by Daïmanu
Hi.

Recently, the server started to say frequently errors like:
ERROR[ServerThread]: ServerEnv: Trying to store id=498 statically but block (-20,0,-19) already contains 49 objects. Forcing delete.

or
ERROR[ServerThread]: suspiciously large amount of objects detected: 50 in (-20,0,-19); removing all of them.


The problem is I never went in this location (-20, 0, -19) and it's a solo world. When I teleport to this place, the server generates the blocks, but there are not 50 blocks floating or something like that.

Is the written location wrong, or the server can't actually remove these blocks?

Any idea?

Edit: I'm using minetest 0.4.10-dev, but it seems to happen in 0.4.9 too.

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 14:59
by Sokomine
Do you have a mobs mod installed? They may have multiplied and become more than 50 in one area. The objects that are counted there are entities - mobs, dropped blocks/items, inscriptions on signs, items travelling in tubes, ...

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 15:14
by Daïmanu
No, this mod is not installed.

I didn't think it could come from a mod, I'll deactivate them one by one to see if it comes from one of them.

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 16:02
by Daïmanu
I noticed the error appeared in some precise areas.
When i deactivate signs_lib mod in homedecor modpack, the error doesn't appear anymore, and I see objects in pink, the text of the signs I presume.
They are not placed near to signs, but in places where I used worldedit to delete blocks.
These objects were not deleted and remained invisible, so I delete them, and now all works fine.

Still why does the error always mention the very same location, and what are those 50 objects?

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 17:45
by Krock
I don't know exactly but I guess the letters on signs count as objects, too.

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 18:11
by Sol
Krock wrote:I don't know exactly but I guess the letters on signs count as objects, too.

Text on signs is an entity. By the way, signs_lib is not causing problems with the objects, I checked.

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 18:17
by Sol
Daïmanu wrote:Recently, the server started to say frequently errors like:
ERROR[ServerThread]: ServerEnv: Trying to store id=498 statically but block (-20,0,-19) already contains 49 objects. Forcing delete.


You can try add logging for objects in l_env.cpp:
add this line:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#include "log.h"


and change the function to something like this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
int ModApiEnvMod::l_add_entity(lua_State *L)
{
   GET_ENV_PTR;

   // pos
   v3f pos = checkFloatPos(L, 1);
   // content
   const char *name = luaL_checkstring(L, 2);
   // Do it
   ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, "");
   int objectid = env->addActiveObject(obj);
   // If failed to add, return nothing (reads as nil)
   if(objectid == 0)
      return 0;
   // Return ObjectRef
   getScriptApiBase(L)->objectrefGetOrCreate(obj);
   // log
   actionstream<<"Server: add_entity "<<name<<" at "<<PP(pos/BS)<<std::endl;
   return 1;
}

Re: Server: Too many blocks

PostPosted: Thu Sep 11, 2014 18:30
by kaeza
Krock wrote:I don't know exactly but I guess the letters on signs count as objects, too.

No, the whole text is a single "canvas" overlaid on top of the sign node, so it counts as a single entity.

Still it could be worthwhile to add a function to the text entity to check every N seconds and remove itself if it's not on a sign node.

Re: Server: Too many blocks

PostPosted: Thu Sep 18, 2014 09:12
by mgl
Daïmanu wrote:Hi.

Recently, the server started to say frequently errors like:
ERROR[ServerThread]: ServerEnv: Trying to store id=498 statically but block (-20,0,-19) already contains 49 objects. Forcing delete.

or
ERROR[ServerThread]: suspiciously large amount of objects detected: 50 in (-20,0,-19); removing all of them.



I can consistently make these error messages appear with moretrees (default settings) and its dependancy lib plantlife_modpack:plants_lib as the only mods, and minetest from the git repository:

Create a new singleplayer world with these mods.
Teleport far away of the spawning area, like to 1500,_,1500.
Find a moretree tree and cut it down. Acacias and palm trees are the easiest.
Wait a minute for enough leaves to fall down as items.
Zone out.
Zone back in.

For trees with hundreds of leaves, you get the error messages (the two of them in 'debug.txt' and one of them on the screen) each time you zone out and back in. It's only a couple of times with an acacia.

The two error message "ERROR[ServerThread]: ServerEnv: Trying to store id..." and "ERROR[ServerThread]: suspiciously large amount of objects detected..." always tell about coordinates roughly in the range (-100 <= x <= 100, y = 0, -100 <= z <= 100). It's the spawning area from what I guess. They look wrong compared to where you really are.


Sol wrote:You can try add logging for objects in l_env.cpp:
add this line:
[...]

I did that. motretrees uses the function minetest.add_item(), which calls the lua function core.spawn_item(), which calls the c++ function l_add_entity() you quoted with "__builtin:item" as entity name, from what I quickly read in the code. The coordinates it reports in the log messages are the ones where the leaves really are though. Only the error messages from the server have them wrong.

I don't see it as a bug, that a moretree tree that you cut down creates a suspicious number of items. But there must be a bug somewhere because the server reports that in a place that seems so wrong.

Edit:
Or maybe the "block" coordinates displayed in the error messages are different from the player and entities positions ? Block coordinates are (x, y, z) integers while (x, y, z) positions are real numbers. The error messages may be right but look wrong because we think they tell about an (x, y, z) position like the player position while they tell about an (x, y, z) "block" position in the loaded area.

Re: Server: Too many blocks

PostPosted: Thu Sep 18, 2014 17:13
by Sokomine
mgl wrote:Wait a minute for enough leaves to fall down as items.

I'd say that's a BAD idea. Moretree trees have plenty of leaves. If you really let them drop down as items each, it's no wonder you'll run into too many items problems. That's also anything but good for the clients who have to draw them and for the server who has to take track of all these items.

If you really feel a need of having leaves as items floating around, and think that contributes in any obsucre way to gameplay, please at least reduce the number of leaves! Regarding moretrees, it might depend a bit on the type of tree. For a start, let them drop as items only with a probability of 1/100. Even that might be far too much.

Re: Server: Too many blocks

PostPosted: Thu Sep 18, 2014 18:01
by Sol
Sokomine wrote:If you really feel a need of having leaves as items floating around

That's the default behavior of current minetest_game. I guess it's not like anyone wanted this.

Re: Server: Too many blocks

PostPosted: Thu Sep 18, 2014 18:06
by Sokomine
Sol wrote:That's the default behavior of current minetest_game. I guess it's not like anyone wanted this.

Then that's something that ought to be changed back to the old behaviour. It's good that minetest_game is unfrozen again, but not every change might turn out to be good.

Re: Server: Too many blocks

PostPosted: Mon Sep 22, 2014 09:17
by ThatGraemeGuy
Daïmanu wrote:Hi.

Recently, the server started to say frequently errors like:
ERROR[ServerThread]: ServerEnv: Trying to store id=498 statically but block (-20,0,-19) already contains 49 objects. Forcing delete.

or
ERROR[ServerThread]: suspiciously large amount of objects detected: 50 in (-20,0,-19); removing all of them.


The problem is I never went in this location (-20, 0, -19) and it's a solo world. When I teleport to this place, the server generates the blocks, but there are not 50 blocks floating or something like that.

Is the written location wrong, or the server can't actually remove these blocks?

Any idea?

Edit: I'm using minetest 0.4.10-dev, but it seems to happen in 0.4.9 too.


The co-ordinates (-20, 0, -19) are those of MapBlocks. A MapBlock is a piece of map which comprises 16x16x16 nodes (nodes are the actual blocks that you can dig and place), so the co-ordinates you are looking for are approximately (-320, 0, -304), as you multiply by 16 for each.