env_meta error

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

env_meta error

by Miniontoby » Post

I got now every time when I going to make a ctf map this error

Code: Select all

2019-05-03 11:59:28: WARNING[Server]: Failed to write to file: ~\bin\..\worlds\ctf_mapmake\env_meta.txt
2019-05-03 11:59:28: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-03 11:59:28: ERROR[Server]: In thread 8:
2019-05-03 11:59:28: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta
Does anyone has a solution?
Last edited by Miniontoby on Fri May 10, 2019 12:13, edited 3 times in total.
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
ANAND
Member
Posts: 333
Joined: Sun Jan 28, 2018 12:54
GitHub: ClobberXD
IRC: ANAND ClobberXD
In-game: ANAND ClobberXD
Location: India
Contact:

Re: env_meta error

by ANAND » Post

Does this only happen when making a CTF map?

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

no, it had happened before
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
ANAND
Member
Posts: 333
Joined: Sun Jan 28, 2018 12:54
GitHub: ClobberXD
IRC: ANAND ClobberXD
In-game: ANAND ClobberXD
Location: India
Contact:

Re: env_meta error

by ANAND » Post

This seems to be a "SerializationError". The file is probably corrupted or inaccessible. Try deleting ~\bin\..\worlds\ctf_mapmake\env_meta.txt, and try again.

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

That doesn't work
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

Code: Select all

2019-03-23 10:27:32: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\youtube\env_meta.txt
2019-03-23 10:27:32: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-03-23 10:27:32: ERROR[Server]: In thread e:
2019-03-23 10:27:32: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta

Code: Select all

2019-05-10 12:55:51: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\youtube\env_meta.txt
2019-05-10 12:55:51: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-10 12:55:51: ERROR[Server]: In thread 15:
2019-05-10 12:55:51: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta

Code: Select all

2019-05-10 13:57:32: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\youtube\env_meta.txt
2019-05-10 13:57:32: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-10 13:57:32: ERROR[Server]: In thread 9:
2019-05-10 13:57:32: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta

Code: Select all

2019-05-10 12:55:51: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\youtube\env_meta.txt
2019-05-10 12:55:51: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-10 12:55:51: ERROR[Server]: In thread 14:
2019-05-10 12:55:51: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta

Code: Select all

2019-05-13 14:23:52: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\server_daconcepts.com_30000\env_meta.txt
2019-05-13 14:23:52: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-13 14:23:52: ERROR[Server]: In thread f:
2019-05-13 14:23:52: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta
I have got some more other errors (look at the all 3rd lines)
Last edited by Miniontoby on Mon Jun 03, 2019 15:11, edited 3 times in total.
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

This may well be another missing lock in the threading code. The temporary file that safeWriteToFile creates is not really thread-safe, it's just the original name with .~mt appended.

Please don't use multiple emerge threads.

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

Miniontoby wrote:

Code: Select all

/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta
What version is that? Line 74 doesn't make sense for such an error.

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

I have no idea??
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

You don't know what Minetest version you're using? o.O

User avatar
ANAND
Member
Posts: 333
Joined: Sun Jan 28, 2018 12:54
GitHub: ClobberXD
IRC: ANAND ClobberXD
In-game: ANAND ClobberXD
Location: India
Contact:

Re: env_meta error

by ANAND » Post

pgimeno: The error is actually here https://github.com/minetest/minetest/bl ... t.cpp#L657

I don't understand what this has to do with server.cpp:74, as it's only called in lines 283 and 989.

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

I use Minetest version 5.0.1
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

Does anyone has a solution????
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

ANAND wrote:pgimeno: The error is actually here https://github.com/minetest/minetest/bl ... t.cpp#L657

I don't understand what this has to do with server.cpp:74, as it's only called in lines 283 and 989.
Me neither. It enters there only when safeWriteToFile returns false. In turn, safeWriteToFile emits the warning and returns false when renaming the temporary file fails. https://github.com/minetest/minetest/bl ... ys.cpp#736

My hypothesis was that lack of locking was causing a race where the file was renamed by a thread and then another thread tried to rename it and failed (because the name of the temporary file is the same for all threads). However, on inspection, the only callers to saveMeta I've found are all in server.cpp, and they are protected with the same lock. The callers I've found are:

