Announcement

Collapse
No announcement yet.

What might be blocking ports on XP?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • What might be blocking ports on XP?

    Hi folks

    I have a problem with port access. One of the programs we use needs to connect to a port at system startup and is unable to do so because, according to the application log:

    An exception was detected.
    Code: ApplicationActivation,
    Unable to contact remote server
    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:5150

    I have been in contact with the application developers support team and they say that there must be a program stopping access to the port.

    We use Sophos Enterprise which includes a firewall and the logs do not contain any entires which show that access to the port has been blocked. I also uninstalled the firewall but the port continues to be blocked.

    On the local PC, if I try to telnet to the port I get the following:


    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

    C:\Documents and Settings\blood>telnet 127.0.0.1:5150
    Connecting To 127.0.0.1:25...Could not open connection to the host, on port 23
    : Connect failed

    So, to be honest I have no idea what may be causing this. Something is blocking access to the ports. I get the same ': Connect failed' message on each PC that I try to use telnet on (port 23 is the port that telnet uses to connect).

    The client(s) are XP Pro SP3 in a single Windows 2003 domain. GPO's are minimal, Windows firewall is not active.

    I have used PortQry GUI and get the following result:

    =============================================

    Starting portqry.exe -n 192.168.0.25 -e 5150 -p TCP ...


    Querying target system called:

    192.168.0.25

    Attempting to resolve IP address to a name...


    IP address resolved to mybeautifulcomputer.mywonderfuldomain.local

    querying...

    TCP port 5150 (unknown service): NOT LISTENING
    portqry.exe -n 192.168.0.25 -e 5150 -p TCP exits with return code 0x00000001.


    I do not know what return code 0x00000001 means, so if anyone can shed any light on this or help me expose these ports I will be very grateful.

    Thanks.
    A recent poll suggests that 6 out of 7 dwarfs are not happy

  • #2
    Re: What might be blocking ports on XP?

    Are you sure your application is running and listening? Using Netstat does it show your application as listening?

    Code:
    C:\Users\ahinson>netstat -a
    
    Active Connections
    
      Proto  Local Address          Foreign Address        State
      TCP    0.0.0.0:135                 PC:0            LISTENING
      TCP    0.0.0.0:445                 PC:0            LISTENING
      TCP    0.0.0.0:990                 PC:0            LISTENING
      TCP    0.0.0.0:5357                PC:0            LISTENING
      TCP    0.0.0.0:8888                PC:0            LISTENING
      TCP    0.0.0.0:10124               PC:0            LISTENING
      TCP    0.0.0.0:49152               PC:0            LISTENING
      TCP    0.0.0.0:49153               PC:0            LISTENING
      TCP    0.0.0.0:49154               PC:0            LISTENING
      TCP    0.0.0.0:49155               PC:0            LISTENING
      TCP    0.0.0.0:49174               PC:0            LISTENING
      TCP    0.0.0.0:49175               PC:0            LISTENING
      TCP    127.0.0.1:5354              PC:0            LISTENING
    Andrew

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: What might be blocking ports on XP?

      Running netstat I get:

      C:\Documents and Settings\blood>netstat -a

      Active Connections

      Proto Local Address Foreign Address State
      TCP htl-admin:epmap htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:microsoft-ds htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:1050 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:1051 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:3389 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:4197 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:5225 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:8008 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:8192 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:8193 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:8194 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:1028 localhost:1029 ESTABLISHED
      TCP htl-admin:1029 localhost:1028 ESTABLISHED
      TCP htl-admin:1033 htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:1042 localhost:1043 ESTABLISHED
      TCP htl-admin:1043 localhost:1042 ESTABLISHED
      TCP htl-admin:1120 localhost:5225 ESTABLISHED
      TCP htl-admin:1121 localhost:5225 ESTABLISHED
      TCP htl-admin:1130 localhost:5225 ESTABLISHED
      TCP htl-admin:1131 localhost:5225 ESTABLISHED
      TCP htl-admin:5225 localhost:1120 ESTABLISHED
      TCP htl-admin:5225 localhost:1121 ESTABLISHED
      TCP htl-admin:5225 localhost:1130 ESTABLISHED
      TCP htl-admin:5225 localhost:1131 ESTABLISHED
      TCP htl-admin:netbios-ssn htl-admin.htlincs.local:0 LISTENING
      TCP htl-admin:microsoft-ds syrius.htlincs.local:1324 ESTABLISHED
      TCP htl-admin:microsoft-ds ca5.htlincs.local:2503 ESTABLISHED
      TCP htl-admin:microsoft-ds peach.htlincs.local:3331 ESTABLISHED
      TCP htl-admin:1032 192.168.0.159:8194 ESTABLISHED
      TCP htl-admin:1049 htl-admin.htlincs.local:8194 ESTABLISHED
      TCP htl-admin:1051 htl-admin.htlincs.local:1052 ESTABLISHED
      TCP htl-admin:1052 htl-admin.htlincs.local:1051 ESTABLISHED
      TCP htl-admin:1075 192.168.0.159:epmap TIME_WAIT
      TCP htl-admin:1076 192.168.0.159:53213 TIME_WAIT
      TCP htl-admin:1079 restored.htlincs.local:microsoft-ds TIME_WAIT
      TCP htl-admin:1083 restored.htlincs.local:microsoft-ds TIME_WAIT
      TCP htl-admin:1085 restored.htlincs.local:epmap TIME_WAIT
      TCP htl-admin:1086 restored.htlincs.local:53211 TIME_WAIT
      TCP htl-admin:1090 192.168.0.159:microsoft-ds TIME_WAIT
      TCP htl-admin:1094 restored.htlincs.local:ldap TIME_WAIT
      TCP htl-admin:1095 restored.htlincs.local:microsoft-ds TIME_WAIT
      TCP htl-admin:1097 orion.htlincs.local:microsoft-ds TIME_WAIT
      TCP htl-admin:1102 htl-admin.htlincs.local:netbios-ssn TIME_WAIT
      TCP htl-admin:1115 192.168.0.159:netbios-ssn TIME_WAIT
      TCP htl-admin:1116 blood.htlincs.local:microsoft-ds ESTABLISHED
      TCP htl-admin:1118 192.168.0.23:http TIME_WAIT
      TCP htl-admin:1123 restored.htlincs.local:epmap ESTABLISHED
      TCP htl-admin:1124 restored.htlincs.local:53211 ESTABLISHED
      TCP htl-admin:1127 restored.htlincs.local:ldap TIME_WAIT
      TCP htl-admin:1129 restored.htlincs.local:ldap TIME_WAIT
      TCP htl-admin:3389 blood.htlincs.local:4274 ESTABLISHED
      TCP htl-admin:8194 titan.htlincs.local:4070 ESTABLISHED
      TCP htl-admin:8194 htl-admin.htlincs.local:1049 ESTABLISHED
      UDP htl-admin:microsoft-ds *:*
      UDP htl-admin:isakmp *:*
      UDP htl-admin:1068 *:*
      UDP htl-admin:1119 *:*
      UDP htl-admin:4500 *:*
      UDP htl-admin:ntp *:*
      UDP htl-admin:1034 *:*
      UDP htl-admin:1056 *:*
      UDP htl-admin:1126 *:*
      UDP htl-admin:1900 *:*
      UDP htl-admin:ntp *:*
      UDP htl-admin:netbios-ns *:*
      UDP htl-admin:netbios-dgm *:*
      UDP htl-admin:1900 *:*

      Port 5150 is not listed....
      A recent poll suggests that 6 out of 7 dwarfs are not happy

      Comment


      • #4
        Re: What might be blocking ports on XP?

        This is your problem then. You can't connect if the application isn't listening on the port.

        When the application tries to connect is it connecting locally or to a server? Make sure you're running Netstat on the machine that is accepting connections, not on the one trying to connect.
        Last edited by ahinson; 11th August 2008, 17:12.
        Andrew

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment


        • #5
          Re: What might be blocking ports on XP?

          Thanks for the reply.

          Sorry for the muddled question - I have asked the wrong question because I did not really understand what the problem was.

          What happens is that first the application service tries to start and fails:

          Event Type: Error
          Event Source: SageHRService
          Event Category: None
          Event ID: 0
          Date: 11/08/2008
          Time: 09:34:30
          User: N/A
          Computer: HTL-ADMIN
          Description:
          Service cannot be started. System.Net.Sockets.SocketException: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
          at System.Net.Sockets.Socket.Shutdown(SocketShutdown how)
          at MySql.Data.Common.SocketStream.Read(Byte[] buffer, Int32 offset, Int32 count)
          at System.IO.BufferedStream.ReadByte()
          at MySql.Data.MySqlClient.PacketReader.ReadHeader()
          at MySql.Data.MySqlClient.PacketReader.OpenPacket()
          at MySql.Data.MySqlClient.NativeDriver.Open()
          at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledCo nnection()
          at MySql.Data.MySqlClient.MySqlPool.GetPooledConnecti on()
          at MySql.Data.MySqlClient.MySqlPool.GetConnection()
          at MySql.Data.MySqlClient.MySqlPoolManager.GetConnect ion(MySqlConnectionString settings)
          at MySql.Data.MySqlClient.MySqlConnection.Open()
          at Sage.SBD.HR.Remoting.Server.HRService.Data.DataCon nector.GetSchemaVersion()
          at Sage.SBD.HR.Remoting.Server.HRService.HRSe...

          Therefore, when the application is started the application's service is not running the application therefore fails - that is when the '5150 is actively refused' is logged. The application is Sage HR (formerly Sage Personnel).

          If I run services.msc I can start the service without a problem, 5150 is used, and the application will subsequently start.

          I have been in contact with Sage support but their help, which is usually excellent, has been limited with this. They say that the port is being blocked, but I really have no idea what may be causing this. If the port is being blocked, would the service be able to connect to it when I manually start the service?

          The event above states the service cannot be started because the socket is not connected. That is the bit that I do not understand - why will a manual start of the service be successful when an automatic one fails?

          Thanks for the help so far.
          A recent poll suggests that 6 out of 7 dwarfs are not happy

          Comment


          • #6
            Re: What might be blocking ports on XP?

            I think what is happening is that the service is trying to start before MySQL is ready to accept connections. Once it fails the time it takes you to manually launch it allows it to complete it's "start up".

            What you can do is add a dependency service to the service that's failing to start.

            It would look something like this for the service:

            Regedit, browse to...
            HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\ServiceThatIsFailing
            Add if not exist, "DependOnService", Reg_Multi_SZ
            Value: ServiceNameToDependOn (i.e. MySQL)

            Reboot see if it helped. If not you can always undo it.

            Also, don't forget to set failure actions for the service. You can make it automatically restart itself and wait X min between restarts so it will attempt to resolve the failure to launch situation.
            Last edited by ahinson; 12th August 2008, 18:37.
            Andrew

            ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

            Comment


            • #7
              Re: What might be blocking ports on XP?

              That looks like it may sort the problem out. I will run it by Sage support before trying it and see what they say.

              Many thanks for your reply!
              A recent poll suggests that 6 out of 7 dwarfs are not happy

              Comment

              Working...
              X