Couldn't start profiling session: timed out waiting for port

marcfmarcf Posts: 1 New member
edited February 14, 2019 1:16PM in ANTS Performance Profiler
Attempting to use ANTS Performance Profiler for the first time on a production server to profile an ASP.NET web application.

It fails with the following when I ask it to use the existing port:
Couldn't start the profiling session
Cause: Timed out waiting for port 8002 on 127.0.0.1 to become available

I get the same error when I ask it to use an unused port:
Couldn't start the profiling session
Cause: Timed out waiting for port 8015 on 127.0.0.1 to become available

Note the application normally takes 15 seconds to load the very first page due to warm-up.

The last lines from the log file as as follows:
14 Feb 2019 12:58:21.054 [13] INFO  RedGate.Profiler.Engine.Startup.Basic.Attacher - Found runtime version v4.0.30319
14 Feb 2019 12:58:28.102 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.IisRunner - Initializing ASP.NET session, running on IIS
14 Feb 2019 12:58:28.102 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.IisRunner - Initializing IIS 7/7.5 session
14 Feb 2019 12:58:28.102 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.IisRunner - IIS: Profiling on unused port
14 Feb 2019 12:58:28.102 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.IisRunner - IIS: Profiling application at http://127.0.0.1:8002/
14 Feb 2019 12:58:28.102 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.IisRunner - IIS: Port is 8015
14 Feb 2019 12:58:28.102 [18] WARN  RedGate.Profiler.Engine.Startup.IIS.IISUtilities - About to get site for URL
14 Feb 2019 12:58:30.024 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseSessionRunner - Line-level blacklist alwaysApply="true"; applying blacklist
14 Feb 2019 12:58:30.040 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseSessionRunner - Newtonsoft.Json is in the line-level blacklist file; excluding from line-level timing
14 Feb 2019 12:58:30.040 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseSessionRunner - log4net is in the line-level blacklist file; excluding from line-level timing
14 Feb 2019 12:58:30.040 [18] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseSessionRunner - Castle.Core is in the line-level blacklist file; excluding from line-level timing
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseRunner - Launching session
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseRunner - Launch: Will request elevation
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Logic.Controllers.Session.Type.BaseRunner - Options: IL timings turned on
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Engine.Startup.Sessions.BaseSession - ANTS is running under a 64-bit version of Windows. 32-bit binaries were found in C:\WINDOWS\SysWOW64.
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Engine.Startup.Sessions.BaseSession - InetSrv directory is C:\WINDOWS\system32\inetsrv
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Engine.Startup.Sessions.BaseSession - InetSrv WOW64 directory is C:\WINDOWS\SysWOW64\inetsrv
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Engine.Startup.Sessions.BaseSession - Trying to start the IIS profiler service
14 Feb 2019 12:58:30.040 [22] INFO  RedGate.Profiler.Engine.Startup.Sessions.BaseSession - The IIS service appears to be registered; requesting that it start now

I can see a new w3wp.exe process is spawned and it sits at a constant 5,676 K memory according to Task Manager.
Tagged:

Answers

  • Hi @marcf,

    If you try to attach to the running process using the "Attach to .NET 4+ process" does that work successfully?

    Also, the obvious question of, is there actually something using the ports in question?  In the case of the original port it would be whether the ANTS Performance Profiler 10 service could restart the IIS page to launch it on the original port; for the unused port it could be something using it that you were not aware of.

    A few other things to check:
    • Just to confirm, after this happens, are there any related errors in Event Viewer (Windows log>Application)?
    • Do you have an antivirus enabled? We've seen antiviruses cause the error in your log a few times; if you do have one, can you please try disabling it temporarily to test if that allows the profiler to connect to the IIS process?
    • Does it still fail if you run the profiler explicitly as administrator? (I realize you may be an admin on the machine but UAC may still block some operations if enabled.)
    • Do you have any non http/https bindings?  Open IIS manager, check your bindings for the site you are trying to profile, remove (if only temporarily) all bindings except for any http and https bindings (i.e. net.tcp, net.pipe, net.msmq, msmq.formatname), and then try profiling again?

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
  • If you're still having problems with IIS profiling please update to 10.1.4 and try again. This may not fix your particular issue but we identified a problem with IIS and have fixed it in this version.
    Have you visited our Help Centre?
  • Resolved for us.  We had this same issue.  Same error messages.  Tried the above but still the issue persisted.  We were using the shared configuration option and application directories were all on a network share.  We converted to non-shared and moved all the directories local and this fixes the issue.

    So the resolution for us was to convert from shared config and app on network shares to non-shared all local on the web server.
  • Thats great to know, thank you @BaseBall_99 .
    Have you visited our Help Centre?
Sign In or Register to comment.