"User name taken" error in custom login.
-
yuvallahav
- Posts: 247
- Joined: 07 Oct 2008, 13:03
- Location: Rome, Italy
- Contact:
"User name taken" error in custom login.
In the chain of the latest of unexplained errors we get on the server, I have a new one from the last few days.
Some of my users are getting a login error, saying the user name is already taken.
Now... if a user is stupid and uses a stupid password and someone plays around with their account, I wouldn't bother with this issue, only... it happened to be too.... and it also happened to me off line, on my local machine... where non one else is connected... so unless I can somehow get any kind of information on the alleged connected user, since we don't have getUserByName on the not x2 server, what can I do to find out why we have this problem??
Some of my users are getting a login error, saying the user name is already taken.
Now... if a user is stupid and uses a stupid password and someone plays around with their account, I wouldn't bother with this issue, only... it happened to be too.... and it also happened to me off line, on my local machine... where non one else is connected... so unless I can somehow get any kind of information on the alleged connected user, since we don't have getUserByName on the not x2 server, what can I do to find out why we have this problem??
Re: "User name taken" error in custom login.
Hi.
Hmm, I think that you're dealing with the famous "ghost users" problem, where a client had an abrupt disconnection which didn't successfully close the connection, so the server doesn't disconnect the user. These kind of connections can stay active for several minutes before the TCP timeout comes in and finally closes the connection.
You can apply several measures in order to reduce the amount of ghost users:
- <MaxIdleTime> - you can set this setting on the server's configuration file to a low number and then have on the client something like a keep alive system, which is basically a small timer that sends to the server a small message every few seconds (usually an Extension Message is enough, I don't even think that it needs to be an existing command). This way, if an user stays idle for some time, it will be automatically cleaned from the system.
- force login - You can use the force login feature available since SFS Pro 1.6.3 (by specifying true as the 4th parameter of the loginUser() method on your server-side extension) which will disconnect the previous user with the same username, if it is still connected.
You can find even more measures on this documentation page.
Hmm, I think that you're dealing with the famous "ghost users" problem, where a client had an abrupt disconnection which didn't successfully close the connection, so the server doesn't disconnect the user. These kind of connections can stay active for several minutes before the TCP timeout comes in and finally closes the connection.
You can apply several measures in order to reduce the amount of ghost users:
- <MaxIdleTime> - you can set this setting on the server's configuration file to a low number and then have on the client something like a keep alive system, which is basically a small timer that sends to the server a small message every few seconds (usually an Extension Message is enough, I don't even think that it needs to be an existing command). This way, if an user stays idle for some time, it will be automatically cleaned from the system.
- force login - You can use the force login feature available since SFS Pro 1.6.3 (by specifying true as the 4th parameter of the loginUser() method on your server-side extension) which will disconnect the previous user with the same username, if it is still connected.
You can find even more measures on this documentation page.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
yuvallahav
- Posts: 247
- Joined: 07 Oct 2008, 13:03
- Location: Rome, Italy
- Contact:
Re: "User name taken" error in custom login.
yeah, it's a good answer, only I can attest to it that it happens sometimes after I restart the server, so no ghosts in my machine... 
And before I start forcing logins on users, I would love to know where this comes from, I mean, if it's not a ghosts problem, but something else, who knows what will happens when I start force login users on our live server, who this will disconnect, then I'll start heaving 2 unexplained problems, users who can't login, and users who for no apparent reason get kicked out....
And before I start forcing logins on users, I would love to know where this comes from, I mean, if it's not a ghosts problem, but something else, who knows what will happens when I start force login users on our live server, who this will disconnect, then I'll start heaving 2 unexplained problems, users who can't login, and users who for no apparent reason get kicked out....
Re: "User name taken" error in custom login.
Well, if you enable the force login, there won't be login problems anymore... so... just 1 problem 
Anyway, in my opinion, it is better if you stay just with a low MaxIdleTime and MaxSocketIdleTime settings, which will clean all the ghost connections for you.
When it happens on your local installation of SFS Pro, can you please check on the logs if you're getting multiple login requests and confirm on the AdminTool if there really is another user connected with the same username?
And please make sure that you're running the latest SFS Pro 1.6.9.
Anyway, in my opinion, it is better if you stay just with a low MaxIdleTime and MaxSocketIdleTime settings, which will clean all the ghost connections for you.
When it happens on your local installation of SFS Pro, can you please check on the logs if you're getting multiple login requests and confirm on the AdminTool if there really is another user connected with the same username?
And please make sure that you're running the latest SFS Pro 1.6.9.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
yuvallahav
- Posts: 247
- Joined: 07 Oct 2008, 13:03
- Location: Rome, Italy
- Contact:
Re: "User name taken" error in custom login.
yep, latest version, and server is clean, I don't get any error messages apart from the response to the client's log in request... I know it's all weird... I actually started seeing this locally before I've seen it online, and though that it was my problem, having like 20 tabs open with different games and parts of my project, but understood it's not me not noticing I'm already logged when users started complaining about this online somewhere in the middle of last week. I don't know man, this is just one more problem I'm heaving now with the server, it adds to a list of weird errors I'm getting online that no one can explain where they are from, I'm cleaning 2 giga log files from the server each day so the server will not get saturated, these files are loaded with errors that for this reason or that, they can't be explained or debugged, I'm starting to think something is rotten on our server, but my boss can't have an extra server right now for testing, so I can't debug anything online... well, sorry I'm venting out here, but it seems to be that in the past couple of months I've been only debugging things I can't do anything about and not developing something new, like I should be doing...
Re: "User name taken" error in custom login.
Do you have the server logs of when that error happens locally? Can you reproduce the error at will?
What OS and server architecture are you running SFS on?
What OS and server architecture are you running SFS on?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
yuvallahav
- Posts: 247
- Joined: 07 Oct 2008, 13:03
- Location: Rome, Italy
- Contact:
Re: "User name taken" error in custom login.
sure, I have the log files, nothing interesting in them since the error is not a system or component error, but a run of the mill error that is expected to happen, one user trying to login with a name already used, so I didn't find anything in there, I'm running windows 7, using xammp to power it all up (apache, mysqladmin, php), the server is pro, 1.6.9, and I can't reproduce this, offline or online, sometimes it happens, most of the times it does not, but... as far as I've seen online from a log I have put up on the server, once this happens to a user online, he can't log on for times running to a few seconds (one try gets denied, one right after goes ok), to a time until our server restart, at about 4:30 in the morning, denying tens and hundreds tries to login, so... can't help you there... I wish I could reproduce this, we all know that once you can reproduce and error, it's about 90 percent solved right there.
Re: "User name taken" error in custom login.
Hmm... Sometimes those ghost connections appear, for example, when you refresh the page on some browsers... In the past it happened most of the time when you reloaded the page on IE...
Try decreasing both socket and user idle times, and then check if you still get tons of "User name taken" errors.
Try decreasing both socket and user idle times, and then check if you still get tons of "User name taken" errors.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
-
yuvallahav
- Posts: 247
- Joined: 07 Oct 2008, 13:03
- Location: Rome, Italy
- Contact:
Re: "User name taken" error in custom login.
will give it a try, and I just might start forcing my login just in case, although my boss does not like the idea, and I get it, it's my thinking too, to cure the symptoms but not the problem....