Windows server 2003x64 and Deployment Manager Agent

Automated deployment for web applications and databases

Windows server 2003x64 and Deployment Manager Agent

Postby oleg_sh » Mon Mar 03, 2014 3:34 pm

Hello, Dear colleagues, help to deal with a problem.
I downloaded the last Deployment Manager version.
I installed the Agent on Windows 2003 x64. The service after start stops. Windows Management Framework, .NET Framework 4.0, PowerShell 2.0 and IIS 6.0 was installed.

Event Viewer:
After start service:


Code: Select all
2014-03-03 16:41:42,390 [5] WARN  RedGate.Deploy.Startup [(null)] - Tried to load C:\\Program Files (x86)\\Red Gate\\Deployment Agent\\Agent\\Plugins\\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\\SQLite.Interop.dll as potential plugin, but failed.
System.BadImageFormatException: Could not load file or assembly 'file:///C:\\Program Files (x86)\\Red Gate\\Deployment Agent\\Agent\\Plugins\\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\\SQLite.Interop.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///C:\\Program Files (x86)\\Red Gate\\Deployment Agent\\Agent\\Plugins\\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\\SQLite.Interop.dll'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at RedGate.Deploy.Agent.Plugins.PluginsModule.GetPotentialPluginAssemblies()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].



2014-03-03 16:41:45,656 [9] ERROR RedGate.Deploy.Shared.Startup.Host [(null)] - System.Security.Cryptography.CryptographicException: Object already exists.

   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
   at System.Security.Cryptography.X509Certificates.X509Utils._ExportCertificatesToBlob(SafeCertStoreHandle safeCertStoreHandle, X509ContentType contentType, IntPtr password)
   at System.Security.Cryptography.X509Certificates.X509Certificate.ExportHelper(X509ContentType contentType, Object password)
   at System.Security.Cryptography.X509Certificates.X509Certificate.Export(X509ContentType contentType)
   at RedGate.Deploy.Shared.Security.CertificateEncoder.ToBase64String(X509Certificate2 certificate, X509ContentType exportType)
   at RedGate.Deploy.Shared.Configuration.AgentConfiguration.set_AgentCertificate(X509Certificate2 value)
   at RedGate.Deploy.Shared.Configuration.AgentConfiguration.GenerateNewCertificate()
   at RedGate.Deploy.Shared.Configuration.AgentConfiguration.get_AgentCertificate()
   at RedGate.Deploy.Agent.Services.AgentServiceHostStarter.SetupCredentials(ServiceHost host)
   at RedGate.Deploy.Shared.Services.ServiceHostStarter.LaunchServiceHost(Uri address, ServiceMetadata service)
   at RedGate.Deploy.Shared.Services.ServiceHostStarter.Start()
   at RedGate.Deploy.Agent.Commands.RunAgentCommand.Start()
   at RedGate.Deploy.Shared.Startup.WindowsServiceHost.RunService()


For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


EventType clr20r3, P1 redgate.deploy.agent.exe, P2 2.4.4.5, P3 530e1475, P4 mscorlib, P5 4.0.0.0, P6 517a1c71, P7 5b3f, P8 6, P9 udta330idobh2roz2ayvlcelag5agtls, P10 NIL.





Application: RedGate.Deploy.Agent.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.Cryptography.CryptographicException
Stack:
   at RedGate.Deploy.Shared.Startup.WindowsServiceHost.RunService()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()



At Agent Tools start
Code: Select all
2014-03-03 16:49:03,562 [1] FATAL RedGate.Deploy.Tools.Infrastructure.UnhandledErrorTrapper [(null)] - Could not start Deployment Manager tools.
Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(RedGate.Deploy.Shared.Configuration.IMutableAgentConfiguration)' on type 'SecurityTabViewModel'. ---> System.Security.Cryptography.CryptographicException: Object already exists.

   at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
   at System.Security.Cryptography.X509Certificates.X509Utils._ExportCertificatesToBlob(SafeCertStoreHandle safeCertStoreHandle, X509ContentType contentType, IntPtr password)
   at System.Security.Cryptography.X509Certificates.X509Certificate.ExportHelper(X509ContentType contentType, Object password)
   at RedGate.Deploy.Shared.Security.CertificateEncoder.ToBase64String(X509Certificate2 certificate, X509ContentType exportType)
   at RedGate.Deploy.Shared.Configuration.AgentConfiguration.set_AgentCertificate(X509Certificate2 value)
   at RedGate.Deploy.Shared.Configuration.AgentConfiguration.GenerateNewCertificate()
   at RedGate.Deploy.Shared.Configuration.AgentConfiguration.get_AgentCertificate()
   at RedGate.Deploy.Tools.Views.AgentTabs.SecurityTabViewModel..ctor(IMutableAgentConfiguration agentConfiguration)
   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)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   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)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
   at RedGate.Deploy.Tools.Views.AgentModule.CreateShell(IComponentContext container)
   at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
   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)
   at Autofac.Core.Resolving.InstanceLookup.Execute()
   at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, 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.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters)
   at RedGate.Deploy.Tools.App.OnStartup(StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)



At Deployment Manager Tools.exe start

Code: Select all
2014-03-03 16:49:56,671 [5] WARN  RedGate.Deploy.Startup [(null)] - Tried to load C:\\Program Files (x86)\\Red Gate\\Deployment Agent\\Agent\\Plugins\\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\\SQLite.Interop.dll as potential plugin, but failed.
System.BadImageFormatException: Could not load file or assembly 'file:///C:\\Program Files (x86)\\Red Gate\\Deployment Agent\\Agent\\Plugins\\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\\SQLite.Interop.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///C:\\Program Files (x86)\\Red Gate\\Deployment Agent\\Agent\\Plugins\\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\\SQLite.Interop.dll'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at RedGate.Deploy.Agent.Plugins.PluginsModule.GetPotentialPluginAssemblies()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\\Software\\Microsoft\\Fusion!EnableLog].
oleg_sh
 
