[SOLVED] Can't connect to admin tool

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

Moderators: Lapo, Bax

spatted
Posts: 4
Joined: 20 Apr 2011, 08:14

[SOLVED] Can't connect to admin tool

Postby spatted » 20 Apr 2011, 08:48

First of all, sorry if this is a noob question. I recently installed SFS2X on a CentOS server remotely. I had to change the main socket port and the admin port because of router restrictions. I also changed the user and password and removed the <allowedAddresses> block in <remoteAdmin>. Here's my server.xml file:

Code: Select all

<serverSettings>
  <socketAddresses>
    <socket address="127.0.0.1" port="4443" type="TCP"/>
  </socketAddresses>
  <ipFilter>
    <addressBlackList>
    </addressBlackList>
    <addressWhiteList>
    </addressWhiteList>
    <maxConnectionsPerAddress>9999999</maxConnectionsPerAddress>
  </ipFilter>
  <flashCrossdomainPolicy>
    <useMasterSocketPolicy>true</useMasterSocketPolicy>
    <policyXmlFile>crossdomain.xml</policyXmlFile>
  </flashCrossdomainPolicy>
  <systemControllerThreadPoolSize>1</systemControllerThreadPoolSize>
  <extensionControllerThreadPoolSize>1</extensionControllerThreadPoolSize>
  <systemControllerRequestQueueSize>20000</systemControllerRequestQueueSize>
  <extensionControllerRequestQueueSize>20000</extensionControllerRequestQueueSize>
  <schedulerThreadPoolSize>1</schedulerThreadPoolSize>
  <protocolCompressionThreshold>1024</protocolCompressionThreshold>
  <protocolMode>BINARY</protocolMode>
  <remoteAdmin>
    <administrators>
      <adminUser>
        <login>myuser</login>
        <password>mypassword</password>
      </adminUser>
    </administrators>
    <adminTcpPort>4444</adminTcpPort>
  </remoteAdmin>
  <bannedUserManager>
    <isAutoRemove>true</isAutoRemove>
    <isPersistent>true</isPersistent>
    <customPersistenceClass></customPersistenceClass>
  </bannedUserManager>
  <extensionRemoteDebug>true</extensionRemoteDebug>
  <useFriendlyExceptions>false</useFriendlyExceptions>
  <mailer>
    <mailHost>test.mail.com</mailHost>
    <mailUser>foo</mailUser>
    <mailPass>pippo</mailPass>
    <smtpPort>25</smtpPort>
    <workerThreads>1</workerThreads>
  </mailer>
  <webServer>
    <isActive>true</isActive>
    <cfgFile>config/jetty/jetty.xml</cfgFile>
  </webServer>
  <startExtensionFileMonitor>true</startExtensionFileMonitor>
  <useFriendlyLogging>true</useFriendlyLogging>
  <useDebugMode>true</useDebugMode>
  <sessionMaxIdleTime>20</sessionMaxIdleTime>
  <userMaxIdleTime>300</userMaxIdleTime>
</serverSettings>


When I try to connect to my server using the admin web interface, I get the message:
Unable to connect to myhost.com:4444


Also, I can telnet remotely to port 4443 (socket) just fine, which shows that the connection is going through. However, I can't telnet to port 4444 (admin). It's not a firewall problem, because both ports are allowed. I already tried interchanging them in the server.xml file and I still can't connect to the one I set as admin.

I tried checking my open ports using

Code: Select all

lsof -Pnl +M

It turns out that only port 4443 (socket) shows up as open; port 4444 (admin) doesn't.

And I see this in the log when I try to connect.

Code: Select all

20 abr 2011 04:40:55,729 INFO  [SocketReader] bitswarm.core.SocketAcceptor     - Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:34402 } on Server port: 4443 <---> 34402
20 abr 2011 04:40:57,338 WARN  [SocketReader] protocol.binary.BinaryIoHandler     - Illegal request size: -184550138 bytes, from: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:34402 }
20 abr 2011 04:40:58,880 INFO  [SocketReader] bitswarm.sessions.DefaultSessionManager     - Session removed: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:34402 }
20 abr 2011 04:40:58,881 WARN  [SocketReader] protocol.binary.BinaryIoHandler     - Incoming request size too large: 168626943, Current limit: 8000000, From: { Id: 1, Type: DEFAULT, Logged: No, IP: 127.0.0.1:34402 }


Any help would be greatly appreciated! :wink:
Last edited by spatted on 23 Apr 2011, 15:38, edited 1 time in total.
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 20 Apr 2011, 10:27

First of all, if you are connecting remotely, you have to change that 127.0.0.1 to the private IP address of the server, and have the traffic to the public IP routed to that private IP.
Also, you have to add another <socket> entry for port 4444.
Paolo Bax
The SmartFoxServer Team
spatted
Posts: 4
Joined: 20 Apr 2011, 08:14

Postby spatted » 20 Apr 2011, 15:41

Thanks for your reply. I added another <socket> entry and put the private IP of the server in both entries. Now I can telnet remotely to both ports. Routing works.

I tried connecting to the admin area again, but, I got an "Invalid administration TCP port" error. The log says this:

Code: Select all

12:26:46,580 INFO  [SocketReader] core.SocketAcceptor     - Session created: { Id: 3, Type: DEFAULT, Logged: No, IP: 201.239.176.201:2862 } on Server port: 4444 <---> 2862
12:26:46,609 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 3, Type: DEFAULT, Logged: No, IP: 201.239.176.201:2862 }
12:27:03,677 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController     - {IN}: Handshake
12:27:03,785 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController     - {IN}: Login
12:27:03,846 WARN  [pool-1-thread-2] managers.SFSExtensionManager     - com.smartfoxserver.v2.exceptions.SFSLoginException: Admin login refused to user 'root': invalid TCP port


I checked in the config file and port 4444 is indeed the correct one. What could be wrong?
spatted
Posts: 4
Joined: 20 Apr 2011, 08:14

Postby spatted » 21 Apr 2011, 23:16

Okay, connection problem solved. I had to add <socket> entries for 127.0.0.1 in addition to the ones pointing to the private IP of the server.

Code: Select all

  <socketAddresses>
    <socket address="127.0.0.1" port="4443" type="TCP"/>
    <socket address="127.0.0.1" port="4444" type="TCP"/>
    <socket address="192.168.1.xxx" port="4443" type="TCP"/>
    <socket address="192.168.1.xxx" port="4444" type="TCP"/>
  </socketAddresses>


Now I get this message:

A disconnection occurred due to unknown reason; please reconnect


And the corresponding error in the log:

Code: Select all

21 abr 2011 19:02:14,276 INFO  [SocketReader] bitswarm.core.SocketAcceptor     - Session created: { Id: 6, Type: DEFAULT, Logged: No, IP: xxx.xxx.xxx.xxx:xxxx } on Server port: 4444 <---> xxxx
21 abr 2011 19:02:14,286 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] v2.controllers.SystemController     - {IN}: Handshake
21 abr 2011 19:02:14,324 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] v2.controllers.SystemController     - {IN}: Login
21 abr 2011 19:02:14,326 WARN  [pool-1-thread-2] entities.managers.SFSExtensionManager     -
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: java.lang.NullPointerException
Message: *** Null ***
Description: Error during event handling: java.lang.NullPointerException, Listener: { Ext: Admin, Type: JAVA, Lev: ZONE, { Zone: --=={{{ AdminZone }}}==-- }, {} }
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.admin.AdminLoginHandler.handleServerEvent(AdminLoginHandler.java:62)
com.smartfoxserver.v2.extensions.SFSExtension.handleServerEvent(SFSExtension.java:242)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.dispatchEvent(SFSExtensionManager.java:762)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.dispatchZoneLevelEvent(SFSExtensionManager.java:687)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.handleServerEvent(SFSExtensionManager.java:880)
com.smartfoxserver.v2.core.SFSEventManager$SFSEventRunner.run(SFSEventManager.java:64)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

21 abr 2011 19:02:36,927 INFO  [Scheduler1-thread-1] bitswarm.sessions.DefaultSessionManager     - Session removed: { Id: 6, Type: DEFAULT, Logged: No, IP: xxx.xxx.xxx.xxx:xxxx }


Any ideas? :cry:
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 23 Apr 2011, 09:39

Do you have a <allowedRemoteAddresses> entry in your server.xml file?
If yes, please show it here, otherwise add it.
Paolo Bax
The SmartFoxServer Team
spatted
Posts: 4
Joined: 20 Apr 2011, 08:14

Postby spatted » 23 Apr 2011, 15:38

bax wrote:Do you have a <allowedRemoteAddresses> entry in your server.xml file?
If yes, please show it here, otherwise add it.

That fixed it! Thanks a lot! :D
p3dro.sola
Posts: 25
Joined: 22 Dec 2009, 17:00

Postby p3dro.sola » 24 Apr 2011, 12:14

I'm having the same problem. I followed all the steps, but it's not working.
I can telnet into both ports.

the logs just says:

Code: Select all

12:13:49,980 INFO  [SocketReader] core.SocketAcceptor     - Session created: { Id: 6, Type: DEFAULT, Logged: No, IP: [my.ip]:53742 } on Server port: 9933 <---> 53742
12:13:50,192 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 6, Type: DEFAULT, Logged: No, IP: [my.ip]:53742 }


my server config is:

Code: Select all

<socketAddresses>
    <socket address="127.0.0.1" port="843" type="TCP"/>
    <socket address="127.0.0.1" port="9933" type="TCP"/>
    <socket address="10.243.22.211" port="843" type="TCP"/>
    <socket address="10.243.22.211" port="9933" type="TCP"/>
  </socketAddresses>

# 10.243.22.211 = internal address

<allowedRemoteAddresses>
      <string>127.0.0.1</string>
      <string>my.ip</string>
    </allowedRemoteAddresses>


[/code]
User avatar
Bax
Site Admin
Posts: 4609
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 26 Apr 2011, 09:27

p3dro.sola,
what is the value of the <adminTcpPort> setting in your configuration?
Paolo Bax
The SmartFoxServer Team
p3dro.sola
Posts: 25
Joined: 22 Dec 2009, 17:00

Postby p3dro.sola » 26 Apr 2011, 09:36

bax wrote:p3dro.sola,
what is the value of the <adminTcpPort> setting in your configuration?


I set it to the same as the regular TCP port, and it works now.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 59 guests