Online users counter doesn't work

Started by Leo2, October 22, 2012, 03:20:24 AM

Previous topic - Next topic

Leo2

After some database upgrade made by my hoster, the online users counter stopped to work. It shows 0 guests and 0 users all the time, and doesn't update statistics (total users today).

What should I check and do to fix that?

hcfwesker

Maybe under Admin > Maintenance > Routine >  run the "Recount all forum totals and statistics" and possibly "Find and repair any errors" and see if that helps.

Leo2

No, that didn't help, I already thought about that.

I guess that problem can be handling sessions - but don't know how to check that. There is no errors in the forum logs

Storman™

QuoteAfter some database upgrade made by my hoster

Have you asked your host for details of exactly what they did as it would aid a solution....

Otherwise it's pure presumption.   ;)

Leo2

of course! They tell me that they just moved database to new server. Files are located in different server, so they say that files didn't change.

Actually, there was another problem with the forum after that 'upgrade', GeoIp mod doesn't work now because of MAX_JOIN_SIZE error (see here my question about that)

Storman™

QuoteActually, there was another problem with the forum after that 'upgrade', GeoIp mod doesn't work now because of MAX_JOIN_SIZE error

Well that's one for your host really, assuming you're on shared hosting then that can only be amended in the MySQL configuration.

To be honest both these issues need to go back to your host, they've obviously changed their set-up but not taken into account potential client issues. Unfortunately, it's the sort of thing you'll get on shared hosting, the relatively low cost has caveats.

Leo2

#6
I don't think they have restrictions which blocks online users counters (unlike geoip, that is resource consuming mod).

What can I and my probider do to debug that issue?
Where are the sessions stored and how the counter retrieve and process that information?

Colin

Are you able to login to your forum alright?
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Leo2


Colin

Great, is there any chance we can get a link to your board?
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Leo2

sure  :)
http://www.solarhome.ru/forum/

It is in Russian, though...

and I forgot to mention - online status in the user profile (that small square left to the user name) doesn't work too since the 'upgrade'

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

hcfwesker

Most times when my servers update or move, I have to goto phpMyAdmin and check the database table "smf_log_online" and select "repair table".  I'm sure you already thought of that but just trying to give advice from my own experience.

Leo2

Quote from: Colin on October 23, 2012, 07:07:13 PM
Mind if I make a test account?
Sure, you can make the account, advise if you will need help at registration  or additional permissions
Quote from: hcfwesker on October 23, 2012, 08:12:34 PM
Most times when my servers update or move, I have to goto phpMyAdmin and check the database table "smf_log_online" and select "repair table".  I'm sure you already thought of that but just trying to give advice from my own experience.
This table is empty now.
I made the repair, but that doesn't help.

Joker™

Not sure about the exact cause of the issue but try to empty your forum cache.

Also please mention the mods installed on your forum.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Leo2

Installed mods
Quote1.    geoIP Location    1.1.1    
2.    Users Online Today    2.0.3    
3.    The Rules    1.3    
4.    SMF 2.0.2 Update    1.0
5.    Delete Spam Posts    1.6    
6.    Highslide BBCode and Image Viewer    1.1
7.    Disable 'last edit by...' for Administrators    1.7
8.    Search Focus Dropdown    1.6.1    
9.    Optimus Brave    1.8    
10.    Alt Characters v1.7    1.7    
11.    JumpToSelectBoard By Smfsimple.com    V1
12.    Smart Pagination    0.8
13.    Users mass actions    0.1.1    
14.    Forum Faces ~ Avatars    0.1
15.    Back to the index    0.2    
16.    Socialize    1.8
17.    Join date and Location in Posts    1.3
18.    Aeva ~ Auto-Embed Video & Audio    7.2    

Joker™

Users Online Today -- Try disabling the mod for a while and see if it resolves the issue.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Leo2

Quote from: Joker™ on November 05, 2012, 11:08:19 AM
Users Online Today -- Try disabling the mod for a while and see if it resolves the issue.
I installed that mode AFTER the problem with online users counting appeared. So, it is not the cause of the problem.

I still have question about how (where are the scripts) and where (database or files) SMF handles the sessions. I suspect that the problem is with incorrect session handling.

Joker™

Quote from: Leo2 on November 10, 2012, 05:14:29 PM
I still have question about how (where are the scripts) and where (database or files) SMF handles the sessions. I suspect that the problem is with incorrect session handling.
Subs.php

Code (function) Select
function writeLog($force = false)

As you said that {db_prefix}log_online table is empty, so you should make a check whether this function is inserting the data or not.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Leo2

#19
Quote from: Joker™ on November 14, 2012, 10:35:10 PM
Quote from: Leo2 on November 10, 2012, 05:14:29 PM
I still have question about how (where are the scripts) and where (database or files) SMF handles the sessions. I suspect that the problem is with incorrect session handling.
Subs.php
Thank you much for the direction! I finally found the error!

After the database update the forum didn't work at all because of SQL_BIG_SELECTS error caused by geoip (Thank you Joker for that hint again!). I commented this part of the Subs.php to revive the forum.
// some geoIP for the map and online list when they first login
$geoIP = array();
if (!empty($modSettings['who_enabled']) && !empty($modSettings['geoIP_db']) && (!empty($modSettings['geoIP_enablemap']) || !empty($modSettings['geoIP_enableflags'])) && !empty($user_info['ip']))
{
// do a lookup, but database only, don't want the slowness of a network call here.
include_once($sourcedir . '/geoIP.php');
$geoIP = ($modSettings['geoIP_db'] == 2) ? geo_search_lite($user_info['ip'], false) : geo_search($user_info['ip'], false);
}
if (!empty($geoIP[0]))
$smcFunc['db_insert']($do_delete ? 'ignore' : 'replace',
'{db_prefix}log_online',
array('session' => 'string', 'id_member' => 'int', 'id_spider' => 'int', 'log_time' => 'int', 'ip' => 'raw', 'url' => 'string', 'latitude' => 'float', 'longitude' => 'float', 'country' => 'string', 'city' => 'string', 'cc' => 'string'),
array($session_id, $user_info['id'], empty($_SESSION['id_robot']) ? 0 : $_SESSION['id_robot'], time(), 'IFNULL(INET_ATON(\'' . $user_info['ip'] . '\'), 0)', $serialized, $geoIP[0]['latitude'], $geoIP[0]['longitude'], $geoIP[0]['country'], $geoIP[0]['city'], $geoIP[0]['cc']),
array('session')
);
else
$smcFunc['db_insert']($do_delete ? 'ignore' : 'replace',
'{db_prefix}log_online',
array('session' => 'string', 'id_member' => 'int', 'id_spider' => 'int', 'log_time' => 'int', 'ip' => 'raw', 'url' => 'string'),
array($session_id, $user_info['id'], empty($_SESSION['id_robot']) ? 0 : $_SESSION['id_robot'], time(), 'IFNULL(INET_ATON(\'' . $user_info['ip'] . '\'), 0)', $serialized),
array('session')
);

It was not changed after reinstallation of the geoip mod because it was commented (and the mod didn't recognize that part of the page is commented).

Now the counter works. Thank you all who tried to help me!

BTW, GeoIP shows different number of users online (usually less than the forum's online users counter). But this is another story :)



Advertisement: