Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Errors on importing Module Packages / installing DNN DB from Azure to On Premises SQLErrors on importing Module Packages / installing DNN DB from Azure to On Premises SQL
Previous
 
Next
New Post
5/4/2018 11:38 PM
 

Two common errors that can catch even the more seasoned DNN developers by surprise, which took me the better part of a day when I have to push a site up to production.  Hopefully this helps someone else.

  1.  [FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.ArgumentException: An item with the same key has already been added.
    The cause is Module Controller names are mismatched.  You should get a 'Repair Install' option if you want to overwrite a module.  Part of the decision process in the program logic is the comparison of controller names.  If there's a mismatch somewhere, DNN thinks it's installing a new module.  So it will continue on that path and tell you 'wait a minute, there's a key in the database already with this name.'
    Should this happen, compare the Extension properties on your local site with the server site.  In my case the server site is on Azure:





    Further down the Extension Settings page, find the Module Definitions:


    Make sure the names match in these dialogs between the local and server.
  2. SQL On-Premises errors being thrown when importing a .bacpac file via SSMS:
    Very important -- the issue has been addressed by Microsoft.  You need to be running version 17.6 of SSMS or later.  On the Download screen there is a notice about maintenance programs.  If you're running these, use 17.5.  I'm not sure that this Import issue is fixed in 17.5, just assuming it is.
    Now that all the legal stuff is out of the way ...
    a. Could not import package.
    Warning SQL72012: The object [ISSIDev_Copy_VIA_SSSM_AZURE_Data] exists in the target, but it will not be dropped even though you selected the 'Generate drop statements for objects that are in the target database but that are not in the source' check box. 
    b. Error SQL72014: .Net SqlClient Data Provider: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'EXTERNAL'.
    c. Error SQL72045: Script execution error.  The executed script:CREATE EXTERNAL DATA SOURCE [myDataSource] 
    WITH (
    TYPE = BLOB_STORAGE,
    LOCATION = N'https://dtstestcsv.blob.core.windows.net/sunsource',
    CREDENTIAL = [AzureStorageCredential]
    );
    The fix is a bit detailed.  I thank Sagarika Kondabolu from Microsoft for writing the following.  Note, it took a couple of hours or maybe 3 to resolve this.  She worked through lunch and is commended for doing that. :)  She was seated next to the rep who solved the issue so they collaborated and we all got this one solved.  He'd overheard the issue and helped out.  So thanks very much to you both from me.

    Hi Michael, 

    No problem, thanks for your time too. Below details helps you to post the issue in forums, Feel free to let me know if you need any further details. 

    Symptoms: 

    When using blob storage auditing or threat detection on Azure SQL Server or Database (or) TDE enabled on the database; after you export database to .bacpac file,

    if you import the database to local on-premise SQL Server installation you may get either of following errors (or) both of them: 

    Error 1

    Error SQL72014: .Net SqlClient Data Provider: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'EXTERNAL'.

    Error SQL72045: Script execution error.  The executed script:

    CREATE EXTERNAL DATA SOURCE [xxxxxxx]

        WITH (

        TYPE = BLOB_STORAGE

        LOCATION = N'https://xxxxxxxxxxx',

        CREDENTIAL = [xxxxxxx]

        ); 

    • Drop the ‘External Data Source’ using below script 

    DROP EXTERNAL DATA SOURCE [myDataSource] 

    My edit here -- the name really is 
    [myDataSource] -- just run this script.

    Error 2

    Error SQL72045: Script execution error.  The executed script:

    CREATE MASTER KEY;

    Resolution:

    • Turn OFF auditing and threat detection on the server and on the database
    • Turn OFF TDE encryption on the database (Author Edit -- Transparent Data Encryption ... no wonder I didn't see anything happening when it ran ... :)  Just seeing who's paying attention )
      Then export bacpac file and import it
      An Author Edit here -- this will help you to find the Settings.  Select your database, go to Settings and you'll find these items.


    • Update SSMS to 17.6 and above versions. It has fixes for all ‘Master Key’ related issues -- see above.

    (or)

    • Create password for Master Key and then export bacpac file and import it

         ALTER MASTER KEY ADD ENCRYPTION BY PASSWORD = '<PasswordHere>'; 

    Cause: 

    This caused by a different behavior between Azure SQL DB and Local SQL Server installation. A master key without password is an Azure SQL DB only feature, while local SQL Server installation must have password encryption for master key.

    Scripts to use 

    • Drop External Data Source 

    DROP EXTERNAL DATA SOURCE [myDataSource] 

    • Find Master Keys 

    SELECT d.is_master_key_encrypted_by_server

    FROM sys.databases AS d

    WHERE d.name = '[TestDatabase]'; 

    • Drop Master Key

      DROP MASTER KEY;


    Create password for Master Key 
    ALTER MASTER KEY ADD ENCRYPTION BY PASSWORD = '<PasswordHere>';

Took some time out of a very busy day when I have to push this site out but it's worth it to give back.

Happy DNN'ing,

Michael Durthaler

 
New Post
5/5/2018 2:55 PM
 

Just adding a reply to myself to boost my status :).

Edits to the original entry aren't possible any longer, actually.

Another pitfall is differences between the Extension Page / Package Information Tab in Site / Extensions and the .dnn manifest file in the module project.

See illustration -- The version numbers must match between the .dnn manifest file and the version number on the Package Information Tab or the Install Wizard will create a new module, it won't update an existing one.

The manifest file will update this tab but updates to the tab do not update the .dnn manifest when the module is built in release mode.

This is because 'Create Package' will not work on DNN MVC modules.  The Configuration Manager under the Build menu in Visual Studio must be changed to Release Mode, then the packages will be built from Visual Studio.

There are edits that can be made to Organization, Owner, Core Version and so on that will not force creation of a new module rather than update the intended target module.

Here is an illustration:

In my case, being on a learning curve, an earlier version of the module was causing issues.  The more recent module was placed on the same page with it to verify this and as well the newer module was placed on a different page for comparison.

The Friendly Name of the newer module matched that of the earlier module.  But the newer module was listed by the manifest friendly name on the Extensions page, making it appear that there were 2 different extensions.  Make sure the Package / Friendly names match, the Package / Version Numbers match.  The owner, organization information will not force a new module if unmatched but of course all these tags need to match.

An odd thing with Description -- changes to it will not reflect when 'Repair Install' occurs.  You need to edit the extension and without making any changes click 'Save' or 'Save & Close' and on refresh the Description will update.

These points are all somewhat nit-picky but for a squeaky clean install, are necessary.  

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Errors on importing Module Packages / installing DNN DB from Azure to On Premises SQLErrors on importing Module Packages / installing DNN DB from Azure to On Premises SQL


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out