Sitecore Role Manager, Adding a user to a role Error: "Cannot resolve the collation conflict"
Sitecore Role Manager, Adding a user to a role Error: "Cannot resolve the collation conflict"
在角色管理器中,我将用户添加到角色,例如sitecore\Sitecore Local Administrator
。向其中添加用户时(菜单;成员-> 添加)出现错误:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
堆栈跟踪:
[SqlException (0x80131904): Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2442126
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736904
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +628
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58
System.Data.SqlClient.SqlDataReader.get_MetaData() +89
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +379
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2026
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +240
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +81
System.Web.Security.SqlRoleProvider.AddUsersToRolesCore(SqlConnection conn, String usernames, String roleNames) +384
System.Web.Security.SqlRoleProvider.AddUsersToRoles(String[] usernames, String[] roleNames) +724
Sitecore.Security.SwitchingRoleProvider.AddUsersToRoles(String[] userNames, String[] roleNames) +164
Sitecore.Security.<>c__DisplayClass1.<AddUsersToRoles>b__0() +32
Sitecore.Data.DataProviders.NullRetryer.ExecuteNoResult(Action action, Action recover) +161
Sitecore.Data.DataProviders.NullRetryer.ExecuteNoResult(Action action) +15
Sitecore.Security.SitecoreRoleProvider.AddUsersToRoles(String[] userNames, String[] roleNames) +91
System.Web.Security.Roles.AddUsersToRole(String[] usernames, String roleName) +140
Sitecore.Shell.Framework.Commands.RoleManager.AddMember.AddAccounts(ListString roles, ListString users, String roleName) +174
Sitecore.Shell.Framework.Commands.RoleManager.AddMember.Run(ClientPipelineArgs args) +505
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +58
Sitecore.Pipelines.Processor.Invoke(PipelineArgs args) +243
Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +252
Sitecore.Pipelines.Pipeline.Resume() +38
Sitecore.Web.UI.WebControls.ContinuationManager.ResumePipeline(HttpContext httpContext) +461
Sitecore.Web.UI.WebControls.ContinuationManager.OnPreRender(EventArgs e) +299
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4775
您最近升级到 8.2 了吗?
确保您使用的数据库来自同一个 sitecore 更新。
我 运行 从 8.2 initial 移动到 8.2 update 2 时进入这个。
Sitecore 数据库中的默认排序规则级别是 "SQL_Latin1_General_CP1_CI_AS"。我不确定你从哪里得到 "Latin1_General_CI_AS"。您可以尝试执行类似的操作:
SELECT * FROM [model].[sys].[all_columns]
WHERE collation_name = 'Latin1_General_CI_AS'
获取具有 "Latin1_General_CI_AS" 排序规则的所有列。
当您知道导致冲突的列(应该是 "aspnet_****" 表中的一个)时,您可以更改列排序规则:
ALTER TABLE dbo.aspnet_XXX ALTER COLUMN YYY
varchar(ZZZ) COLLATE SQL_Latin1_General_CP1_CI_AS
从评论中的讨论中添加:
据我了解,aspnet_UsersInRoles_AddUsersToRoles 存储过程中会引发错误。只有核心数据库中名为 "aspnet_****" 的表和临时表。如果问题不在现有列中,那么检查默认数据库排序规则是有意义的,因为临时表是使用此位置创建的。因此,查看 Sitecore_Core 数据库属性并检查其排序规则。
我从 'Anton' 的评论中得到了帮助。问题不在于某些 table 中列的排序规则,而是数据库本身。不知何故,数据库的排序规则发生了变化。我将 Sitecore_core
数据库的排序规则设置为 SQL_Latin1_General_CP1_CI_AS
并解决了问题。
在角色管理器中,我将用户添加到角色,例如sitecore\Sitecore Local Administrator
。向其中添加用户时(菜单;成员-> 添加)出现错误:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
堆栈跟踪:
[SqlException (0x80131904): Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2442126
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736904
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +628
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +58
System.Data.SqlClient.SqlDataReader.get_MetaData() +89
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +379
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2026
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +375
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +53
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +240
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +81
System.Web.Security.SqlRoleProvider.AddUsersToRolesCore(SqlConnection conn, String usernames, String roleNames) +384
System.Web.Security.SqlRoleProvider.AddUsersToRoles(String[] usernames, String[] roleNames) +724
Sitecore.Security.SwitchingRoleProvider.AddUsersToRoles(String[] userNames, String[] roleNames) +164
Sitecore.Security.<>c__DisplayClass1.<AddUsersToRoles>b__0() +32
Sitecore.Data.DataProviders.NullRetryer.ExecuteNoResult(Action action, Action recover) +161
Sitecore.Data.DataProviders.NullRetryer.ExecuteNoResult(Action action) +15
Sitecore.Security.SitecoreRoleProvider.AddUsersToRoles(String[] userNames, String[] roleNames) +91
System.Web.Security.Roles.AddUsersToRole(String[] usernames, String roleName) +140
Sitecore.Shell.Framework.Commands.RoleManager.AddMember.AddAccounts(ListString roles, ListString users, String roleName) +174
Sitecore.Shell.Framework.Commands.RoleManager.AddMember.Run(ClientPipelineArgs args) +505
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +58
Sitecore.Pipelines.Processor.Invoke(PipelineArgs args) +243
Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +252
Sitecore.Pipelines.Pipeline.Resume() +38
Sitecore.Web.UI.WebControls.ContinuationManager.ResumePipeline(HttpContext httpContext) +461
Sitecore.Web.UI.WebControls.ContinuationManager.OnPreRender(EventArgs e) +299
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4775
您最近升级到 8.2 了吗?
确保您使用的数据库来自同一个 sitecore 更新。
我 运行 从 8.2 initial 移动到 8.2 update 2 时进入这个。
Sitecore 数据库中的默认排序规则级别是 "SQL_Latin1_General_CP1_CI_AS"。我不确定你从哪里得到 "Latin1_General_CI_AS"。您可以尝试执行类似的操作:
SELECT * FROM [model].[sys].[all_columns]
WHERE collation_name = 'Latin1_General_CI_AS'
获取具有 "Latin1_General_CI_AS" 排序规则的所有列。
当您知道导致冲突的列(应该是 "aspnet_****" 表中的一个)时,您可以更改列排序规则:
ALTER TABLE dbo.aspnet_XXX ALTER COLUMN YYY
varchar(ZZZ) COLLATE SQL_Latin1_General_CP1_CI_AS
从评论中的讨论中添加: 据我了解,aspnet_UsersInRoles_AddUsersToRoles 存储过程中会引发错误。只有核心数据库中名为 "aspnet_****" 的表和临时表。如果问题不在现有列中,那么检查默认数据库排序规则是有意义的,因为临时表是使用此位置创建的。因此,查看 Sitecore_Core 数据库属性并检查其排序规则。
我从 'Anton' 的评论中得到了帮助。问题不在于某些 table 中列的排序规则,而是数据库本身。不知何故,数据库的排序规则发生了变化。我将 Sitecore_core
数据库的排序规则设置为 SQL_Latin1_General_CP1_CI_AS
并解决了问题。