无法将 2SXC 从 8.2.3 升级到 9.6.1

Cannot upgrade 2SXC from 8.2.3 to 9.6.1

我曾多次尝试将 2SXC 内容从 8.2.3 升级到 9.6.1,并一直 运行ning 进入安装错误。这是一个以前在 7.2.2 上然后升级到 9.1.1 的站点。我在两个版本上都收到了相同的错误。

重现步骤:

  1. 转到安装了 2SXC 8.2.3 的 DNN 9.1.1 中的扩展页面
  2. 上传并尝试将 2SXC 升级到版本 9.6.1

预期行为: 升级无误。

实际行为: 升级过程中出现错误,但是当您重新加载扩展页面时模块似乎已升级。

https://www.screencast.com/t/Y8Gk2ZuzLl

存在特定的升级错误,但也存在大量其他级联错误。

2017-10-23 09:17:27,066 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Data.SqlDataProvider - System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Packages'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script, Int32 timeoutSec)
ClientConnectionId:7df9af36-80ea-46e0-8760-f33a2536071b
Error Number:208,State:1,Class:16
2017-10-23 09:17:27,150 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Services.Installer.Log.Logger - SQL Execution resulted in following Exceptions: 
System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'Packages'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script, Int32 timeoutSec)
ClientConnectionId:7df9af36-80ea-46e0-8760-f33a2536071b
Error Number:208,State:1,Class:16

-- This SQL file is used for the app-module package (in .dnn manifest file) which must not be installed or upgraded if the 2sxc module fails to install

DECLARE @RequiredVersion int
SET @RequiredVersion = 9

DECLARE @RequiredVersionIsInstalled int
SELECT @RequiredVersionIsInstalled = CASE WHEN EXISTS(SELECT * FROM Packages WHERE Name = N'2SexyContent' AND CONVERT(int, LEFT([Version], CHARINDEX('.', [Version])-1)) >= @RequiredVersion) THEN CAST (1 AS BIT) ELSE CAST (0 AS BIT) END

If @RequiredVersionIsInstalled = 0
BEGIN
    RAISERROR(N'2sxc 9 or newer must be installed for the app module to install. Probably something else went wrong while installing - see previous errors for more information. ****************************************************************************************************************************************************************************************************************************************************************************************************************************************************', 16, 1)
    RETURN
END


2017-10-23 09:17:27,224 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Services.Installer.Log.Logger - Installation Failed - Script
2017-10-23 09:17:27,634 [UPENDO-PC1][Thread:30][ERROR] DotNetNuke.Services.Installer.Log.Logger - Package Installation aborted
2017-10-23 09:20:32,338 [UPENDO-PC1][Thread:9][ERROR] DotNetNuke.Services.Exceptions.Exceptions - System.NullReferenceException: Object reference not set to an instance of an object.
   at ToSic.SexyContent.Environment.Dnn7.ImportExportEnvironment.SaveOptions(Int32 zoneId) in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContent\Environment\Dnn7\ImportExportEnvironment.cs:line 186
   at ToSic.Eav.Apps.ImportExport.Import..ctor(Nullable`1 zoneId, Int32 appId, Boolean skipExistingAttributes, Boolean preserveUntouchedAttributes, Log parentLog)
   at ToSic.Eav.Apps.ImportExport.XmlImportWithFiles.ImportXml(Int32 zoneId, Int32 appId, XDocument doc, Boolean leaveExistingValuesUntouched)
   at ToSic.SexyContent.Installer.V8.Version080302() in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer\V8.cs:line 105
   at ToSic.SexyContent.Installer.InstallationController.UpgradeModule(String version) in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer\InstallationController.cs:line 187
   at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.UpgradeModule(String version) in C:\ProjectsSexyContent\Web\DesktopModules\ToSIC_SexyContent\Environment\Dnn7\DnnBusinessController.cs:line 75
   at DotNetNuke.Entities.Modules.EventMessageProcessor.UpgradeModule(EventMessage message)
2017-10-23 09:21:34,131 [UPENDO-PC1][Thread:11][ERROR] DotNetNuke.Framework.Reflection - ToSic.SexyContent.SexyContent
System.Web.HttpException (0x80004005): Could not load type 'ToSic.SexyContent.SexyContent'.
   at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at DotNetNuke.Framework.Reflection.CreateType(String TypeName, String CacheKey, Boolean UseCache, Boolean IgnoreErrors)
2017-10-23 09:21:34,147 [UPENDO-PC1][Thread:11][ERROR] DotNetNuke.Services.Search.ModuleIndexer - System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at DotNetNuke.Services.Search.ModuleIndexer.GetModulesForIndex(Int32 portalId)
2017-10-23 09:21:34,162 [UPENDO-PC1][Thread:11][ERROR] DotNetNuke.Services.Exceptions.Exceptions - System.Exception: Error Creating BusinessControllerClass 'ToSic.SexyContent.SexyContent' of module(2sxc-app) id=(3183) in tab(958) and portal(8) ---> System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at DotNetNuke.Services.Search.ModuleIndexer.GetModulesForIndex(Int32 portalId)
   --- End of inner exception stack trace ---
   at DotNetNuke.Services.Search.ModuleIndexer.ThrowLogError(ModuleInfo module, Exception ex)

有其他人运行遇到这个问题吗,你知道如何解决吗?

我相信你已经找到了 - 但检查 https://2sxc.org/en/blog/post/upgrading-to-2sxc-9-3-requires-2sxc-7

这实际上是通过将缺少的 {databaseOwner} 和 {objectQualifier} 标记添加到 SqlDataProvider 脚本来解决的。可以在下面的拉取请求中看到。

https://github.com/2sic/2sxc/pull/1363