Virtual Happy Hour is canceled this month (March) due to Good Friday.
Try our conversational search powered by Generative AI!
AI OnAI Off
Virtual Happy Hour is canceled this month (March) due to Good Friday.
EPiServer.CMS.Core 11.3.3
EPiServer.CMS.Core 11.4.0
Feb 27, 2018
Mar 02, 2018
CMS Core
Closed, Fixed and tested
Steps to reproduce
Expected: No errors in logs.
Actual: You get the error below.
NOTE: There is nothing wrong with the behavior of the job. The problem is if there are no versions to trim, you get this error message in the log, since a counter becomes NULL instead of 0. There is no error message if there are versions to trim.
2018-02-27 15:41:12,727 [11] ERROR EPiServer.Util.Internal.TrimContentVersionsJob: Provider with key '' throwed exception when calling IContentVersionRepositoryEx.ListObsolete System.InvalidCastException: Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at EPiServer.DataAccess.Internal.ContentVersionDB.<>c__DisplayClass5_0.<ListObsoleteVersions>b__0() in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\DataAccess\Internal\ContentVersionDB.cs:line 102 at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0() in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer.Data\Providers\Internal\SqlDatabaseExecutor.cs:line 197 at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer.Data\Providers\SqlTransientErrorsRetryPolicy.cs:line 72 at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.Execute[TResult](Func`1 action) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer.Data\Providers\Internal\SqlDatabaseExecutor.cs:line 192 at EPiServer.DataAccess.Internal.ContentVersionDB.ListObsoleteVersions(Int32 maxPreviouslyPublishedVersions, Int32 maxResultCount, Int32& totalCount) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\DataAccess\Internal\ContentVersionDB.cs:line 85 at EPiServer.DataAbstraction.Internal.DefaultContentVersionRepository.ListObsolete(Int32 maxRows, Int32& totalCount) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\DataAbstraction\Internal\DefaultContentVersionRepository.cs:line 268 at EPiServer.Util.Internal.TrimContentVersionsJob.<>c__DisplayClass15_1.<Execute>b__2() in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\Util\Internal\TrimContentVersionsJob.cs:line 70 at EPiServer.Util.Internal.TrimContentVersionsJob.ExecuteInTryCatch(Func`1 failureAction, Action action) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\Util\Internal\TrimContentVersionsJob.cs:line 132 System.InvalidCastException: Object cannot be cast from DBNull to other types. at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ToInt32(Object value) at EPiServer.DataAccess.Internal.ContentVersionDB.<>c__DisplayClass5_0.<ListObsoleteVersions>b__0() in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\DataAccess\Internal\ContentVersionDB.cs:line 102 at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass31_0`1.<Execute>b__0() in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer.Data\Providers\Internal\SqlDatabaseExecutor.cs:line 197 at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer.Data\Providers\SqlTransientErrorsRetryPolicy.cs:line 72 at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.Execute[TResult](Func`1 action) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer.Data\Providers\Internal\SqlDatabaseExecutor.cs:line 192 at EPiServer.DataAccess.Internal.ContentVersionDB.ListObsoleteVersions(Int32 maxPreviouslyPublishedVersions, Int32 maxResultCount, Int32& totalCount) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\DataAccess\Internal\ContentVersionDB.cs:line 85 at EPiServer.DataAbstraction.Internal.DefaultContentVersionRepository.ListObsolete(Int32 maxRows, Int32& totalCount) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\DataAbstraction\Internal\DefaultContentVersionRepository.cs:line 268 at EPiServer.Util.Internal.TrimContentVersionsJob.<>c__DisplayClass15_1.<Execute>b__2() in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\Util\Internal\TrimContentVersionsJob.cs:line 70 at EPiServer.Util.Internal.TrimContentVersionsJob.ExecuteInTryCatch(Func`1 failureAction, Action action) in E:\BuildAgent\work\d8a53ffc288aa397\src\EPiServer\Util\Internal\TrimContentVersionsJob.cs:line 132