Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A couple of safe modes with mysql and deleted towns that didn't delete #4170

Closed
Momshroom opened this issue Jul 15, 2020 · 3 comments
Closed

Comments

@Momshroom
Copy link
Contributor

What steps will reproduce the problem?

  1. Town gets deleted.
  2. wait a while (not positive, but I think my safemodes are almost always when it's not a short time between the town deletion and the restart)
  3. restart server
  4. get safe mode

What is the expected output?

  1. Towny comes up normally and the towns are gone.

Okay: what happened:
The mayor of Bethlehem (Question11) deleted his town with /t delete.

At the next restart the server went into safe mode with this error:
https://paste.gg/p/Momshroom/8ad07bc58da34ad28300b92f0ac25d5d

At that time, the mysql entry for Bethlehem was this:
https://paste.gg/p/Momshroom/52b76de921fb41a3a3a6abe190cfe980
(note that Question11 was no longer listed as mayor, one of his old assistants is. Question is a fairly active player and was not deleted: he just moved to a different town.)
For reference of what the town likely looked like before it was deleted, here's its mysql table entry from my test server:
https://paste.gg/p/Momshroom/cd821d732a734adc803cfce6686f08ff

I deleted Bethlehem from the town table, then restarted.

MiBoi5's town, Dark_Room, had been deleted due to lack of funds sometime in the same period as Bethlehem was deleted and once we fixed Bethlehem, Dark_Room caused its own safe mode:

Dark_Room's safe mode error:
https://paste.gg/p/Momshroom/72eee1570a974dd6bdc1bdf46a9bae0e
Dark_Room's town table entry before fixing:
https://paste.gg/p/Momshroom/cef48981648d4062bba3a311f749fb97
Reference of what Dark_Room's mysql likely looked like before it was deleted, from my test server:
https://paste.gg/p/Momshroom/6cee89db982841e7833343e96554a728

Deleting Dark_Room from the town table and restarting fixed the error and we loaded fine.

What is your Towny version?

Do not say "latest".

0.96.2.3

What is your spigot/craftbukkit version?

Do not say "latest".

Paper-89 (1.16.1)

Please use Pastebin.com to link the following files:

Skipping these files is not an option. It is the easiest way to diagnose an issue ticket properly. If you do skip this step then your ticket will most likely be deleted and you will be asked to resubmit.

  1. Your full server startup from the logs\latest.log :
    https://paste.gg/p/Momshroom/2f29d59c511c4e0a8dbc88223be4b207

  2. Your Towny config.yml (if using MySQL please remove password,) :
    https://paste.gg/p/Momshroom/5092b9f0aefe4b02af61f8df84be756f

  3. Your townyperms.yml :
    really not relevant here. (if you need it, I'll happily go make a paste, but I can't imagine you do)

  4. Your log's error :
    errors above in the explanation.

@Momshroom Momshroom added the bug label Jul 15, 2020
@LlmDl
Copy link
Member

LlmDl commented Jul 15, 2020

The first one says 'gcnner' is not registered which should probably mean that he has no resident column, is that the case?
The way the table looks, it looks like Question gave the town to gcnner instead of deleting it.

The 2nd one looks like the same issue from the previous ticket.

@Momshroom
Copy link
Contributor Author

Yes, but I've confirmed with both Question himself and online witnesses that Question deleted the town. Gcnner is on the assistant list. I assume he's major due to towny inheritance. I could search the logs if it would help.

@Momshroom
Copy link
Contributor Author

Also, Bethlehem is no longer in a nation (It was in Arkhalis) and no longer has a spawn set, both of which I see on my failed deletions.
As expected, gcnner isn't in the resident database.

LlmDl added a commit that referenced this issue Jul 25, 2020
If a town attempts to set a mayor who is not part of the town, and the
town has no residents, the town will be deleted.
  - Closes #4170.
@LlmDl LlmDl closed this as completed in 9214200 Aug 21, 2020
@LlmDl LlmDl added this to the 0.96.3.0 milestone Aug 21, 2020
LlmDl added a commit that referenced this issue Aug 21, 2020
    - Removes towns.txt and nations.txt files on flatfile databases.
      - Loads old towns.txt and nations.txt to ensure that orphaned
files in the
        towns & nations folders are not loaded. If successfully loaded,
the
        towns.txt and nations.txt files are deleted.
    - Residents now store their Town, and Towns do not store their
Residents.
    - Towns now store their Nation, and Nations do not store their
Towns.
    - Towny now handles loading a mayor for a town intelligently.
      - If a town attempts to set a mayor who is not part of the town,
and the
        town has no residents, the town will be deleted.
      - Closes #4170.
    - Towny now handles loading the capital of a nation intelligently.
  - Little fixes for TownySQLSource:
    - Hit TownySQLSource with the formatting stick.
    - Add tar/tar.gz backups to the backup code.
    - Make deletePlotGroup actually do something.
  - Invite Cleanup, courtesy of Siris with PR #4269.
  - Cleanup Confirmation class and properly implement async, courtesy of
Siris with PR #4280.
  - Remove Secondary POM file, courtesy of TheFlagCourier with PR #4278.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants