U4-432 - Unhandeled Exception when using Active Directory Membership Provider

Created by Sebastiaan Janssen 19 Aug 2012, 14:52:49 Updated by Shannon Deminick 21 Jun 2017, 07:52:13

We are using the AD membership provider without issue. I recently tried to add a user to out Umbraco 4.7.0 install, and was unsuccessful due to an unhandeled exception. The unhandeled exception occurred because the email address for the user in AD was blank. Obviously one method to fix this is to not have a blank email in AD. However, I thought I should report this since it would be better to notify that an email is required rather than dropping to a trace.

The exception was thrown the first time the user tried to log-in to Umbraco. It occurred prior to account creation, and so the user cannot be added with a blank email.

The trace is:

Server Error in '/' Application.


The parameterized query '(@lang nvarchar(2),@name nvarchar(3),@lname nvarchar(3),@email n' expects the parameter '@email', which was not supplied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The parameterized query '(@lang nvarchar(2),@name nvarchar(3),@lname nvarchar(3),@email n' expects the parameter '@email', which was not supplied.

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): The parameterized query '(@lang nvarchar(2),@name nvarchar(3),@lname nvarchar(3),@email n' expects the parameter '@email', which was not supplied.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6312253 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6313986 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +538 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +689 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +327 Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +167 umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +150

[SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery] umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +261 umbraco.BusinessLogic.User.MakeNew(String name, String lname, String passw, String email, UserType ut) +608 umbraco.cms.presentation.login.ActiveDirectoryMapping(String loginName, String email) +148 umbraco.cms.presentation.login.Button1_Click(Object sender, EventArgs e) +483 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

''Originally created on CodePlex by [ksheppard|http://www.codeplex.com/site/users/view/ksheppard]'' on 9/14/2011 12:51:59 PM [Codeplex ID: 30470 - Codeplex Votes: 1]

Comments

Shannon Deminick 21 Jun 2017, 07:52:14

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint:

Story Points:

Cycle: