GT New Horizons

GT New Horizons

867k Downloads

backup fails to follow `max_folder_size` under serverutilities.cfg

Philosyang opened this issue ยท 5 comments

commented

Your GTNH Discord Username

No response

Your Pack Version

2.7.1
edit: reproduced with a fresh 2.7.2

Your Server

private server

Java Version

Java 21

Type of Server

None

Your Expectation

I hosted the modpack's server files on a virtual private server since 2.6.1; I performed updates manually to 2.7.1.

There were no backup tasks running by default when I was playing on 2.6.1, nor did I care.
After the update to 2.7.1, I noticed the backup text appearing in game (i.e., backups running) and decided to change the frequency as well as the maximum size of the backups.


  1. I stopped the server.
  2. I confirmed that the ./backups/ folder has fewer than 1200 backups and fewer than 50GB of contents.
  3. I made modifications to the backups section of the ./serverutilities/serverutilities.cfg like this:
backups {
    # Path to backups folder. [default: ./backups/]
    S:backup_folder_path=./backups/

    # Time between backups in hours. 
    # 1.0 - backups every hour 6.0 - backups every 6 hours 0.5 - backups every 30 minutes. [range: 0.0 ~ 1.7976931348623157E308, default: 0.5]
    S:backup_timer=0.05

    # Number of backup files to keep before deleting old ones. [range: 1 ~ 2147483647, default: 12]
    I:backups_to_keep=1200

    # How much the backup file will be compressed. 0 - uncompressed, 1 - best speed, 9 - smallest file size. [range: 0 ~ 9, default: 1]
    I:compression_level=1

    # Delete backups that have a custom name set through /backup start <name> [default: true]
    B:delete_custom_name_backups=true

    # Prints (current size | total size) when backup is done [default: true]
    B:display_file_size=true

    # Enables backups. [default: true]
    B:enable_backups=true

    # Max size of backup folder in GB. If total folder size exceeds this value it will delete old backups until the size is under.
    # 0 = Disabled and backups_to_keep will be used instead. [range: 0 ~ 2147483647, default: 0]
    I:max_folder_size=50

    # Backups won't run if no players are online. [default: true]
    B:need_online_players=true

    # Only include claimed chunks in backup.
    # Backups will be much faster and smaller, but any unclaimed chunk will be unrecoverable. [default: false]
    B:only_backup_claimed_chunks=false

    # Silence backup notifications. [default: false]
    B:silent_backup=false

    # Run backup in a separated thread (recommended) [default: true]
    B:use_separate_thread=true
}
  1. I expect the modpack to keep the ./backups/ folder under 50GB.

The Reality

  1. In-game text tells me that the total backup size is over 65GB, and eventually printing java errors in the chat because of insufficient disk space on the server.
  2. I manually shut down the server, removed some of the older backups manually so that the backups folder has fewer than 1200 backups and fewer than 50GB of contents, and starts the server again.
  3. Eventually the backup size went over 50GB again.

Your Proposal

Backups should follow the max_folder_size constraint.

I might create and try to reproduce this issue on a fresh 2.7.2 server later; no reproducing efforts were made till the submission of this issue.

Final Checklist

  • I have searched this issue tracker and there is nothing similar already. Posting on a closed issue saying the bug still exists will prompt us to investigate and reopen it once we confirm your report.
  • I can reproduce this problem consistently by follow the exact steps I described above, or this does not need reproducing, e.g. recipe loophole.
  • I have asked other people and they confirm they also have this problem by follow the exact steps I described above, or this does not need reproducing, e.g. recipe loophole.
commented

It can exceed that size while writing a backup but old backups will be deleted afterwards to bring it back down. If you are close to running out of disc space I would suggest setting that number lower or using claims-only backups.

commented

It can exceed that size while writing a backup but old backups will be deleted afterwards to bring it back down. If you are close to running out of disc space I would suggest setting that number lower or using claims-only backups.

Good call.
To clarify, my backup is sitting at around 400MB per zip, thus 15GB over threshold to me is odd.
I will later try to reproduce with a fresh 2.7.2 to better locate on the problem.

commented

I have created a new 2.7.2 dedicated server and has successfully reproduced the issue, thus I will retroactively tick the check mark in the initial checklist.

The config has these parameters:

backups {
    # Path to backups folder. [default: ./backups/]
    S:backup_folder_path=./backups/

    # Time between backups in hours. 
    # 1.0 - backups every hour 6.0 - backups every 6 hours 0.5 - backups every 30 minutes. [range: 0.0 ~ 1.7976931348623157E308, default: 0.5]
    S:backup_timer=0.01

    # Number of backup files to keep before deleting old ones. [range: 1 ~ 2147483647, default: 12]
    I:backups_to_keep=1200

    # How much the backup file will be compressed. 0 - uncompressed, 1 - best speed, 9 - smallest file size. [range: 0 ~ 9, default: 1]
    I:compression_level=1

    # Delete backups that have a custom name set through /backup start <name> [default: true]
    B:delete_custom_name_backups=true

    # Prints (current size | total size) when backup is done [default: true]
    B:display_file_size=true

    # Enables backups. [default: true]
    B:enable_backups=true

    # Max size of backup folder in GB. If total folder size exceeds this value it will delete old backups until the size is under.
    # 0 = Disabled and backups_to_keep will be used instead. [range: 0 ~ 2147483647, default: 0]
    I:max_folder_size=1

    # Backups won't run if no players are online. [default: true]
    B:need_online_players=false

    # Only include claimed chunks in backup.
    # Backups will be much faster and smaller, but any unclaimed chunk will be unrecoverable. [default: false]
    B:only_backup_claimed_chunks=false

    # Silence backup notifications. [default: false]
    B:silent_backup=false

    # Run backup in a separated thread (recommended) [default: true]
    B:use_separate_thread=true
}
commented

Can you attach the server log?
fml-server-latest.log

commented

Can you attach the server log? fml-server-latest.log

This is a log from my 2.7.1 server. I used backup_timer=0.01, backups_to_keep=1200, max_folder_size=1, and need_online_players=false.

https://gist.github.com/Philosyang/8968759f745be60fd8667b3bc044449e


image