XF 1.5 Incorrect Counters

Robust

Well-known member
Completed an import and the counters seem to be wrong. They display an incorrect number when the actual (as I checked through the database) is a much higher number.

How do I rebuild these counters? I can't see a special rebuild tool for counters (discussions and messages counters are correct).
 

Chris D

XenForo developer
Staff member
Which counters specifically, displayed where?

If it's the board totals counters like for users etc. then it will only include valid users and visible content.
 

Robust

Well-known member
If it's the board totals counters like for users etc. then it will only include valid users and visible content.
Those are the ones. I did a select count(user_id) query, but I'm positive over 30,000 members weren't lost due to them being invalid. Any way to definitely check using the database? What makes a user invalid?
 

Chris D

XenForo developer
Staff member
It's a cached value which is updated by Cron entry so if the last time the Cron was run was during the import finished then that could account for a difference. You could try running the Cron manually.

To be valid user_state should = valid and is_banned should = 0.
 

Robust

Well-known member
I did that query in the DB and it returns about 60k users, but the 2 XF forums prior to merging into one of them shown 42k on their counters each, so by that logic totals should be around 84k members. The forum shows 71k, and a SELECT COUNT(user_id) FROM xf_user WHERE user_state = 'valid' AND is_banned = 0 returns around 60k users only.

A SELECT COUNT(user_id) FROM xf_user query returns about 100k users (a 3rd forum was also merged in).

The counters on XenForo fluctuate every 15 minutes. They shown 94k, then 69k, now 71k... Not sure if this is really a cache problem. Queries and the XF front-end always return different numbers but never the ones it should be.
 

Mike

XenForo developer
Staff member
If they're fluctuating, it sounds to me like you might have multiple forums pointing at the same cache. This happens if you define a cache in config.php but don't use a distinct cache prefix for each install.
 

Robust

Well-known member
If they're fluctuating, it sounds to me like you might have multiple forums pointing at the same cache. This happens if you define a cache in config.php but don't use a distinct cache prefix for each install.
No caching system is in config.php (just checked). They've went down 1k overnight. But haven't changed in the db.
 

Mike

XenForo developer
Staff member
Fluctuating really doesn't make sense if it's reading from the same database. The queries are deterministic

But if you submit a ticket, we'll see if we can figure it out.
 
Top