FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » Last registered user screwed up
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Last registered user screwed up [message #17142] Thu, 18 March 2004 11:27 Go to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Hi

My last registered user (as seen on the main page of the forum) is always the same (some user who registered on feb,3), although some users are more recent (one last night).

This seems to be since I upgraded from 2.3.8 to 2.6.0 stable and renamed some user logins in the admin panel.

Kind regards
Re: Last registered user screwed up [message #17148 is a reply to message #17142] Thu, 18 March 2004 13:30 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The statistics on the front page are cached for 10 minutes, they are not realtime like in 2.3.8, although you can control the caching period via the admin control panel.

The query that is used to fetch the data is a simple "SELECT MAX(id), count(*)-1 FROM [db_prefix]users", so your problem would not occur unless the user you see has the max id.


FUDforum Core Developer
Re : Re: Last registered user screwed up [message #17154 is a reply to message #17148] Thu, 18 March 2004 15:12 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Ilia a écrit le jeu, 18 mars 2004 08:30

The statistics on the front page are cached for 10 minutes, they are not realtime like in 2.3.8, although you can control the caching period via the admin control panel.


Ok but the time interval I'm referring to is 1 month...

I just checked this Forum Info Cache Age setting and it's set to 600 (the default it seems), so it's surely not the problem.

Quote:

The query that is used to fetch the data is a simple "SELECT MAX(id), count(*)-1 FROM [db_prefix]users", so your problem would not occur unless the user you see has the max id.


This does not mean much to me as I don't speak SQL unfortunately. However, this problem does show so I guess this particular user has the max id. How can I fix this ?
Re: Re : Re: Last registered user screwed up [message #17155 is a reply to message #17154] Thu, 18 March 2004 15:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The 1st thing to do would be to run the query I showed you (replace [db_prefix] with your database prefix).

The run SELECT login FROM [db_prefix]users WHERE id=[fetched max id].

If the login is the same as the one displayed on the front page then it seems like there is a database problem rather then a forum one (which database are you using?). We then need to determine why new users are being assigned an id smaller then the last id (as fetched by max id), the id assignment is done by the database system.
Re : Re: Re : Re: Last registered user screwed up [message #17534 is a reply to message #17155] Fri, 02 April 2004 11:20 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Ilia a écrit le jeu, 18 mars 2004 10:21

The 1st thing to do would be to run the query I showed you (replace [db_prefix] with your database prefix).

The run SELECT login FROM [db_prefix]users WHERE id=[fetched max id].

If the login is the same as the one displayed on the front page then it seems like there is a database problem rather then a forum one (which database are you using?). We then need to determine why new users are being assigned an id smaller then the last id (as fetched by max id), the id assignment is done by the database system.


OK I did not do that because I don't quite understand this SQL syntax and I don't know what to replace [fetched max id] with. However, here is what I did:

I installed 2.6.1 stable into EasyPHP here on my local machine and imported a datadump of our server's 2.6.0 stable version of fudforum. The same problem appears here with this particular user still displayed on the front page.

In PHPMyadmin I looked at the fud26_users table and located this user, who has an ID of 224. Users who registered later have Ids of 225, 226, 227, 228 and 229. This seems to be the reverse order from the list I can see by clicking "Members" in the forum.

So there's no apparent problem there I guess. Another idea ?

BTW : I'm using MySQL, both on my local test server and on the regular forum server.

Thanks for your help !
Re : Last registered user screwed up [message #17535 is a reply to message #17142] Fri, 02 April 2004 11:23 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Update : I just understood what you meant with those SELECT statements Embarassed

I did what you said and it confirms what I said earlier: the user with max id is not the one who's displayed on the front page.
Re: Re : Last registered user screwed up [message #17537 is a reply to message #17535] Fri, 02 April 2004 14:48 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Strange thing, I cannot replicate the bug on any of my development forums.
Re : Re: Re : Last registered user screwed up [message #18059 is a reply to message #17537] Wed, 05 May 2004 08:57 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Maybe this has to do with me renaming the login of that user ?
Re: Re : Re: Re : Last registered user screwed up [message #18064 is a reply to message #18059] Wed, 05 May 2004 12:29 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Netherlands
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The login of that user is not used in the calculation of the last registered user.

FUDforum Core Developer
Re : Re: Re : Re: Re : Last registered user screwed up [message #18311 is a reply to message #18064] Mon, 17 May 2004 16:22 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Ilia a écrit le mer, 05 mai 2004 08:29

The login of that user is not used in the calculation of the last registered user.


Where (which file) is this calculation made ? Maybe I'll find the time to look into it (although I know nothing of PHP Smile )
Re: Re : Re: Re : Re: Re : Last registered user screwed up [message #18323 is a reply to message #18311] Mon, 17 May 2004 16:59 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
This calculation is not done by PHP, it's is done by MySQL. The query can be found inside logedin.inc.t.

SELECT MAX(id), count(*)-1 FROM {YOUR_SQL_PREFIX}users


FUDforum Core Developer
Re : Last registered user screwed up [message #18330 is a reply to message #17142] Tue, 18 May 2004 06:39 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
That's true, but it's not MySQL's fault since it gives me the correct id (229) and login for the last registered user when I cast the SELECT statements in PHPMyAdmin. The number of registerd users is displayed as 170.

However, when I look at the table fud26_stats_cache, I get 224 as the last user id, and 165 as the number of registered users.

I have a feeling this could be related to a wrong clock when the cache was built as this is kind of a recurrent problem with our web server. I think if the clock was set to the future at that time, the cache will never be rebuilt. Am I right ? How could I force rebuilding the cache ? (the cache_age is set to 1099501864, but I cannot decode that Smile )

BTW, today's visitor seems to work (not always accurate though) but the list of currently online users seems broken.

I think forcing the forum to rebuild the cache will be the solution. Maybe I could manually set cache_age to something ?
Re : Last registered user screwed up [message #18331 is a reply to message #17142] Tue, 18 May 2004 06:44 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Okay I just tried setting "cache_age to 0" and it worked !

So this was clearly the problem, and I think an admin option to force rebuilding of the cache would be great...
Re: Re : Last registered user screwed up [message #18341 is a reply to message #18331] Tue, 18 May 2004 13:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well the cache is not permanent and by default should be refreshed automatically once it's age goes above 10 minutes. You can of course reduce duration of the cache if you have frequent registrations or turn it of all together like you've done.

FUDforum Core Developer
Re : Re: Re : Last registered user screwed up [message #18343 is a reply to message #18341] Tue, 18 May 2004 13:27 Go to previous messageGo to next message
math_adm is currently offline  math_adm   France
Messages: 126
Registered: September 2003
Location: France
Karma: 0
Senior Member
Ilia a écrit le mar, 18 mai 2004 09:09

Well the cache is not permanent and by default should be refreshed automatically once it's age goes above 10 minutes. You can of course reduce duration of the cache if you have frequent registrations or turn it of all together like you've done.


Well there's something I don't understand there. What's the real meaning of the cache_age field in the fud26_stats_cache table ?

I thought it was the date when the cache was last rebuilt, but you seem to say it is the time from the last rebuilding (duration). However, after setting it to 0 with PHPMyAdmin and accessing the main page of the forum, the cache_age is back to 1084862412.

So setting this field to 0 does not seem to turn off the cache...

I still think that if somehow the cache_age points to the future then the cache is not rebuilt by fudforum who thinks it's not time yet.

Please explain if/where I'm wrong.
Re: Re : Re: Re : Last registered user screwed up [message #18344 is a reply to message #18343] Tue, 18 May 2004 13:31 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
cache_age is the unix timestamp of the time when the cache was last rebuilt.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: forum.css
Next Topic: Security hole with URL cut and pastes?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 22:22:05 GMT 2024

Total time taken to generate the page: 0.02475 seconds