Server: Too many blocks

Post Reply
Daïmanu
Member
Posts: 12
Joined: Tue Feb 04, 2014 21:48

Server: Too many blocks

by Daïmanu » Post

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.

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Server: Too many blocks

by Sokomine » Post

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, ...
A list of my mods can be found here.

Daïmanu
Member
Posts: 12
Joined: Tue Feb 04, 2014 21:48

Re: Server: Too many blocks

by Daïmanu » Post

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.

Daïmanu
Member
Posts: 12
Joined: Tue Feb 04, 2014 21:48

Re: Server: Too many blocks

by Daïmanu » Post

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?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Server: Too many blocks

by Krock » Post

I don't know exactly but I guess the letters on signs count as objects, too.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sol
Member
Posts: 73
Joined: Thu Jul 31, 2014 05:21
In-game: sol

Re: Server: Too many blocks

by Sol » Post

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.
There is no such thing as duty. If you know that a thing is right, you want to do it. If you don't want to do it—it isn't right. If it's right and you don't want to do it—you don't know what right is and you're not a man. -- Ayn Rand

Sol
Member
Posts: 73
Joined: Thu Jul 31, 2014 05:21
In-game: sol

Re: Server: Too many blocks

by Sol » Post

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:

Code: Select all

#include "log.h"
and change the function to something like this:

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;
}
There is no such thing as duty. If you know that a thing is right, you want to do it. If you don't want to do it—it isn't right. If it's right and you don't want to do it—you don't know what right is and you're not a man. -- Ayn Rand

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: Server: Too many blocks

by kaeza » Post

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.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

mgl
Member
Posts: 39
Joined: Wed Sep 10, 2014 16:13
GitHub: mgl512
Location: France

Re: Server: Too many blocks

by mgl » Post

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.

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Server: Too many blocks

by Sokomine » Post

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.
A list of my mods can be found here.

Sol
Member
Posts: 73
Joined: Thu Jul 31, 2014 05:21
In-game: sol

Re: Server: Too many blocks

by Sol » Post

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.
There is no such thing as duty. If you know that a thing is right, you want to do it. If you don't want to do it—it isn't right. If it's right and you don't want to do it—you don't know what right is and you're not a man. -- Ayn Rand

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Server: Too many blocks

by Sokomine » Post

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.
A list of my mods can be found here.

ThatGraemeGuy
Member
Posts: 139
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy
Location: Cape Town, South Africa

Re: Server: Too many blocks

by ThatGraemeGuy » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests