Server issue  Post from deleted member assigned to new member?


Well-known member
Something odd happened. There was a spammer that posted a thread. I deleted the account but left the thread intact.

Appropriately, the post showed:


However, today a new member signed up and now the post shows:

New Member

I looked at the database and it seems that the new member was assigned a user_id that's the same as the deleted user. I believe the expected behaviour is that deleted user_ids are skipped when someone new registers. The new member registered via facebook, so maybe the user_id bug only happens with Facebook Connect?

Jake Bunce

XenForo moderator
Staff member
I spent some time playing with this and I am unable to reproduce the problem. But I don't have a facebook account to test that registration path. Are you able to reproduce this problem yourself?

It certainly sounds like the user_id is being recycled. Maybe it's a problem with the database. You should check the definition of the xf_user.user_id field in the database to make sure it is autoincrementing and unique. Also check the auto_increment value of the table which specifies the next user_id to be used.


Well-known member
phpMyAdmin shows "auto-increment" being checked. Is there a unique setting?

I scrolled through my list of users and there are some skipped user ids. Since I have deleted users in the past, I suspect the recycling is indeed unique to facebook registration. My facebook account is already registered on the forum so I can't quite test it. Is your forum online? If so I could register with my fb account.


Well-known member
Was your MySQL server restarted in the middle of this?
(why that mirror beat out the MySQL docs themselves, I don't know)

It looks like that could cause it, which is something I didn't realize.
Oh, sounds like that's the reason. I'm on shared hosting and the MySQL server did go down recently. Could this also cause thread and post ids to be recycled and will there be any huge problems down the line as a result of this?


XenForo developer
Staff member
No, this is pretty much the only situation where it might be a problem. (And changing it is part of other bigger changes that may happen down the line.) It effectively is only an issue if there is some sort of "orphaned" data (the user_id associated with the post in this case).