2sic / 2sxc

DNN + 2sxc = #DNNCMS - This tool helps web designers and developers prepare great looking content in DNN (DotNetNuke). It's like mixing DNN with Umbraco and Drupal :)
http://2sxc.org
MIT License
145 stars 41 forks source link

Cannot upgrade from 8.2.3 to 9.6.1 #1345

Closed WillStrohl closed 7 years ago

WillStrohl commented 7 years ago

I've tried several times to upgrade 2SXC content from 8.2.3 to 9.6.1 and keep running into an installation error. This is a site that was previously on 7.2.2 and then upgraded to 9.1.1. I received the same error on both versions.

Steps to Reproduce:

  1. Go to the Extensions page in DNN 9.1.1 with 2SXC 8.2.3 installed
  2. Upload and attempt to upgrade 2SXC to version 9.6.1

Expected Behavior: The upgrade occurs without error.

Actual Behavior: There is an error during upgrade, but the module appears to be upgraded when you reload the extensions page.

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

There are specific upgrade errors, but there are a large number of other errors cascaded as well.

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:\Projects\2SexyContent\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:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer\V8.cs:line 105
   at ToSic.SexyContent.Installer.InstallationController.UpgradeModule(String version) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer\InstallationController.cs:line 187
   at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.UpgradeModule(String version) in C:\Projects\2SexyContent\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)

Has anyone else run into this, and do you know how to resolve it?

I also put this into StackOverflow: https://stackoverflow.com/questions/46894300/cannot-upgrade-2sxc-from-8-2-3-to-9-6-1

iJungleboy commented 7 years ago

So to give some context - the 2sxc-zip contains three modules:

  1. the image resizer
  2. 2sxc content
  3. 2sxc app

The 2sxc-app is simply a placeholder to drag in an app instead of content, but to give it an own icon it's provided as an own package. Now the app should not install if 2sxc-content fails to install - this is what the check does - it checks if 2sxc v9 is installed, before it installs / upgrades the app. This check is what you're seeing failing on the installation. So basically there are three possibilities

  1. the installation/upgrade fails - and the check correctly catches it
  2. The check is running at the wrong moment, causing invalid errors
  3. the installation is ok, but the check is wrong, thereby not upgrading the app-package

Since the message says "can't find 'Packages'" to me it appears that it's looking for a table "Packages" where dnn-extensions are listed, and not finding it.

So I don't have an answer yet - but this additional info might help you corner the issue.

iJungleboy commented 7 years ago

Quick question: are you using the standard sql / DB object qualifier? or did you do something custom. So is your table called dbo.Packages or is it something different?

iJungleboy commented 7 years ago

@hismightiness any update on this? especially regarding object qualifier / table name?

iJungleboy commented 7 years ago

Will close because of inactivity for now.

WillStrohl commented 7 years ago

Sorry... I often don't see the GitHub updates. This is related to this:

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

WillStrohl commented 7 years ago

Oh, and I only just now found this:

https://2sxc.org/en/blog/post/upgrading-to-2sxc-9-3-requires-2sxc-7

iJungleboy commented 7 years ago

ok, I hope that fixes it

WillStrohl commented 7 years ago

It resolved this specific issue for me.