Posts: 3
Joined: Mon Mar 03, 2014 3:06 pm

Postby james.billings » Mon Mar 03, 2014 9:44 pm

This may occur if the agent was previously run under a different account, or if permissions are insufficient to access the keystore.
Can you check the agent account has full control to “Documents and Settings\\All Users\\Application Data\\Microsoft\\Crypto\\RSA\\ Machine Keysâ€
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Re:

Postby oleg_sh » Tue Mar 04, 2014 7:40 am

[quote="james.billings"]This may occur if the agent was previously run under a different account, or if permissions are insufficient to access the keystore.
Can you check the agent account has full control to “Documents and Settings\\All Users\\Application Data\\Microsoft\\Crypto\\RSA\\ Machine Keysâ€
oleg_sh
 
Posts: 3
Joined: Mon Mar 03, 2014 3:06 pm

Postby oleg_sh » Tue Mar 04, 2014 1:08 pm

Installation of the old version helped. Thanks.
oleg_sh
 
Posts: 3
Joined: Mon Mar 03, 2014 3:06 pm

Re:

Postby ATimson » Thu May 01, 2014 3:53 am

[quote="james.billings"]This may occur if the agent was previously run under a different account, or if permissions are insufficient to access the keystore.
Can you check the agent account has full control to “Documents and Settings\\All Users\\Application Data\\Microsoft\\Crypto\\RSA\\ Machine Keysâ€
ATimson
 
Posts: 11
Joined: Thu May 01, 2014 3:48 am

Postby james.billings » Thu May 01, 2014 8:18 am

Is this a completely fresh install with the very latest downloaded version, or was there previous an installation of DM on the same machine?
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Postby ATimson » Thu May 01, 2014 12:19 pm

Completely fresh install; there was no previous agent installation on the machine.

Our DM server is still on 2.4.8.34 (8 April 2014). If yesterday's patch had an agent update, then we're not on the *very* latest version, but it's certainly close. (The agent installer was freshly downloaded from the DM server before installing.)
ATimson
 
Posts: 11
Joined: Thu May 01, 2014 3:48 am

Postby james.billings » Thu May 01, 2014 12:24 pm

It might well be worth upgrading - I have a feeling this issue only affected one particular version (most likely the one you have!)
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Postby ATimson » Thu May 01, 2014 2:21 pm

I've upgraded the server & agent to v2.4.10.68, and I'm still seeing the same problem.
ATimson
 
Posts: 11
Joined: Thu May 01, 2014 3:48 am

Postby james.billings » Thu May 01, 2014 2:39 pm

OK- looking back at the ticket raised from the original user, they uninstalled DM and reverted to this build: ftp://support.red-gate.com/patches/Depl ... anager.zip

That worked OK, and they could add the agent. Once done, they could upgrade to the latest release OK.

I'll let the development team know this still seems to be a problem in the meantime.
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Postby ATimson » Thu May 01, 2014 5:59 pm

Thank you for that link - very useful. Getting to the newest version wasn't exactly straight-forward - I don't know if it's because the DM server & the agents were so out of sync, or if it was because of some other issue - but with some finessing I've successfully been able to install the Agent & deploy to the boxes. :)

1) Install the old Agent MSI.

2) Run the Agent Tools to add the DM server key, and get the agent key.

3) Upgrade the Agent to the newest version via MSI.

(Upgrading from the DM web failed: "System.ServiceModel.Security.SecurityNegotiationException: The remote agent 'XXX' rejected a connection from this Deployment Manager server. This happens when the Agent does not have the key of this Deployment Manager in its trusted Deployment Manager list. Please run the Programs->Agent Tools application on the remote machine, and verify that an entry for 'XXX' exists in the list of Trusted Deployment Manager Servers.")

4) Add the Agent to DM and deploy as normal.

Thanks again for your assistance!
ATimson
 
Posts: 11
Joined: Thu May 01, 2014 3:48 am

Postby james.billings » Fri May 02, 2014 7:45 am

Glad to hear that's working now! I've let the team know in case there's still some obscure bug here; but you're only the second person to bump into this kind of problem from what I can tell, so hopefully it's just one of those things.

Post back if you continue to have trouble.
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Postby Totu » Wed May 21, 2014 12:32 pm

Hi James,

Just to let you know, we have stumbled upon this problem as well at Skyscanner.

It didn't keep us from doing successful deployments so we just ignored it but it would be nice to have a better understanding of this so we know the implications and how to fix it.

I'll get back once I did some investigation on this and may have some questions about it.

Cheers,
Balint
Bálint Bartha, Skyscanner
Totu
 
Posts: 11
Joined: Mon Apr 07, 2014 2:38 pm

Postby james.billings » Wed May 21, 2014 12:34 pm

I think this problem related to 2003 based Agents, but (should be) fixed in the very latest release.

If that's not the case for you, post back though!
james.billings
 
Posts: 1120
Joined: Wed Jun 16, 2010 11:10 am
Location: Red Gate

Postby Totu » Wed May 21, 2014 12:58 pm

Hi James,

We are using Windows 2008 for the RGDM server and still seem to have this problem.
Updating can be an option as we might be behind by several releases.
I will come back to you in a week or so to let you know what are the results of my investigation.


Cheers,
Balint
Bálint Bartha, Skyscanner
Totu
 
Posts: 11
Joined: Mon Apr 07, 2014 2:38 pm

Next

Return to Deployment Manager

Who is online

Users browsing this forum: No registered users and 1 guest

cron