IntellectualSites / IntellectualSites/PlotSquared

Handle invalid config entries gracefully

Open
#3,434 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
Java
Stars
653
Forks
975
Avg merge
2m
Merged PRs (30d)
6

Description

Server Implementation

Paper

Server Version

1.17.1

Describe the bug

Setting a negative value for max-tiles in the chunk processor causes a massive amount of console spam and seems to delete all tile entities in loaded chunks.

To Reproduce
  1. Place some chests in a chunk
  2. Enable chunk processor and set max-tiles to -1
  3. Restart server and join
  4. Chests are gone and massive console spam
Expected behaviour

At the very least, not spam the console and not delete blocks.

Screenshots / Videos

No response

Error log (if applicable)

https://paste.gg/p/anonymous/fe62defc051e457e95f59f5c29e9bef1

Plot Debugpaste

https://athion.net/ISPaster/paste/view/e45b3c123ebb475c80f7f18063589926

PlotSquared Version

6.2.3-SNAPSHOT

Checklist
Anything else?

Scared the crap out of me and I terminated the server as soon as I saw it so that none of the chunks would save in this state. This also happened on version 6.1.5, which I updated to the latest version (6.2.3) and tested again for this report. Results were the same. The provided error log is just the single error, as far as I can tell this is the only one but it spammed thousands of lines per second. I anticipated this would disable the check for tile entities in the chunk processor. I am using a different plugin (Insights) for block entity limits, which I disabled, so it is not interfering with PS and didn't cause this bug. If negative values simply can't be supported, it would be at least be nice if doing so anyway wouldn't delete blocks and just disable the processor. I really think that it should be supported as an "uncapped" limit though, as I want to use the max-entities limit but have an uncapped max-tiles limit. I am unsure if any value below 1 would have the same result, I just know that -1 does.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the chunk processor entry point that handles the max-tiles configuration, then reproduce the issue with max-tiles set to -1 using the listed reproduction steps. Done means invalid values no longer produce console spam or delete tile entities, with behavior checked against the supplied error log.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.