1

I installed Stackify Prefix 3.0.28.0 a few days ago and the profiler was working fine until I restarted my system. After system restart when I tried to open http://localhost:2012 it returned with standard chrome error localhost refused to connect. (ERR_CONNECTION_REFUSED) However, as mentioned in troubleshooting guide at https://docs.stackify.com/docs/prefix-basic-troubleshooting#verify-if-the-stackify-profiler-is-working I noticed that profiler is collecting the data, only http://localhost:2012 is not working.

I tried all options mentioned in the troubleshooting guide including restarting system, IIS, Stackify Prefix Windows Service, and verified System Environment Variables. I also tried replacing localhost with 127:0.0.1, setting Windows Firewall rules for port 2012. Everything seems to be fine but could not get the http://localhost:2012 working.

http://localhost and asp.net application are working fine. As per stackify.log I'm getting following errors (even as log notifies Web server, Named pipe server started):

INFO  2019-10-03 19:18:35,160/GMT [6] Starting web server
INFO  2019-10-03 19:18:35,160/GMT [6] Attempting Binding to http://*:2012
WARN  2019-10-03 19:18:35,269/GMT [6] Error starting web server, will try again
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
   at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(IAppBuilder builder)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer(StartContext context)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
   at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
   at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
   at DevDashWindowsHost.HostProcess.ResetWebserver()
ERROR 2019-10-03 19:18:35,269/GMT [6] Error starting web server again
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
   at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, IDictionary`2 properties)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(IAppBuilder builder)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer(StartContext context)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
   at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
   at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
   at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
   at DevDashWindowsHost.HostProcess.ResetWebserver()
INFO  2019-10-03 19:18:35,269/GMT [6] Web server started
INFO  2019-10-03 19:18:35,269/GMT [6] Starting named pipe server
INFO  2019-10-03 19:18:35,285/GMT [6] Named pipe server started
INFO  2019-10-03 19:18:35,691/GMT [6] Java APM Jar: C:\Program Files (x86)\StackifyPrefix\java\lib\stackify-java-apm-1.16.0.jar (1.16.0)
INFO  2019-10-03 19:18:35,691/GMT [6] Java APM Jar Symlink: OK
INFO  2019-10-03 19:18:35,691/GMT [6] Starting #APM ProfileLogManager

Besides there are multiple other entries like

INFO  2019-10-03 19:18:42,770/GMT [10] POST https://api.stackify.com/api/prefix/GetMessages
INFO  2019-10-03 19:18:46,817/GMT [13] HTTP Status: OK
INFO  2019-10-03 19:18:46,817/GMT [10] POST https://api.stackify.com/api/prefix/DevicePing
INFO  2019-10-03 19:18:48,552/GMT [13] HTTP Status: OK
INFO  2019-10-03 19:19:36,927/GMT [5] Writing INI

Config:

* Windows 10, 64 bit
* Visual Studio 2017 Community 15.9.1
haraman
  • 2,744
  • 2
  • 27
  • 50

3 Answers3

0

I faced the same issue, but in my case the Stackify Prefix Windows Service was stopped, so I just had to start it again.

thyago
  • 31
  • 7
  • 1
    Service is not the issue, it is running, also restarted, and logging in the background but only _localhost:2012_ is not responding. As this post is old, till now I've observed that after system restarts (which I usually do every 25-30 days for performance reasons or Windows updates), sometimes _localhost:2012_ starts responding after a random period of time which varies from 5 days to 20 days, sometimes it never responds. – haraman Feb 09 '20 at 18:42
0

I encountered this same issue when trying out Stackify Prefix. I tried reinstalling a few times but still got the same "localhost refused to connect" error when trying to visit the http://localhost:2012 url. Restarting my machine didn't help.

I noticed during the reinstall it kept trying to install the vcredist c++ 2013 x64/x32 packages, but would fail and skip this step. I went into add/remove programs and found that I already had some 2013 vcredist packages installed previously. I then uninstalled all of these packages, then ran the Stackify Prefix installer again with admin privileges. This time it successfully installed the single vcredist x64 package it needed, then immediately after it opened the Prefix Browser url successfully.


Tldr; This issue was caused by the vcredist c++ 2013 packages already existing on my machine - uninstalling and using the Stackify Prefix installer to install them resolved the issue for me.

J T
  • 71
  • 1
  • 2
  • 5
0

Change the default port from 2012 to an open port on your server/dev workstation.

  1. Open CMD.exe with Admin priviledges.
  2. Run this command netstat -anob > c:\test.txt
  3. Find a listening port, something like this: TCP 0.0.0.0:13 0.0.0.0:0 LISTENING 5240
  4. Go to your your Stackify install folder and open the stackify.ini file. Something like this C:\Program Files (x86)\StackifyPrefix\stackify.ini
  5. Stop Stackify Service StackifyPrefix
  6. Change the Port in the stackify.ini to the open port of your choice. Right below the [Setttings] Like this: [Settings]
    Port=5240
  7. Save stackify.ini file
  8. Start StackifyPrefix Service