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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...What can cause error msg  What can cause error msg 'An Unexpected Error Occurred During Registration... ??
Previous
 
Next
New Post
3/31/2009 11:39 AM
 

Success!  At least in producing an error in the Event Viewer.  Here it is below.

AssemblyVersion: 04.09.02
PortalID: 0
PortalName: SDInet
UserID: 6
UserName: David.Jamell.SU
ActiveTabID: 42
ActiveTabName: User Accounts
RawURL: /Admin/UserAccounts/tabid/42/ctl/Edit/mid/359/filter/All/currentpage/1/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://sdinet.sdicorp.com/Admin/UserAccounts/tabid/42/ctl/Edit/mid/359/filter/All/currentpage/1/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 31abecaa-53ad-4e92-b344-8bf02ef3ba6f
InnerException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UserProfile_Users". The conflict occurred in database "SDINet", table "dbo.Users", column 'UserID'. The statement has been terminated.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Data.SqlClient.SqlConnection.OnError
StackTrace:
Message: System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UserProfile_Users". The conflict occurred in database "SDINet", table "dbo.Users", column 'UserID'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, String spName, Object[] parameterValues) at DotNetNuke.Security.Membership.Data.SqlDataProvider.UpdateProfileProperty(Int32 ProfileId, Int32 UserId, Int32 PropertyDefinitionID, String PropertyValue, Int32 Visibility, DateTime LastUpdatedDate) at DotNetNuke.Security.Profile.DNNProfileProvider.UpdateUserProfile(UserInfo user) at DotNetNuke.Entities.Profile.ProfileController.UpdateUserProfile(UserInfo objUser) at DotNetNuke.Security.Membership.AspNetMembershipProvider.CreateUser(UserInfo& user)
Source:
Server Name: SDI-CNPROD
 

 
New Post
3/31/2009 1:40 PM
 

Hi David,

Like layers of an onion, we have peeled back one more clue as to the source of your problem.  The error you posted above is a manifestation of an exception management issue at the very lowest level of the membership provider (for which I created a work item), but it does not reveal the actual source of your error.

There is almost certainly a problem with your AddUser stored procedure, likely caused by upgrade or data integrity issue (apropos, I have recently been helping another user with a similar issue).  I can provide some an additional assembly that will aid in revealing the ultimate error, but I'd recommend posting the contents of that procedure here before we proceed.  It should read:

 

 

ALTER PROCEDURE [dbo].[AddUser]


 @PortalID int,

 @Username nvarchar(100),

 @FirstName nvarchar(50),

 @LastName nvarchar(50),

 @AffiliateId    int,

 @IsSuperUser    bit,

 @Email          nvarchar(256),

 @DisplayName    nvarchar(100),

 @UpdatePassword bit,

 @Authorised bit


AS


DECLARE @UserID int


SELECT @UserID = UserID

 FROM   dbo.Users

 WHERE  Username = @Username


IF @UserID is null

 BEGIN

 INSERT INTO dbo.Users (

 Username,

 FirstName, 

 LastName, 

 AffiliateId,

 IsSuperUser,

 Email,

 DisplayName,

 UpdatePassword

   )

 VALUES (

 @Username,

 @FirstName, 

 @LastName, 

 @AffiliateId,

 @IsSuperUser,

 @Email,

 @DisplayName,

 @UpdatePassword

 )


 SELECT @UserID = SCOPE_IDENTITY()

 END


IF @IsSuperUser = 0

 BEGIN

 IF not exists ( SELECT 1 FROM dbo.UserPortals WHERE UserID = @UserID AND PortalID = @PortalID )

 BEGIN

 INSERT INTO dbo.UserPortals (

 UserID,

 PortalID,

 Authorised

 )

 VALUES (

 @UserID,

 @PortalID,

 @Authorised

 )

 END

 END


SELECT @UserID


 

 

Brandon 


Brandon Haynes
BrandonHaynes.org
 
New Post
3/31/2009 6:55 PM
 

No problem.  Here is the contents of that procedure from my database.  I went over it twice and it seems to be exactly the same, but I'll let you be the judge.

ALTER PROCEDURE [dbo].[AddUser]

 @PortalID  int,
 @Username  nvarchar(100),
 @FirstName  nvarchar(50),
 @LastName  nvarchar(50),
 @AffiliateId    int,
 @IsSuperUser    bit,
 @Email          nvarchar(256),
 @DisplayName    nvarchar(100),
 @UpdatePassword bit,
 @Authorised  bit

AS

DECLARE @UserID int

SELECT @UserID = UserID
 FROM   dbo.Users
 WHERE  Username = @Username

IF @UserID is null
 BEGIN
  INSERT INTO dbo.Users (
   Username,
   FirstName,
   LastName,
   AffiliateId,
   IsSuperUser,
   Email,
   DisplayName,
   UpdatePassword
    )
  VALUES (
   @Username,
   @FirstName,
   @LastName,
   @AffiliateId,
   @IsSuperUser,
   @Email,
   @DisplayName,
   @UpdatePassword
  )

  SELECT @UserID = SCOPE_IDENTITY()
 END

IF @IsSuperUser = 0
 BEGIN
  IF not exists ( SELECT 1 FROM dbo.UserPortals WHERE UserID = @UserID AND PortalID = @PortalID )
   BEGIN
    INSERT INTO dbo.UserPortals (
     UserID,
     PortalID,
     Authorised
    )
    VALUES (
     @UserID,
     @PortalID,
     @Authorised
    )
   END
 END

SELECT @UserID


.

 
New Post
4/2/2009 10:28 AM
 

Hi David,

Your SP looks fine.  There is likely an integrity issue causing this problem.

Please execute the following SQL against your database to see if you can generate the error without having to do more library replacement.  If this fails, I will compile some additional debugging libraries for you to try:

SET XACT_ABORT ON

BEGIN TRANSACTION

EXEC [AddUser]
    0,
    'username',
    'firstname',
    'lastname',
    null,
    0,
    'email@email.com',
    'displayname',
    0,
    1

ROLLBACK TRANSACTION

I'd advise replacing the random strings above with the actual data that you were using via the UI, this will expose any esoteric foreign key issues that might exist.

Deeper into the rabbit hole we go...
 

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
4/2/2009 8:03 PM
 

When trying to issue this against the database using SQL Server Management Studio on the Server Console I get a dialog box titled "SQL Syntax Errors Encountered" with the following error:

The Set SQL construct or statement is not supported.

I click "OK" to dismiss the dialog box and get another dialog box titled "Microsoft SQL Server Management Studio" with the following error:

SQL Execution Error.

Executed SQL statement: SET XACT_ABORT ON BEGIN TRANSACTION EXEC [AddUser] 0, 'test.user', 'test', 'user', null, 0, 'testuser@sdicorp.com', 'testuser', 0, 1 ROLLBACK TRANSACTION

Error Source .Net SqlClient Data Provider
Error Message: Cannot insert the value NULL into 'EMPID', table 'SDINet.dbo.User_Profile'; column does not allow nulls. INSERT fails.

The statement has been terminated.

Am I doing something wrong, or is this the error you expected?

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...What can cause error msg  What can cause error msg 'An Unexpected Error Occurred During Registration... ??


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