An unhandled exception occurred: Couldn't save env meta

Post Reply
Damned
Member
Posts: 23
Joined: Sun Sep 25, 2016 03:48

An unhandled exception occurred: Couldn't save env meta

by Damned » Post

Server on Vista 32bit running Minetest 32bit version 4.14 or 4.15
To start with everything fine, it can run for days, real time not game time, with no problems, then after a while, maybe 2 weeks it just starts crashing with the same error. It can be anything between a few seconds and a couple of hours.
I've read through some of the other, similar posts, and followed the advice, but I still constantly get crashes. I don't even have to do anything. Just start up the server and after a while it will crash with the same error as shown in the below 2 examples.

2017-01-28 04:57:52: ACTION[Main]: .__ __ __
2017-01-28 04:57:52: ACTION[Main]: _____ |__| ____ _____/ |_ ____ _______/ |_
2017-01-28 04:57:52: ACTION[Main]: / \| |/ \_/ __ \ __\/ __ \ / ___/\ __\
2017-01-28 04:57:52: ACTION[Main]: | Y Y \ | | \ ___/| | \ ___/ \___ \ | |
2017-01-28 04:57:52: ACTION[Main]: |__|_| /__|___| /\___ >__| \___ >____ > |__|
2017-01-28 04:57:52: ACTION[Main]: \/ \/ \/ \/ \/
2017-01-28 04:57:52: ACTION[Main]: World at [C:\Users\HT\Desktop\Minetest Server\bin\..\worlds\NewWorld]
2017-01-28 04:57:52: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30000.
2017-01-28 04:57:52: ACTION[Server]: [Biome Lib] Registered a total of 5 surface types to be evaluated, spread
2017-01-28 04:57:52: ACTION[Server]: [Biome Lib] across 19 actions with air-checking and 0 actions without.
2017-01-28 06:01:25: WARNING[Server]: Failed to write to file: C:\Users\HT\Desktop\Minetest Server\bin\..\worlds\NewWorld\env_meta.txt
2017-01-28 06:01:25: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2017-01-28 06:01:25: ERROR[Server]: In thread 18d0:
2017-01-28 06:01:25: ERROR[Server]: /home/stefan/mt-build/build/minetest/minetest/src/server.cpp:73: run: A fatal error occured: Couldn't save env meta
2017-01-28 06:01:25: ERROR[Server]: Debug stacks:
2017-01-28 06:01:25: ERROR[Server]: DEBUG STACK FOR THREAD 18d0:
2017-01-28 06:01:25: ERROR[Server]: #0 run
2017-01-28 06:01:25: ERROR[Server]: DEBUG STACK FOR THREAD 1ba8:
2017-01-28 06:01:25: ERROR[Server]: #0 run
2017-01-28 06:01:25: ERROR[Server]: DEBUG STACK FOR THREAD 1ea8:
2017-01-28 06:01:25: ERROR[Server]: #0 main
2017-01-28 06:01:25: ERROR[Server]: #1 Dedicated server branch
2017-01-28 06:01:25: ERROR[Server]: #2 dedicated_server_loop



2017-01-31 02:32:59: ACTION[Main]: .__ __ __
2017-01-31 02:32:59: ACTION[Main]: _____ |__| ____ _____/ |_ ____ _______/ |_
2017-01-31 02:32:59: ACTION[Main]: / \| |/ \_/ __ \ __\/ __ \ / ___/\ __\
2017-01-31 02:32:59: ACTION[Main]: | Y Y \ | | \ ___/| | \ ___/ \___ \ | |
2017-01-31 02:32:59: ACTION[Main]: |__|_| /__|___| /\___ >__| \___ >____ > |__|
2017-01-31 02:32:59: ACTION[Main]: \/ \/ \/ \/ \/
2017-01-31 02:32:59: ACTION[Main]: World at [C:\Users\HT\Desktop\Minetest Server\bin\..\worlds\NewWorld]
2017-01-31 02:32:59: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30000.
2017-01-31 02:32:59: ACTION[Server]: [Biome Lib] Registered a total of 5 surface types to be evaluated, spread
2017-01-31 02:32:59: ACTION[Server]: [Biome Lib] across 19 actions with air-checking and 0 actions without.
2017-01-31 03:20:19: WARNING[Server]: Failed to write to file: C:\Users\HT\Desktop\Minetest Server\bin\..\worlds\NewWorld\env_meta.txt
2017-01-31 03:20:19: ERROR[Server]: An unhandled exception occurred: Couldn't save env meta
2017-01-31 03:20:19: ERROR[Server]: In thread 448:
2017-01-31 03:20:19: ERROR[Server]: /home/stefan/mt-build/build/minetest/minetest/src/server.cpp:73: run: A fatal error occured: Couldn't save env meta
2017-01-31 03:20:19: ERROR[Server]: Debug stacks:
2017-01-31 03:20:19: ERROR[Server]: DEBUG STACK FOR THREAD 424:
2017-01-31 03:20:19: ERROR[Server]: #0 run
2017-01-31 03:20:19: ERROR[Server]: DEBUG STACK FOR THREAD 448:
2017-01-31 03:20:19: ERROR[Server]: #0 run
2017-01-31 03:20:19: ERROR[Server]: DEBUG STACK FOR THREAD 156c:
2017-01-31 03:20:19: ERROR[Server]: #0 main
2017-01-31 03:20:19: ERROR[Server]: #1 Dedicated server branch
2017-01-31 03:20:19: ERROR[Server]: #2 dedicated_server_loop


