debkbanerji / minecraft-bedrock-server

Powerful, easy to use Minecraft Bedrock Server with UI, automatic cloud backups, and version control
MIT License
57 stars 23 forks source link

[Bug] 1.20 causes "A previous save has not been completed" error in log #10

Closed nick-canale closed 10 months ago

nick-canale commented 1 year ago

Bug Description Log shows "ERROR] A previous save has not been completed" over and over again

To Reproduce Steps to reproduce the behavior:

  1. run app with 1.20 version of minecraft server
  2. look at logs in terminal window

Expected behavior This message shouldn't show up, bogs down real messages

Additional context I am not a very good developer, but I was able to debug this and figure out what the problem is... I just don't know how to fix it.

In your code it looks like you're looking for this string and ignoring it:

bs.stdout.on("data", async data => { if ( /^(A previous save has not been completed\.|Saving\.\.\.|Changes to the level are resumed\.)/i.test( data ) ) {

However, now the process seems to be "batching" the data output so instead of one line, you get two. For example:

Line1: [2023-06-15 20:34:14:881 ERROR Line2: ] A previous save has not been completed.

or even worse

Line1: [2023-06-15 20:34:14:881 ERROR] A previous save has not been completed Line2: .

I'm not a skilled enough dev to know how to code "capture all messages, combine them, and then look at that". I don't know javascript (I'm really good at SQL and just OK with Python) nor have I really worked with async processes before. I think this will be a super easy fix :)

thank you!

nick-canale commented 1 year ago

I tried editing the regex to get rid of most of them but now my log looks like this, lol: image

debkbanerji commented 10 months ago

This was a headache to fix, but should be dealt with. Basically, in the newest version, we manually read the data into a buffer, then pass along the line only when a newline is produced by the bedrock server.