Ghost room - Requested room does not exist

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Ghost room - Requested room does not exist

Postby Alex » 08 Sep 2011, 14:41

Hi

From time to time some of my rooms starts to behave strange.
I receive the room at the client but when I try to join the room I got the error -

Code: Select all

Requested room does not exist.


When I check the admin console - the room is there too but when I try to get the info I got the error:

Code: Select all

[18:32:40 | WARNING] The Room being monitored is no more available on the server, please select another one

Even after I refresh the rooms several times - the room is still there and I keep getting the above error.

The name of the ghost room is 5555 at the following picture
http://imageshack.us/photo/my-images/11/ghostroom.png/

Do you have any idea what might be causing the problem?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 08 Sep 2011, 14:50

Hi. Do you have the latest SFS RC3 installed? Maybe that was fixed...
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.
Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Postby Alex » 08 Sep 2011, 15:23

Hi

Yes, I have the RC3 installed.

Eventually the room is destroyed - but its kind of annoying as the users sees the room but can't join.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 09 Sep 2011, 06:30

Very difficult to understand what is going on. We never experienced this issue. Anything in the logs that could give an hint about what caused the Room to be in such state?
Paolo Bax
The SmartFoxServer Team
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Sep 2011, 06:52

This is quite normal actually.
Dynamic Rooms are auto-managed by the AUTO-REMOVE policy that you have assigned. By default the system uses the AUTO-REMOVE behavior which ensures that a Room is removed when it's no longer needed.
All the details are found in the docs:
http://docs2x.smartfoxserver.com/Develo ... chitecture

The error you get can happen when a user decides to join Room X but Room X is being removed. When the request arrives too late, the Room is gone and the error is logged.

If you need to ensure that a Room does not disappear "under your nose" you should configure it accordingly.
A word of warning is necessary here: if you suppress the auto-removal you will need to manage your Rooms manually, especially if new Rooms are often created. Should you forget about this the system might eventually crash with an OOM (out of memory error)

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Postby Alex » 09 Sep 2011, 08:53

Hi

I know about the auto-remove feature but this is something different.
As you see on the picture I've attached there are two users in the room. I've contacted them and they confirmed that they are in the room and they are playing the game normally. The room stays for more than one hour with the two users inside and during that time I kept receiving the error that the room doesn't exists. So I guess it seems that the system decided that the room is no longer needed and marked it as deleted although there are still users inside.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Sep 2011, 10:10

No this is really unrealistic. Rooms are not "marked" as deleted, they either exist or not.
I've contacted them and they confirmed that they are in the room and they are playing the game normally.

Really?
You contacted them while they were playing in real time?
And as they were saying that they were actually in that Room you got that error?
Can you confirm this?
Lapo

--

gotoAndPlay()

...addicted to flash games
Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Postby Alex » 09 Sep 2011, 11:07

Hi

Yes - that is correct. Here is some more info. The two users are buddies and one of them can leave the room and then join the room again but only if he select the option join buddy room.

I've implemented two ways to join room:

1st Way: Client sends

Code: Select all

var jrr:JoinRoomRequest = new JoinRoomRequest(...);
_sfs.send( jrr );

This throws the error - Requested room does not exist - for all users, even the one that was initially joined in the room.

2nd Way: Client sends extension request and at the server I use:

Code: Select all

ce.getApi().joinRoom( user, buddy.getLastJoinedRoom(), buddy.getLastJoinedRoom().getPassword(), false, user.getLastJoinedRoom(), true, true );

It looks like this is working for the user that was initially joined in the room.

Also I think the room was destroyed after the two users left the room, but I'm not 100% sure of that.

Hope it helps.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Sep 2011, 12:52

Can you please show the full code of the join? I'd like to see the params

On the server side try to obtain the Room object before joining to see if it exists. All you have to do is calling getRoomById() or getRoomByName() on the Zone object and trace the result to the logs.
Lapo

--

gotoAndPlay()

...addicted to flash games
Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Postby Alex » 09 Sep 2011, 13:08

Hi

Here is the client code:

Code: Select all

private function onBtnJoinGameClicked( event:CommonEvent ):void
{
   var params:Object = event.params;
   var jrr:JoinRoomRequest = new JoinRoomRequest( String( params.name ), params.pass, _sfs.lastJoinedRoom.id, params.isSpectator );
   _sfs.send( jrr );
}


I can trace the values in the params object if you wish.

Here is the server code - I do check if the room exists and as I said, it seems that the server code is working.

Code: Select all

public void buddyJoinRoom( User user, ISFSObject sfso ) throws SFSJoinRoomException
{
   User buddy = ce.getApi().getUserByName( sfso.getUtfString( "n" ) );
   
   if(
      buddy != null &&
      buddy.getLastJoinedRoom() != null &&
      buddy.getLastJoinedRoom().isGame() )
      )
   {
      ce.getApi().joinRoom( user, buddy.getLastJoinedRoom(), buddy.getLastJoinedRoom().getPassword(), false, user.getLastJoinedRoom(), true, true );
   }
}
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Sep 2011, 12:44

Your server side code does not check the existence of the Room in the way I explained (please see my second last post). Try adding that check.
The Room could be gone and you're just watching a reference from the Buddy object which points to a Room that is no longer managed by the Zone.
Lapo

--

gotoAndPlay()

...addicted to flash games
Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Postby Alex » 12 Sep 2011, 19:03

Hi

Ok I'll add the check, but the problem is that the room is being sent to the users and when they try to join, they get the error that it no longer exists.

Do you think that adding that check will solve the problem?

If the room is no longer managed by the zone why is being sent to the users?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Sep 2011, 19:21

Is this systematic or sporadic? In other words can you reproduce it?
Lapo

--

gotoAndPlay()

...addicted to flash games
Alex
Posts: 131
Joined: 03 Sep 2006, 09:15

Postby Alex » 14 Sep 2011, 04:31

Hi

I can not reproduce as it is random, but it happens almost every day. I can trace more info if you want - just tell me what you need.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 14 Sep 2011, 05:50

How frequently does it happen during the day? And what's the amount of Rooms in the server?
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Baidu [Spider] and 73 guests