I don't know how often it's suppose to write this file, but everytime I check in the world folder there is an env_meta.txt file dated and timed at the same time as it supposed to have not been able to write the file.

This is the contents from env_meta.txt written at 03:20 after the last crash. I'd already changed the day_count back to 1 after previously changing the game_time to 100.

day_count = 2
game_time = 6456
last_clear_objects_time = 0
lbm_introduction_times = :doors:replace_castle_jail_door~0;:doors:replace_castle_oak_door~0;:doors:replace_doors_door_glass~0;:doors:replace_doors_door_obsidian_glass~0;:doors:replace_doors_door_steel~0;:doors:replace_doors_door_wood~0;:doors:replace_doors_japanese_door~0;:doors:replace_doors_prison_door~0;:doors:replace_doors_rusty_prison_door~0;:doors:replace_doors_screen_door~0;:doors:replace_doors_slide_door~0;:doors:replace_doors_woodglass_door~0;:doors:replace_my_castle_doors_door10~0;:doors:replace_my_castle_doors_door11~0;:doors:replace_my_castle_doors_door12~0;:doors:replace_my_castle_doors_door13~0;:doors:replace_my_castle_doors_door1_locked~0;:doors:replace_my_castle_doors_door2_locked~0;:doors:replace_my_castle_doors_door3~0;:doors:replace_my_castle_doors_door4~0;:doors:replace_my_castle_doors_door5~0;:doors:replace_my_castle_doors_door6_locked~0;:doors:replace_my_castle_doors_door7_locked~0;:doors:replace_my_castle_doors_door8_locked~0;:doors:replace_my_castle_doors_door9~0;:doors:replace_my_cottage_doors_door1_locked~0;:doors:replace_my_cottage_doors_door2~0;:doors:replace_my_default_doors_door1_locked~0;:doors:replace_my_default_doors_door2_locked~0;:doors:replace_my_default_doors_door3_locked~0;:doors:replace_my_default_doors_door4_locked~0;:doors:replace_my_default_doors_door5_locked~0;:doors:replace_my_fancy_doors_door1_locked~0;:doors:replace_my_fancy_doors_door2~0;:doors:replace_my_fancy_doors_door3~0;:doors:replace_my_fancy_doors_door4_locked~0;:doors:replace_my_fancy_doors_door5_locked~0;:doors:replace_my_fancy_doors_door6_locked~0;:doors:replace_my_fancy_doors_door7_locked~0;:doors:replace_my_fancy_doors_door8_locked~0;:doors:replace_my_hidden_doors_hidden_door_grey~0;:doors:replace_my_hidden_doors_hidden_doorbookshelf~0;:doors:replace_my_hidden_doors_hidden_doorbrick~0;:doors:replace_my_hidden_doors_hidden_doorchest~0;:doors:replace_my_hidden_doors_hidden_doorcobble~0;:doors:replace_my_hidden_doors_hidden_doordesert_cobble~0;:doors:replace_my_hidden_doors_hidden_doorfurnace~0;:doors:replace_my_hidden_doors_hidden_doorstone~0;:doors:replace_my_hidden_doors_hidden_doorstone_brick~0;:doors:replace_my_hidden_doors_hidden_doorwood~0;:doors:replace_my_misc_doors_door1~0;:doors:replace_my_misc_doors_door2~0;:doors:replace_my_misc_doors_door3_locked~0;:doors:replace_my_misc_doors_door4_locked~0;:doors:replace_my_misc_doors_door5~0;:doors:replace_my_old_doors_door1_locked~0;:doors:replace_my_old_doors_door2_locked~0;:doors:replace_my_old_doors_door3_locked~0;:doors:replace_my_old_doors_door4_locked~0;moretrees:convert_existing_cocos_palms_to_regrow_coconuts~0;moretrees:restart_coconut_regrow_timer~0;moretrees:restart_dates_regrow_timer~0;torches:convert_wallmounted~0;advtrains:ramp_replacement_1~5925942;advtrains:st_rep_1~5925942;default:3dtorch~6109597;default:convert_saplings_to_node_timer~6109597;xpanes:gen2~6109597;
lbm_introduction_times_version = 1
time_of_day = 1861
EnvArgsEnd

