AppVeyor deployment agent crashes on Win Server 2016

mikeb's Avatar

mikeb

Apr 30, 2019 @ 04:09 AM

Hey there - I'm trying to get deployments working (for the first time) using the deployment agent 6.1.0 on an AWS EC2 instance. It's running Win Server 2016 datacenter edition, and when I run the agent service I get:

Application: Appveyor.DeploymentAgent.Service.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.PlatformNotSupportedException
   at System.Net.HttpListener..ctor()
   at Microsoft.Owin.Host.HttpListener.OwinHttpListener..ctor()
   at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Initialize(System.Collections.Generic.IDictionary`2<System.String,System.Object>)

Exception Info: System.Reflection.TargetInvocationException
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Initialize(Owin.IAppBuilder)
   at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(Microsoft.Owin.Hosting.Engine.StartContext)
   at Appveyor.DeploymentAgent.ApiServer.Start()
   at Appveyor.DeploymentAgent.DeploymentAgentHost+<Start>d__20.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

I appear to have .Net framework 4.7.2 installed, as well as .Net core 2.1 - any idea why this might be failing?

  1. 1 Posted by mikeb on Apr 30, 2019 @ 04:39 AM

    mikeb's Avatar

    I solved it.

    The http driver was disabled, and since windows server 2012+ you can only change that in the registry.

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP

    Set Start=3, if it's set to 4 it means the http driver is disabled.

  2. mikeb closed this discussion on Apr 30, 2019 @ 04:44 AM.

  3. Owen McDonnell re-opened this discussion on Apr 30, 2019 @ 03:46 PM

  4. Support Staff 2 Posted by Owen McDonnell on Apr 30, 2019 @ 03:46 PM

    Owen McDonnell's Avatar

    Thanks for the update!

  5. Owen McDonnell closed this discussion on Apr 30, 2019 @ 03:46 PM.

  6. mikeb re-opened this discussion on May 02, 2019 @ 08:40 PM

  7. 3 Posted by mikeb on May 02, 2019 @ 08:40 PM

    mikeb's Avatar

    Hmm this creates a new problem. With HttpSys enabled I can't start my kestrel webserver as port 80 is in use. Not an issue of AppVeyor agent, but this solution alone won't help me.

  8. 4 Posted by mikeb on May 02, 2019 @ 09:01 PM

    mikeb's Avatar

    So it would appear Kestrel (asp.net core) server doesn't use HttpSys and is not compatible with it for port sharing so it can't be enabled. Yet AppVeyor deployment agent requires HttpSys to function.

    It would be nice to not have this dependency in the deployment agent - is it open source? The agent seems to use an HttpListener, using a WebListener or something else that doesn't rely on HttpSys on windows would be a better compatible option.

    My only current option will be to use non-standard ports internally.

  9. 5 Posted by Ilya Finkelshte... on May 02, 2019 @ 09:05 PM

    Ilya Finkelshteyn's Avatar

    .NET Core based deployment agent is coming. It will not depend on http.sys. Please subscribe to the "Technical updates" at https://ci.appveyor.com/notifications to be notified.

  10. 6 Posted by mikeb on May 02, 2019 @ 10:58 PM

    mikeb's Avatar

    will do thanks!

Reply to this discussion

Internal reply

        No formatting (switch to Markdown)

          You can attach files up to 10MB

          If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

            Keyboard shortcuts

            Generic

            ? Show this help
            ESC Blurs the current field

            Comment Form

            r Focus the comment reply box
            ^ + ↩ Submit the comment

            You can use Command ⌘ instead of Control ^ on Mac