mietechnologies / MieMCServer

This is a Minecraft Server maintenance program. It is a grouping of scripts and shell commands to help run and maintain a schedule for your server.
Other
2 stars 0 forks source link

Backups are not being performed #81

Open BAChapin opened 2 years ago

BAChapin commented 2 years ago

Investigation is required!

I just checked the server, out of curiosity, to see if there were any backups. The directory has not been made (which that functionality should have been added), and the according to CronTab there is a task to run the backup script.

Michaelcraun commented 2 years ago

I'm not sure what's going on with this... I've tried:

  1. Creating a backup on my macOS machine
  2. Creating a backup on the dev profile of the actual server
  3. Creating a backup on my RasPi

All instances were tested by copying the code that should be executed when the backup function is called to run_debug and giving it a go. All instances were successful.

Michaelcraun commented 2 years ago

Perhaps the issue lies in CronTab itself?

Michaelcraun commented 2 years ago

Actually, I think there may be something even deeper than that. Nothing has been added to log.txt since 2/19...

Michaelcraun commented 2 years ago

NOTE: When I manually execute these commands (-k, -bu), the logs are updated accordingly.

Michaelcraun commented 2 years ago

This leads me to believe that there may be something wrong with our CronTab configuration (either in the project or on the actual server).

BAChapin commented 2 years ago

Well, I will certainly look into the crontab list to see if there is anything weird in there. But I do have to point out, backups stopped working with our previous server as well. If you remember you noticed that there weren't any recent backups. Nothing with the CronTab system would have changed on that server. Well, nothing except the oddball restart that caused the Raspberry Pi job to be added. I have only 1 theory as to what could be causing the issue, I'll check into it and get back with you.

BAChapin commented 2 years ago

Okay, so my theory didn't pan out, at least I don't think it does. So, my theory was, maybe the change started taking place when we updated the system with the username fetching capabilities. It was added to the codebase 11 days ago, but we didn't update to the version with those changes until like, right before the server got switched.

Michaelcraun commented 2 years ago

Yeah, it's gotta be something surrounding the scheduler. As above, when I execute these commands manually, they run absolutely fine.

Michaelcraun commented 2 years ago

Fyi, I did not try executing the exact commands listed in your cron (as it would on the schedule). I simply used python main.py ....

Michaelcraun commented 2 years ago
bachapin@MIEServer:~$ python3 /home/bachapin/MIE-MCServer/main.py --backup
Traceback (most recent call last):
  File "/home/bachapin/MIE-MCServer/main.py", line 20, in <module>
    from util.backup import Backup
  File "/home/bachapin/MIE-MCServer/util/backup.py", line 4, in <module>
    from .configuration import Maintenance
  File "/home/bachapin/MIE-MCServer/util/configuration.py", line 1, in <module>
    from .mielib import custominput as ci
  File "/home/bachapin/MIE-MCServer/util/mielib/custominput.py", line 5, in <module>
    from util.cron import CronDate, CronFrequency
  File "/home/bachapin/MIE-MCServer/util/cron.py", line 3, in <module>
    from util.date import Date
  File "/home/bachapin/MIE-MCServer/util/date.py", line 2, in <module>
    from .extension import string_contains, stringContainsAnyCase
  File "/home/bachapin/MIE-MCServer/util/extension.py", line 3, in <module>
    def cleanString(haystack: str, needles: list[str]) -> str:
TypeError: 'type' object is not subscriptable
Michaelcraun commented 2 years ago
bachapin@MIEServer:~$ python3 /home/bachapin/MIE-MCServer/main.py --clean
Traceback (most recent call last):
  File "/home/bachapin/MIE-MCServer/main.py", line 20, in <module>
    from util.backup import Backup
  File "/home/bachapin/MIE-MCServer/util/backup.py", line 4, in <module>
    from .configuration import Maintenance
  File "/home/bachapin/MIE-MCServer/util/configuration.py", line 1, in <module>
    from .mielib import custominput as ci
  File "/home/bachapin/MIE-MCServer/util/mielib/custominput.py", line 5, in <module>
    from util.cron import CronDate, CronFrequency
  File "/home/bachapin/MIE-MCServer/util/cron.py", line 3, in <module>
    from util.date import Date
  File "/home/bachapin/MIE-MCServer/util/date.py", line 2, in <module>
    from .extension import string_contains, stringContainsAnyCase
  File "/home/bachapin/MIE-MCServer/util/extension.py", line 3, in <module>
    def cleanString(haystack: str, needles: list[str]) -> str:
TypeError: 'type' object is not subscriptable