If anyone could offer some advice it would be well recieved.

helpless
Member
Posts: 72
Joined: Thu Jan 12, 2017 21:51
In-game: helpless
Contact:

Re: An unhandled exception occurred: Couldn't save env meta

by helpless » Post

Okay, so for one, Vista is the slowest, glitchiest version of windows you can get. Try rebooting your computer, and running task manager for background processes that may be using your RAM up.

User avatar
DI3HARD139
Member
Posts: 154
Joined: Sat Oct 18, 2014 21:04
GitHub: DI3HARD139
IRC: DI3HARD139
In-game: DI3HARD139 DI3HARD139_

Re: An unhandled exception occurred: Couldn't save env meta

by DI3HARD139 » Post

Check that the file isn't flagged as read only. Try re-creating the file manually by copy-pasting into a new env_meta.txt file. Minetest is horrible at making certain that the files aren't currently being read/written to before modifying so things can get corrupted very quickly. auth.txt is a perfect example of this issue.

Damned
Member
Posts: 23
Joined: Sun Sep 25, 2016 03:48

Re: An unhandled exception occurred: Couldn't save env meta

by Damned » Post

I've spent a few weeks monitoring what's happening, and I can't see any obvious cause for the crashing.
helpless wrote:Okay, so for one, Vista is the slowest, glitchiest version of windows you can get. Try rebooting your computer, and running task manager for background processes that may be using your RAM up.
For me Vista has been the most stable and reliable version of windows I've ever used. The only times I've had a blue screen is when there really was a problem, unlike 7.

Watched background task and memory, no problems with either. Run the server while also watching HD video and downloading files and transfering files between pcs with no problem. Rebooting doesn't always work as you'd expect. Sometimes it will start crashing right after a reboot, other times it will be days.
DI3HARD139 wrote:Check that the file isn't flagged as read only. Try re-creating the file manually by copy-pasting into a new env_meta.txt file. Minetest is horrible at making certain that the files aren't currently being read/written to before modifying so things can get corrupted very quickly. auth.txt is a perfect example of this issue.
Checked the files and folders to make sure they're not read only and they're not.

It could be as you say, a read/write issue. Trying to save it while still open. There's never any corruption of the file though.

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: An unhandled exception occurred: Couldn't save env meta

by sorcerykid » Post

From what I can discern saveMeta( ) in environment.cpp, relies on the fs::safeWriteToFile( ) method, which creates a temporary file for writing. Here is the warning that is included within the comments of that method regarding potential failure points under Windows OS.
Move the finished temporary file over the real file

When creating the file, it can cause Windows Search indexer, virus scanners and other apps to query the file. This can make the move file call below fail. We retry up to 5 times, with a 1ms sleep between, before we consider the whole operation failed
So I would try disabling virus scanners, search indexing, or anything else that analyzes the file system in real time.

BBmine
Member
Posts: 3476
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: An unhandled exception occurred: Couldn't save env meta

by BBmine » Post

sorcerykid wrote:So I would try disabling virus scanners, search indexing, or anything else that analyzes the file system in real time.
Wouldn't that be insecure?

IMHO, Windows is horrible. Linux would probably do better.

Damned
Member
Posts: 23
Joined: Sun Sep 25, 2016 03:48

Re: An unhandled exception occurred: Couldn't save env meta

by Damned » Post

I'd already got an exception in the virus scanner for the minetest folder. It would depend on where the tempory file is located. If it's in the default temp folder, then that's one place that shouldn't be exempt from a scanner. If it's done in the minetest folder then it shouldn't be the scanner causing the problem. I did find that the indexer was active so I've disabled that and I'll see how it goes. Currently it's been running for 4 days without crashing so no doubt as soon as I post this it will crash, but I'll see.

Damned
Member
Posts: 23
Joined: Sun Sep 25, 2016 03:48

Re: An unhandled exception occurred: Couldn't save env meta

by Damned » Post

3 Weeks with not a single crash. Does look like it was the windows indexing service that was the problem.

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

Re: An unhandled exception occurred: Couldn't save env meta

by Miniontoby » Post

I know what the "In thread 18d0:" means, It means that there are "6352" threads that are writing to the "env_meta" file and that means that "6351" threads can do it good and the "6352" thread faild and the "In thread 448:" means that there are "1096" threads writing

And I have also a env_meta error topic viewtopic.php?f=6&t=22341 and check also this viewtopic.php?f=6&t=22341&start=25#p348625

P.S. the thread number is a Heximal number and I convert it to a decimal number
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests