Need help figuring out a server bug.

My server will sometimes time out with this error every so often.

Error: https://pastebin.com/n2zA23Wu
Entire Log: [redacted]

I was wondering if anyone knew a fix for it. I think it either has to do with saving playerdata or something with nbt tags? I am not so sure. My only guess is viaversion is causing some problems with entities.

Update:
So we think it is a resource issue. If that is the case would there be anything wrong with my start.sh settings?
https://pastebin.com/upLunEfe

I believe the issue to be related to the write speeds of the Hdd I will replace my server hdd with an ssd and post the results here. Here are some things I tried that you can try if you have a similar issue.

-make sure the user that is running the server has read and write permissions to all server files.

-do not mix ram, ensure your ram is fast enough.

-do not over allocate ram to server, make sure to leave your computer has enough ram to run OS processes

-ensure there is enough storage on the drive

-ensure sata cable to hdd/ssd has a high enough bandwidth.

-make sure no other processes on the computer are writing and reading large sums of data while your server is running.

-replace hdd with ssd if the problem persists

Final update: Yep, switching to an ssd completely solved the issue. If you still need to use an hdd try dedicating a sole hdd to the Minecraft server with no other processes reading or writing to it. I had the OS, a website, two servers (a lobby and a main server), and a dynmap running on one hdd which created a bandwidth shortage. Which caused the errors and the general sluggishness of the mc server. Thanks to everyone who helped solve my problem it is greatly appreciated 🙏.