XF 1.5 Had a couple of posts from 1 user in 1 thread vanish without a trace..

sross

Active member
I've dug through the system logs and nothing, I've manually looked in the database and they do not exist. We think it was too posts. The thread even has someone thanking the guy for his post but none of his posts in that thread exist any more. Other posts in the thread are fine, his other posts are fine. I've had no other reports of missing posts so far. xf_posts reads around 1.6 million posts which sounds about right. Any ideas what happened? It seems to coincide with a db repair I did so all I can think is his posts in that thread were somehow corrupted and got purged. Not sure, but if it happens again I'll be extremely worried.. I have an 8core dedicated server, no reported issues lately other than this. Thanks!
 
The only thing would be if the user has permission to hard delete his posts but that would usually only be available to privileged users. Regardless, you should definitely check their permissions to be sure.

Of course other moderators may have hard delete permissions. You should check through the Moderator Log in the Admin CP to check if anyone inadvertently hard deleted the posts.

What exactly was the repair you did for and how was it performed? Was there a particular reason you did it?
 
Is there a gap in post numbers in the thread (the #1, #2, etc)? If not, that would imply something happened via the UI, unless you triggered a rebuild somewhere.
 
The only thing would be if the user has permission to hard delete his posts but that would usually only be available to privileged users. Regardless, you should definitely check their permissions to be sure.

Checked and no hard delete

Of course other moderators may have hard delete permissions. You should check through the Moderator Log in the Admin CP to check if anyone inadvertently hard deleted the posts.

I specifically set my mods to not be able to hard delete and re-checked. Also, see nothing in logs regarding a delete..

What exactly was the repair you did for and how was it performed? Was there a particular reason you did it?

Just run repair/optimize every month or so for general maintenance via phpmyadmin. Went through logs etc again and nothing there, my mods also say they didn't touch that thread. It might remain a mystery..
 
Is there a gap in post numbers in the thread (the #1, #2, etc)? If not, that would imply something happened via the UI, unless you triggered a rebuild somewhere.
no gaps, but the posts existed long enough for a member to thank the poster for his info, and there is no log entry for that user deleting the post.
 
Are you certain the member posted in the correct thread?

It wouldn't be a normal situation for content to disappear from the database, and also for the auto increment index to effectively reset.

If there's no other clues, you may have to write this off as unexplained, and monitor the situation closely. Needless to say, make sure your backups are up to date and functional.

I would probably advise against doing a repair or optimise on your tables routinely. Doing a repair and optimise on your tables is rarely needed. I can't say for sure this isn't related.
 
Thanks for the advice re: database. Well, the user contacted me and said "why are my posts no longer in this thread?" I went to the thread and can see where another user in the thread thanked him in two different posts for info. It's pretty strange. If this was a wider issue not sure how I would even know or detect it unless someone reported content missing. Is there anything I should look for?
 
@Chris D Ok an update to this. We now find he is missing 720 posts, they've completely vanished without a trace. Everything prior to July28th 2016 is gone (he's been a member since 2007). I have a dev server with a dataset from may 2016 and although it shows his post count at 740 it finds zero posts for him.

All I can think is he was wiped as spam but then was re-instated or unbanned but not sure who would have done that.

If I find an old enough database with most of his posts is there a way to export those and import them into the current database?

Thanks
 
If it was done with the Spam Cleaner and then reversed, the content would have been restored -- nothing is hard deleted in that scenario.

Certainly a somewhat concerning situation. You may want to spend more time trying to make sense of that.

The fact that the post count is still 740 despite the posts being removed would usually suggest something that hasn't happened within XF. For example, even if someone hard deleted all their posts in the UI, XF would adjust the post count. Similarly with the spam cleaner, and Batch Update Threads etc.

So one explanation could be them being actually deleted in the database. This would certainly fit more as well if there is orphaned data in the database as a result.

For example, if they seem to have had all their posts removed from the xf_post table, but there are still threads they created in the xf_thread table or if their old posts have been liked and they are still in the xf_liked_content table then it all points to something specific to the xf_post table (such as accidental deletion).

If, however, there is no orphaned data and it seems as though the posts and all associated data has gone, this may indicate they've been somehow removed through the software, but also it will make restoring the content more difficult.

So, yes, it's theoretically possible to restore it, but how challenging that will be will depend on how many tables have had data removed.
 
If it was done with the Spam Cleaner and then reversed, the content would have been restored -- nothing is hard deleted in that scenario.

You can choose in the options to make the spam cleaner do a hard delete, although if it were spam cleaner with hard delete, then all threads and posts would be gone...

Liam
 
Thanks for the info. On a side note my may database has 1.77 million posts, current database 1.8 million, so there doesn't seem to be any sort of catastrophic data loss going on. I've spot checked 50 or so accounts and they are fine. I haven't had any other reported issues so it seem linked to this one account.

You mention orphaned data, is there an easy way to check that? When it comes to the database we're getting a bit into over my head territory.

Thanks again
 
You can choose in the options to make the spam cleaner do a hard delete, although if it were spam cleaner with hard delete, then all threads and posts would be gone...

Liam
It was set to hard delete so I have changed it to 'remove from public view' just to be safe for any future issues.
 
You can choose in the options to make the spam cleaner do a hard delete, although if it were spam cleaner with hard delete, then all threads and posts would be gone...

Liam
Indeed, but in this case, the post count would be correct. But, yes, you're right, the content can't be restored. There would however be an entry in the Spam Cleaner Log and if someone had attempted to Restore this, there would be an entry still in the log and there would be a Restored date.

You mention orphaned data, is there an easy way to check that? When it comes to the database we're getting a bit into over my head territory.
The simplest way to find out is basically to restore the user's posts to the xf_post table and see if there is still some stuff missing - this would be things like the likes on their posts, attachments to their posts - that kind of thing.
 
ok wow, i need serious eye check. I do see him in the spam cleaner log and 28th is when it happened and his data went missing, i restored from that but his previous posts did not restore. So I guess now I need to find them in an older db, but unsure yet how to obtain them and restore them. Is it something along the lines of export them via phpmyadmin then import them into the post table via phpmyadmin? Thanks

ok i see 800 or so of his posts in xf_post table in phpmyadmin will see if i can find a tutorial on export/importing this data. I certainly do not want to screw up my production db..
 
Last edited:
It's odd, then, the post count wasn't adjusted... The restore shouldn't do that if the content was hard deleted in the first place.

So, yeah, basically.

Needless to say -- make sure you back up the live database before making any changes. In fact, you should ideally attempt to test this restore on your dev environment first.
 
I am testing in dev at the moment. I exported all his posts/threads to an sql, will update my dev with latest production build then work on testing a restore. I am not 100% sure the method for this other than export his data from phpmyadmin, then trying to import said .sql files back into the database using phpmyadmin import (when in phpmyadmin viewing the appropriate table)
 
Back
Top Bottom