Destructor
AsyncRunStep()

As you can see, both have their locks in place.

I don't see how this can be diagnosed without the ability to reproduce the issue, add debug info and so on.

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

Miniontoby wrote:Does anyone has a solution????
Try setting num_emerge_threads = 1; that will probably solve it.

How many do you have currently? It looks like 20 or more because one of the threads that gave errors had ID 15h = 21.

User avatar
ANAND
Member
Posts: 333
Joined: Sun Jan 28, 2018 12:54
GitHub: ClobberXD
IRC: ANAND ClobberXD
In-game: ANAND ClobberXD
Location: India
Contact:

Re: env_meta error

by ANAND » Post

Ah, another num_emerge_threads quirk :)

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

I have set it (but it was already setted) and I try a world and get the error

Code: Select all

2019-05-12 15:21:53: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\server_daconcepts.com_30000\env_meta.txt
2019-05-12 15:21:53: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-12 15:21:53: ERROR[Server]: In thread 14:
2019-05-12 15:21:53: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

pgimeno wrote:
Miniontoby wrote:Does anyone has a solution????
Try setting num_emerge_threads = 1; that will probably solve it.

How many do you have currently? It looks like 20 or more because one of the threads that gave errors had ID 15h = 21.
Where do you found the "ID 15h = 21"???
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

Miniontoby wrote:I have set it (but it was already setted) and I try a world and get the error

Code: Select all

2019-05-12 15:21:53: WARNING[Server]: Failed to write to file: XXX\bin\..\worlds\server_daconcepts.com_30000\env_meta.txt
2019-05-12 15:21:53: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2019-05-12 15:21:53: ERROR[Server]: In thread 14:
2019-05-12 15:21:53: ERROR[Server]: /home/stefan/mt-build/build/minetest_64/minetest/src/server.cpp:74: run: A fatal error occurred: Couldn't save env meta
You don't seem to be setting it right

Sorry, I was wrong. The thread id is not the internal Minetest emerge thread id as I thought it was. It's the result of std::this_thread::get_id(), which can be something entirely different.
Last edited by pgimeno on Sun May 12, 2019 15:12, edited 1 time in total.

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

thanks for the convert hint, but I have no idea how that can.

I do now this script

Code: Select all

minetest.exe --worldname server_daconcepts.com_30000 --console --logfile XXX\serverdebug.txt 
Last edited by Miniontoby on Sun May 12, 2019 15:34, edited 1 time in total.
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

Edited my post, I was wrong, sorry.

Please try this. Using a terminal, change to the directory of your world, then type these:

Code: Select all

cp env_meta.txt env_meta.txt.~mt
mv env_meta.txt.~mt env_meta.txt
and report the output (or tell us if it succeeds).

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

When I start the world as a server it does do it
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

pgimeno wrote:Edited my post, I was wrong, sorry.

Please try this. Using a terminal, change to the directory of your world, then type these:

Code: Select all

cp env_meta.txt env_meta.txt.~mt
mv env_meta.txt.~mt env_meta.txt
and report the output (or tell us if it succeeds).
It does work (, I think)
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

pgimeno
Member
Posts: 16
Joined: Fri May 03, 2019 12:10
IRC: PGimeno
In-game: pgmine

Re: env_meta error

by pgimeno » Post

Miniontoby wrote:It does work (, I think)
That means that the problem is not in the file. For some reason the rename succeeds in the command line but it fails in the client. Without a client that can emit diagnostics (in particular the errno for the rename operation) I don't think anyone can do anything.

Do you think you can compile your own Minetest with this patch applied?

https://notabug.org/pgimeno/minetest/co ... 9f49.patch

For example, in my case, when I use chattr +i env_meta.txt, the patched version says:

Code: Select all

2019-05-13 18:09:09: WARNING[Server]: Failed to write to file: $MINETEST/bin/../worlds/carpastuff/env_meta.txt (error code: 1)
and error code 1 is EPERM (no permisson to write to the file).

User avatar
Miniontoby
Member
Posts: 436
Joined: Fri Mar 01, 2019 19:25
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: env_meta error

by Miniontoby » Post

I have Windows 10 and I think I can't compile it. Do you have option??
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell" Vote your gang

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests