Hi Dalmiro,
Many thanks for the response.
We are running Octopus v2.6.4.951 - we upgraded to this a couple of months ago.
As I mentioned, I have had bad experiences with the Repair RavenDB process in the past so I was not confident running it would help in this instance.
Previous events:
We have not made any changes like moving the home folder or changing servers or anything, but we did have trouble with some deployments a few days ago where the following error (pasted below) started appearing. It suggests issues with the RavenDB but the Repair job consistently failed and I ended up having to restore from the previous night’s backup. We had no further issue until we noticed this Project had gone missing.
Padding is invalid and cannot be removed.
System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
at System.Security.Cryptography.CapiSymmetricAlgorithm.DepadBlock(Byte[] block, Int32 offset, Int32 count)
at System.Security.Cryptography.CapiSymmetricAlgorithm.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Raven.Abstractions.Extensions.StreamExtensions.DisposingStream.Dispose(Boolean disposing) in c:\Builds\RavenDB-Stable\Raven.Abstractions\Extensions\StreamExtensions.cs:line 195
at System.IO.Stream.Close()
at Raven.Storage.Esent.StorageActions.DocumentStorageActions.ReadDocumentData(String key, Etag existingEtag, RavenJObject metadata) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\StorageActions\Documents.cs:line 107
at Raven.Storage.Esent.StorageActions.DocumentStorageActions.b__1(JsonDocumentMetadata metadata, Func4 createDocument) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\StorageActions\Documents.cs:line 39 at Raven.Storage.Esent.StorageActions.DocumentStorageActions.DocumentByKeyInternal[T](String key, TransactionInformation transactionInformation, Func
3 createResult) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\StorageActions\Documents.cs:line 70
at Raven.Storage.Esent.StorageActions.DocumentStorageActions.DocumentByKey(String key, TransactionInformation transactionInformation) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\StorageActions\Documents.cs:line 36
at Raven.Database.Impl.DocumentRetriever.GetDocumentWithCaching(String key) in c:\Builds\RavenDB-Stable\Raven.Database\Impl\DocumentRetriever.cs:line 210
at Raven.Database.Impl.DocumentRetriever.RetrieveDocumentInternal(IndexQueryResult queryResult, HashSet1 loadedIds, FieldsToFetch fieldsToFetch, IndexDefinition indexDefinition) in c:\Builds\RavenDB-Stable\Raven.Database\Impl\DocumentRetriever.cs:line 117 at Raven.Database.Impl.DocumentRetriever.ShouldIncludeResultInQuery(IndexQueryResult arg, IndexDefinition indexDefinition, FieldsToFetch fieldsToFetch) in c:\Builds\RavenDB-Stable\Raven.Database\Impl\DocumentRetriever.cs:line 243 at Raven.Database.Indexing.Index.IndexQueryOperation.ShouldIncludeInResults(IndexQueryResult indexQueryResult) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\Index.cs:line 1108 at Raven.Database.Indexing.Index.IndexQueryOperation.<Query>d__52.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\Index.cs:line 939 at Raven.Database.Util.ActiveEnumerable
1.MoveNext() in c:\Builds\RavenDB-Stable\Raven.Database\Util\ActiveEnumerable.cs:line 46
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext()
at Raven.Database.DocumentDatabase.<>c__DisplayClass91.b__88(IStorageActionsAccessor actions) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 1354
at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action1 action, EsentTransactionContext transactionContext) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:line 666 at Raven.Storage.Esent.TransactionalStorage.Batch(Action
1 action) in c:\Builds\RavenDB-Stable\Raven.Database\Storage\Esent\TransactionalStorage.cs:line 617
at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query, Action1 headerInfo, Action
1 onResult) in c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:line 1368
at Raven.Client.Embedded.EmbeddedDatabaseCommands.Query(String index, IndexQuery query, String[] includes, Boolean metadataOnly, Boolean indexEntriesOnly) in c:\Builds\RavenDB-Stable\Raven.Client.Embedded\EmbeddedDatabaseCommands.cs:line 486
at Raven.Client.Document.AbstractDocumentQuery2.ExecuteActualQuery() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\AbstractDocumentQuery.cs:line 664 at Raven.Client.Document.AbstractDocumentQuery
2.get_QueryResult() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\AbstractDocumentQuery.cs:line 633
at Raven.Client.Linq.RavenQueryProviderProcessor1.ExecuteQuery[TProjection]() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\RavenQueryProviderProcessor.cs:line 1511 at Raven.Client.Linq.RavenQueryInspector
1.GetEnumerator() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Linq\RavenQueryInspector.cs:line 105
at System.Collections.Generic.List1..ctor(IEnumerable
1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Octopus.Platform.Documents.Persistence.SessionExtensions.FetchAllUnsynchronized[TDocument](IRavenQueryable
1 query) in y:\work\refs\heads\master\source\Octopus.Platform.Documents\Persistence\SessionExtensions.cs:line 113
at Octopus.Server.Orchestration.Deploy.DeploymentOrchestrator.d__e.MoveNext() in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\DeploymentOrchestrator.cs:line 112
Octopus.Server version 2.6.4.951
Resolution:
Since yesterday, I have managed to recover the missing Project. As an experiment, I manually created a “projects-5” document in the RavenDB. I had realised all the elements used by the project (variablesets-5 / deployment-process-5) were all still existing, it seemed to be just the “projects-5” document record that was missing. Once I manually created it and linked in the various elements it needed (using another project’s metadata as a guideline), the Project appeared again and deployed successfully. Does that sound like a stable solution, or may there be some underlying issues?
This was a better solution to me than trying the not-so-reliable Repair job :\ … and furthermore a full restore which required downtime.
Going forward, would you suggest the Repair DB for most issues? It seems to be the only go-to solution (before a full restore) but I dont know how to identify whether an issue will be solved this way or not, or when the DB is too corrupted for the Repair to make a difference. Are there cases where a Repair is irrelevant and its worth bypassing and going straight to a restore?
Many thanks for your help,
Bronwyn,