Deployment Manager Broke
SteveGTR
Posts: 91
Everything was going great. Developers and management are loving DM.
Then today DM broke. I believe the problem occurred because of not enough disk space on the DM server. This results because the Windows\Temp\Nuget files are not being cleaned up. I've previously posted a message concerning this. I cleared out the deadwood in the Temp directory, but that didn't help.
The problem started when a developer did a manual build which automatically deploys to Development. DeploymentManager.exe generated the following message:
Now DM is unresponsive. When we try to manually deploy via the portal it just sits at the queuing request stage (the 1st step). Tried to check health functionality and it just sits forever at queuing request.
Rebooted DM server, restart DM service and agent with no success.
I looked at the application event log on the DM server and there are problems:
I'm not sure how to proceed as we are dead in the water now. I could reinstall and reconfigure DM and the agent on the server. I will wait for feedback.
Then today DM broke. I believe the problem occurred because of not enough disk space on the DM server. This results because the Windows\Temp\Nuget files are not being cleaned up. I've previously posted a message concerning this. I cleared out the deadwood in the Temp directory, but that didn't help.
The problem started when a developer did a manual build which automatically deploys to Development. DeploymentManager.exe generated the following message:
Deployment Manager Command Line Tools version 2.3.0.21 Finding project: PAGE Handshaking with Deployment Manager server: http://server:8080/api Handshake successful. Deployment Manager version: 2.3.12.4; API version: 1.0.0 Finding steps for project... Getting package versions for each step... Using latest version (0.20131217.1) of package MergePage. Using latest version (2.3.31.289) of package WebPage. A --releaseversion parameter was not specified, so a version number was automatically selected based on the highest package version: 2.3.31.289 Creating release: 2.3.31.289 POST http://server:8080/api/projects/projects-1/releases Release created successfully! POST http://server:8080/api/projects/projects-1/releases/releases-1697/deployments Successfully scheduled release '2.3.31.289' for deployment to environment 'Development' Deployment not yet finished. It's taken 00:00:00.0625000 so far. Deployment not yet finished. It's taken 00:00:10.5937500 so far. Deployment not yet finished. It's taken 00:00:20.6406250 so far. Deployment not yet finished. It's taken 00:00:30.6875000 so far. Deployment not yet finished. It's taken 00:00:40.7343750 so far. Deployment not yet finished. It's taken 00:00:50.7812500 so far. Deployment not yet finished. It's taken 00:01:00.8125000 so far. Deployment not yet finished. It's taken 00:01:10.8750000 so far. Deployment not yet finished. It's taken 00:01:20.9375000 so far. Deployment not yet finished. It's taken 00:01:31 so far. Deployment not yet finished. It's taken 00:01:41.0468750 so far. Deployment not yet finished. It's taken 00:01:51.0781250 so far. Deployment not yet finished. It's taken 00:02:01.1406250 so far. Deployment not yet finished. It's taken 00:02:12.3125000 so far. Deployment not yet finished. It's taken 00:02:22.3593750 so far. Unexpected character encountered while parsing value: <. Path '', line 2, position 1. Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 2, position 1. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonTextReader.ReadInternal() at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value) at RedGate.Deploy.DeploymentManagerTools.Client.DeploymentManagerSession.Get[TResource](String path) at RedGate.Deploy.DeploymentManagerTools.Client.DeploymentManagerSession.GetTask(DeploymentResource deployment) at RedGate.Deploy.DeploymentManagerTools.Commands.DeploymentWatcher.<>c__DisplayClass8.<WaitForDeploymentsToFinish>b__0(DeploymentResource x) at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at RedGate.Deploy.DeploymentManagerTools.Commands.DeploymentWatcher.WaitForDeploymentsToFinish(IDeploymentManagerSession session, DeploymentResource[] deployments, TimeSpan timeout, TimeSpan deploymentStatusCheckSleepCycle, Boolean displayDeploymentLog) at RedGate.Deploy.DeploymentManagerTools.Commands.DeployCommandBase.DoDeployment(ReleaseResource release, IEnumerable`1 deployToEnvironmentNames) at RedGate.Deploy.DeploymentManagerTools.Commands.DeployCommandBase.ExecuteImpl() at RedGate.Deploy.DeploymentManagerTools.Commands.ApiCommand.Execute() at RedGate.Deploy.Shared.Startup.CommandProcessor.<ProcessAsync>d__4.MoveNext() Deployment manager returned error: 1
Now DM is unresponsive. When we try to manually deploy via the portal it just sits at the queuing request stage (the 1st step). Tried to check health functionality and it just sits forever at queuing request.
Rebooted DM server, restart DM service and agent with no success.
I looked at the application event log on the DM server and there are problems:
2013-12-18 11:31:29,785 [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() === Pre-bind state information === LOG: User = NT AUTHORITY\SYSTEM LOG: Where-ref bind. Location = C:\Program Files (x86)\Red Gate\Deployment Agent\Agent\Plugins\RedGate.Deploy.SqlServerDbPackage.AgentPlugin\SQLite.Interop.dll LOG: Appbase = file:///C:/Program Files (x86)/Red Gate/Deployment Agent/Agent/ LOG: Initial PrivatePath = NULL Calling assembly : (Unknown). === LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Program Files (x86)\Red Gate\Deployment Agent\Agent\RedGate.Deploy.Agent.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Attempting download of new URL file:///C:/Program Files (x86)/Red Gate/Deployment Agent/Agent/Plugins/RedGate.Deploy.SqlServerDbPackage.AgentPlugin/SQLite.Interop.dll. ERR: Failed to complete setup of assembly (hr = 0x80131018). Probing terminated.
I'm not sure how to proceed as we are dead in the water now. I could reinstall and reconfigure DM and the agent on the server. I will wait for feedback.
Comments
Getting ready to reinstall since I haven't heard back. Disappointing...
I uninstalled DM and reinstalled using the newly downloaded image. Amazingly all my settings were still in tact, but it still doesn't appear to work.
11 minutes and counting on the Check Health screen:
Settings -> Activity history -> Manual health check
Loading...
Details
Started: Wednesday, December 18, 2013 2:18 PM -05:00
By user: administrator
Duration: 11 minutes
Completed: Queued...
Status: Queued
After the install, I checked the Application Event Log and the portal is no longer throwing the error. No other errors in the other log files.
15 minutes with the Manual health check screen. Nothing appears to be happening. I'll try to manually deploy again, but I anticipate that it will just sit there at the queue state.
My next step would be to uninstall, manually remove all the deployment folders, reinstall, and then totally reconfigure DM. I'd prefer not to do this, but its not working now...
This is really making DM look bad when I thought we were really making a case for using this product beyond our development environment. How can I justify DM when the product breaks like this and is unrepairable? If anything, this begs for the need of a contingency plan for when DM fails in the future.
Anyway, for your issue you have done all the obvious stuff - restarting, reinstalling and so on. I think the 'SQLite.Interop.dll' error is probably /not/ related as I see this in the logs when I do a SQL deployment myself and it all works OK.
Are you OK for disk space now? If so, then there's a couple of possibilities. One is that it's trying to work with a corrupt cached package, so you may want to clear out C:\ProgramData\Red Gate\DeploymentManager\Data\PackageCache.
Given that even the healthcheck is not working though it suggests /possibly/ that your database is corrupt in some way and needs to be restored. Therefore I'd suggest having a look in C:\ProgramData\Red Gate\DeploymentManager\Data\Backups and seeing if there is a backup from before the original issue occurred - copy the backup file (and probably a few preceding ones) elsewhere on the machine. In addition, make a copy of the 'feed' folder (C:\ProgramData\Red Gate\DeploymentManager\Data\feed) as the next step will be to delete the 'data' folder (you want to keep your feed contents!)
To restore the data, you will need to follow these steps:
- Stop DM (just the service)
- Delete the ‘Data’ folder
- Restart the services
- Run the smuggler restore command for the relevant .dmbak, for example:
Open an elevated command prompt, then go to C:\Program Files (x86)\Red Gate\Deployment Manager\Server folder and then the command to run would be:
Raven.Smuggler.exe in http://localhost:10300/ mybackup.dmbak
(replacing the filename with the appropriate one you copied out of the data folder earlier.
That will run the restore process. Once done, restart the service again, and ideally the web portal in IIS too, then see if it works...
I'll ask the DM team to look at this post tomorrow in case you're still having trouble
Redgate Software
To answer your questions and provide additional information:
Yes, there is plenty of free space now.
We just did another build and now DeploymentManager.exe reports:
Resource not found: deployment with id deployments-1985, release releases-1729 and project projects-
Suggests to me missing data. You can try browsing the datastore directly to see if deployment-1985 is there for example:
http://localhost:10300/raven/studio.html#/documents?database=%3Csystem%3E&collection=Deployments
or the release-1729:
http://localhost:10300/raven/studio.html#/documents?database=%3Csystem%3E&collection=Deployments
Do you have data leading up to that point? It's still sounding to me like a restore may be needed, but I'm afraid as we're in the UK the dev-team aren't here for me to confirm until tomorrow
Redgate Software
I'm going to have to create a job on the server to clear out the \Windows\Temp\Nuget directory for now so that we don't run into this problem again.
Thanks again
Redgate Software