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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Install Errors in 07.04.01Module Install Errors in 07.04.01
Previous
 
Next
New Post
7/28/2015 3:03 AM
 

Hi 

I was attempting to install a new module by accessing the Host/Extensions page ,But in last step (Package Installation Report) get the following error:

"

System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_DesktopModulePermission_Roles". The conflict occurred in database "myzndnn2", table "dbo.Roles", column 'RoleID'. The statement has been terminated. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at PetaPoco.Database.ExecuteScalar[T](String sql, Object[] args) at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteScalar[T](String connectionString, CommandType type, String sql, Object[] args) at DotNetNuke.Data.DataProvider.AddDesktopModulePermission(Int32 portalDesktopModuleID, Int32 permissionID, Int32 roleID, Boolean allowAccess, Int32 userID, Int32 createdByUserID) at DotNetNuke.Security.Permissions.DesktopModulePermissionController.AddDesktopModulePermission(DesktopModulePermissionInfo objDesktopModulePermission) at DotNetNuke.Entities.Modules.DesktopModuleController.AddDesktopModuleToPortal(Int32 portalId, Int32 desktopModuleId, Boolean addPermissions, Boolean clearCache) at DotNetNuke.Entities.Modules.DesktopModuleController.AddDesktopModuleToPortals(Int32 desktopModuleId) at DotNetNuke.Services.Installer.Installers.ModuleInstaller.Commit() at DotNetNuke.Services.Installer.Installers.PackageInstaller.Commit() at DotNetNuke.Services.Installer.Installers.PackageInstaller.Install() at DotNetNuke.Services.Installer.Installer.InstallPackages(Boolean& clearClientCache) at DotNetNuke.Services.Installer.Installer.Install()

"

I checked the Roles table and found that the -1, -2, and -3 roles did exist and try re-run /portals/dataproviders/sqldataprovider/07.04.01.SqlDataProvider.Unfortunately,I could not find solve

 

Thanks in advance

 
New Post
7/28/2015 4:18 AM
 

Shanahz,

please try to find the line(s) in the module's install script that causes this error, must be something like

   INSERT INTO {databaseOwner}{objectQualifier}DesktopModulePermission (...)
   VALUES (...)

or

   INSERT INTO {databaseOwner}{objectQualifier}DesktopModulePermission (...)
   SELECT ...

and post them here.

Happy DNNing!
Michael


Michael Tobisch
DNN★MVP
dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
7/28/2015 5:02 AM
 
/****** Object:  StoredProcedure [dbo].[AddDesktopModulePermission]    Script Date: 07/28/2015 13:26:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddDesktopModulePermission]
    @PortalDesktopModuleID Int, -- not null!
    @PermissionId          Int, -- not null!
    @RoleId                Int, -- might be negative for virtual roles
    @AllowAccess           Bit, -- false: deny, true: grant
    @UserId                Int, -- -1 is replaced by Null
    @CreatedByUserId       Int  -- -1 is replaced by Null
AS
BEGIN
    INSERT INTO dbo.[DesktopModulePermission] (
        [PortalDesktopModuleID],
        [PermissionID],
        [RoleID],
        [AllowAccess],
        [UserID],
        [CreatedByUserID],
        [CreatedOnDate],
        [LastModifiedByUserID],
        [LastModifiedOnDate]
    ) VALUES (
        @PortalDesktopModuleID,
        @PermissionID,
        @RoleId,
        @AllowAccess,
        CASE WHEN @UserId = -1 THEN Null ELSE @UserId END,
        CASE WHEN @CreatedByUserID = -1 THEN Null ELSE @CreatedByUserID END,
        GetDate(),
        CASE WHEN @CreatedByUserID = -1 THEN Null ELSE @CreatedByUserID END,
        GetDate()
    )
    SELECT SCOPE_IDENTITY()

END

 

when I replace @RoleId by a constant value (fore example: 2,) , my install is done but if i use this stored procedure, my module not install. this problem occurred for all modules.

 
New Post
7/28/2015 6:42 AM
 
is RoleID in DesktopModulePermission Table defined to accept Null values?

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/28/2015 7:48 AM
 
Sebastian,

by default yes - NULL Values are allowed.

But this does not seem to be the problem - the Stored Procedure that Shanahz sent is the standard DNN stored procedure to add a DektopModulePermission. As far as I understood there is an install script that adds a record to the DesktopModulePermissions table by calling this SP - or something in the IUpgradeable interface that uses the public UI to do that.

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP
dnn-Connect.org - The most vibrant community around the DNN-platform
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesModule Install Errors in 07.04.01Module Install Errors in 07.04.01


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out