【问题标题】:Stackify Prefix http://localhost:2012 refused to connectStackify Prefix http://localhost:2012 拒绝连接
【发布时间】:2020-02-02 04:59:43
【问题描述】:

几天前我安装了 Stackify Prefix 3.0.28.0,并且分析器工作正常,直到我重新启动系统。系统重新启动后,当我尝试打开 http://localhost:2012 时,它返回标准 chrome 错误 localhost 拒绝连接。 (ERR_CONNECTION_REFUSED) 但是,正如https://docs.stackify.com/docs/prefix-basic-troubleshooting#verify-if-the-stackify-profiler-is-working 的故障排除指南中所述,我注意到分析器正在收集数据,只有http://localhost:2012 不起作用。

我尝试了故障排除指南中提到的所有选项,包括重新启动系统、IIS、Stackify Prefix Windows Service,并验证了系统环境变量。我还尝试用 127:0.0.1 替换 localhost,为端口 2012 设置 Windows 防火墙规则。一切似乎都很好,但无法让 http://localhost:2012 工作。

http://localhost 和 asp.net 应用程序工作正常。根据 stackify.log 我收到以下错误(即使日志通知 Web 服务器,命名管道服务器已启动):

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

除此之外还有多个其他条目,例如

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

配置:

* Windows 10, 64 bit
* Visual Studio 2017 Community 15.9.1

【问题讨论】:

    标签: c# asp.net profiler stackify


    【解决方案1】:

    我遇到了同样的问题,但在我的情况下,Stackify Prefix Windows 服务已停止,所以我只需要重新启动它。

    【讨论】:

    • 服务不是问题,它正在运行,也重新启动,并在后台登录,但只有 localhost:2012 没有响应。由于这篇文章很旧,直到现在我观察到在系统重新启动后(出于性能原因或 Windows 更新,我通常每 25-30 天执行一次),有时 localhost:2012 在随机后开始响应从 5 天到 20 天不等的时间段,有时它从不响应。
    【解决方案2】:

    我在试用 Stackify Prefix 时遇到了同样的问题。我尝试重新安装几次,但在尝试访问 http://localhost:2012 url 时仍然出现相同的“localhost 拒绝连接”错误。重新启动我的机器没有帮助。

    我注意到在重新安装期间它一直在尝试安装 vcredist c++ 2013 x64/x32 软件包,但会失败并跳过此步骤。我进入添加/删除程序,发现我之前已经安装了一些 2013 vcredist 软件包。然后我卸载了所有这些包,然后以管理员权限再次运行 Stackify Prefix 安装程序。这次它成功安装了它需要的单个 vcredist x64 包,然后在它成功打开 Prefix Browser url 之后立即。


    Tldr;这个问题是由我的机器上已经存在的 vcredist c++ 2013 包引起的 - 卸载并使用 Stackify Prefix 安装程序来安装它们为我解决了这个问题。

    【讨论】:

      【解决方案3】:

      将默认端口从 2012 更改为服务器/开发工作站上的开放端口。

      1. 以管理员权限打开 CMD.exe。
      2. 运行此命令 netstat -anob > c:\test.txt
      3. 找到一个监听端口,如下所示: TCP 0.0.0.0:13 0.0.0.0:0 监听 5240
      4. 转到您的 Stackify 安装文件夹并打开 stackify.ini 文件。像这样的 C:\Program Files (x86)\StackifyPrefix\stackify.ini
      5. 停止 Stackify 服务 StackifyPrefix
      6. stackify.ini 中的端口更改为您选择的开放端口。 [设置]正下方 像这样: [设置]
        端口=5240
      7. 保存 stackify.ini 文件
      8. 启动StackifyPrefix服务

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-06-25
        • 2018-10-17
        • 2021-02-20
        • 2023-02-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多