AppVeyor Host Agent service doesn't start on Win10

Thomas Lecocq's Avatar

Thomas Lecocq

26 Feb, 2020 09:41 AM

Hi,

Am trying to set up the BYOC Appveyor on my machine, did the install via PS or directly using the MSI, both lead to the same issue: the service doesn't start. When using the services.msc gui, the error thrown is ERROR 1067: the process terminated unexpectedly. When running the C:\Program Files\AppVeyor\HostAgent\appveyor-host-agent.exe directly in an administrator cmd.exe, the error seems to be linked to permission issues for the logger:

λ  "C:\Program Files\AppVeyor\HostAgent\appveyor-host-agent"
API server URL: http://localhost:5020/
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile is available. Using 'C:\Users\TLecocq\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Unhandled exception. Autofac.Core.DependencyResolutionException: An exception was thrown while activating ?:Microsoft.Extensions.Hosting.IHostedService[] -> Microsoft.AspNetCore.DataProtection.Internal.DataProtectionHostedService -> Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider -> Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.
 ---> Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions`1[Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions], Microsoft.AspNetCore.DataProtection.Internal.IActivator, Microsoft.Extensions.Logging.ILoggerFactory)' on type 'XmlKeyManager'.
 ---> System.AggregateException: An error occurred while writing to logger(s). (Cannot open log for source 'AppVeyor Host Agent'. You may not have write access.)
 ---> System.InvalidOperationException: Cannot open log for source 'AppVeyor Host Agent'. You may not have write access.
 ---> System.ComponentModel.Win32Exception (1722): The RPC server is unavailable.
   --- End of inner exception stack trace ---
   at System.Diagnostics.EventLogInternal.OpenForWrite(String currentMachineName)
   at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
   at System.Diagnostics.EventLogInternal.WriteEvent(EventInstance instance, Byte[] data, Object[] values)
   at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Object[] values)
   at Microsoft.Extensions.Logging.EventLog.WindowsEventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category)
   at Microsoft.Extensions.Logging.EventLog.EventLogLogger.WriteMessage(String message, EventLogEntryType eventLogEntryType, Int32 eventId)
   at Microsoft.Extensions.Logging.EventLog.EventLogLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger.<Log>g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func`3 formatter, List`1& exceptions, TState& state)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions)
   at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger`1.Microsoft.Extensions.Logging.ILogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.LoggerMessage.<>c__DisplayClass5_0`1.<Define>g__Log|0(ILogger logger, T1 arg1, Exception exception)
   at Microsoft.Extensions.Logging.LoggerMessage.<>c__DisplayClass5_0`1.<Define>b__1(ILogger logger, T1 arg1, Exception exception)
   at Microsoft.Extensions.Logging.LoggingExtensions.UsingProfileAsKeyRepositoryWithDPAPI(ILogger logger, String fullName)
   at Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.GetFallbackKeyRepositoryEncryptorPair()
   at Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager..ctor(IOptions`1 keyManagementOptions, IActivator activator, ILoggerFactory loggerFactory, IDefaultKeyStorageDirectories keyStorageDirectories)
   at lambda_method(Closure , Object[] )
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   --- End of inner exception stack trace ---
   at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
   at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   --- End of inner exception stack trace ---
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
   at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.ResolveOptional(IComponentContext context, Type serviceType, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.ResolveOptional(IComponentContext context, Type serviceType)
   at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Appveyor.HostAgent.Program.Main(String[] args)
   at Appveyor.HostAgent.Program.<Main>(String[] args)

I checked the regedit and Computer\HKEY_LOCAL_MACHINE\SOFTWARE\AppVeyor\HostAgent contains the right token.

Is there anything I can modify / allow the appveyor user / test ?

Thanks a lot

  1. 1 Posted by Thomas Lecocq on 26 Feb, 2020 09:51 AM

    Thomas Lecocq's Avatar

    OK, my Windows Event Log service is disabled (issue since last windows update and it goes crazy exporting logs all the time, filling the C disk...) so the Appveyor Host Agent cannot start without the EventLog being active, it seems?

  2. Support Staff 2 Posted by Feodor Fitsner on 26 Feb, 2020 06:28 PM

    Feodor Fitsner's Avatar

    Yep, try with EventLog service enabled/started.

  3. 3 Posted by Thomas Lecocq on 27 Feb, 2020 07:17 AM

    Thomas Lecocq's Avatar

    hi,

    yes, it works. Could it be possible to disable the event logger, I really don't need it :-)

    Cheers & thanks for the help
    Thomas

  4. Support Staff 4 Posted by Feodor Fitsner on 27 Feb, 2020 05:54 PM

    Feodor Fitsner's Avatar

    Well, it's hard-coded right now, but we can add an option to configure it.

  5. Feodor Fitsner closed this discussion on 28 Apr, 2020 09:04 PM.

Comments are currently closed for this discussion. You can start a new one.

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