I am using webtrees v2.0.17 and the vesta modules v126.96.36.199.1, but this or a similar issue existed with earlier webtrees v2 and vesta v2 versions as well. The issue occured at least 4 times over the last months, but unfortunately I don't know how to reliably reproduce this issue. On all occasions I could NOT successfully remove the non-existing place via the control panel and decided to fix the issue by deleting the respective records from the database tables wt_place_location und wt_places via phpadmin. There were/are no corresponding records in wt_place_links. Unfortunately these fixes where only temporary. I attach screenshots from these 3 tables as of today.
It is always this same place hierarchy that keeps coming back every now and then, at least in one case right after importing a GEDCOM file and thereby replacing an existing family tree.
Westerplatte, Neufahrwasser, Stadtkreis Danzig, Freie Stadt Danzig
I had created this place in error months ago, then deleted it from the to be imported GEDCOM file and from webtrees, but it keeps resurrecting like a zombie. The symptoms have been slighty different, but they always related to the above mentioned place. On some occasions I was offered the red delete button and I tried to delete the records both in one step (clicking the delete button on "Freie Stadt Danzig") and step by step (first "Westerplatte", then "Neufahrwasser", then "Stadtkreis Danzig", finally "Freie Stadt Danzig"). Sometimes the records got deleted and only reappeared later, sometimes the delete action didn't work at all.
This morning - after upgrading the vesta modules, but I don't think these modules cause the issue - the zombie place resurrected once more. I am offered the link to its occurence in the exact family tree where I had created this place months ago. When clicking on the link the map is shown without any record listed below. The display of the place in the Control Panel doesn't change when activating or de-activating the "Hide unused locations" check box. So it seems that webtrees thinks this place is in use. Consequently it does NOT offer to delete it. When the issue occured some days ago webtrees thought 2 of my trees would be using the zombie place, today only one. When exporting the complete place hierarchy to a csv file, the file does NOT include the zombie place. I can't find any record for this zombie place in any of the vesta wt_gov_... tables.
Summary: The place does neither exist in the imported GEDCOM file, nor in an exported places .csv file, nor in the vesta tables, nor does it show up as a search result.
Preliminary conclusion: It must be recorded/cached in some other webtrees table from where it resurrects every now and then, but under what circumstances this resurrection happens I don't know.
I might try to export and then re-import the complete place hierarchy, but even if that is going to fix the obvious inconsistencies, it won't fix the underlying root cause.
This issue did not let me rest and I tried a different approach.
After adding coordinates to all levels of this place it is included in the exported .csv file.
After creating an individual with birth place "Westerplatte, Neufahrwasser, Stadtkreis Danzig, Freie Stadt Danzig" the link from Control Panel > Geographic Data shows the map with the respective individual below.
After deleting the individual's birth place and deleting the individual the Control Panel > Geographic Data offers the delete button again and the "Hide unused locations" check box works as expected.
Once more I deleted this zombie place step by step, i. e. bottom up. We'll see whether this finally fixed the issue.
today the zombie place resurrected once more without the option to delete it and without finding any data in the mentioned family tree.
I am afraid I need your help to resolve this. I did not upgrade anything after the last manual deletion of the respective records from the database manually. I believe we first need to understand what procedure triggers this resurrection and under which circumstances it is being executed.