【问题标题】:SQL Server on EC2 - Cannot use SQL Server auth in SSMSEC2 上的 SQL Server - 无法在 SSMS 中使用 SQL Server 身份验证
【发布时间】:2019-02-26 06:38:25
【问题描述】:

在 Windows EC2 实例上的 SQL Server 上,当我使用我的域帐户登录 RDP 时,使用 SQL Server 帐户(通常为sa)登录 SSMS 会静默失败。对话框消失了,但对象资源管理器中没有显示连接(并且任何 Windows 事件日志中都没有新条目)。

问题不存在时:

  • 我使用 Windows 身份验证登录 SSMS。
  • 或者当我使用本地 Windows 帐户登录 RDP 时。
  • 或者当我使用本地 Windows 帐户启动 SSMS - 这是我当前的解决方法

其他细节:

  1. 我的工作站是 Mac(我正在使用“Microsoft 远程桌面”连接到 RDP 会话)。

  2. 我的帐户位于“受信任”域中,并在多个域中拥有权限。 SQL Server 所在的域信任我的用户帐户所在的域。

  3. 我的帐户不是域管理员

  4. 我的账号是本机的本地管理员,继承其权限如下:

    • 我的用户帐户是名为“SQLAdmins.TrustedDomain.net”的组(在受信任域中)的成员(不是真正的名称,但您明白了)

    • 计算机位于名为“SQLServers.TrusingDomain1.net”的 OU(在信任域中)

    • “SQLAdmins.TrustedDomain.net”的成员是“SQLServers.TrusingDomain1.net”OU 中服务器的本地管理员。

    • 使用我的帐户登录后,我可以执行我尝试过的任何“管理”任务(创建帐户、授予本地管理员成员资格等)。

  5. 我尝试过的所有服务器上都存在此问题。运行 SQL Server Enterprise Edtn 的 Windows Enterprise Edtn 2012R2。 2014 和 Windows 2016 Enterprise Edtn。运行 SQL Server 2016 Enterprise Edtn。也尝试使用开发者版 - 相同的问题。

  6. 我不能说这些细节是否相关,所以我将这个列表中的#6 和#7 与其他的区别开来。我也无法使用域帐户安装 SQL Server(命令行或 GUI),但我可以使用本地帐户。安装程序提前失败 - 安装日志包含下面发布的错误(包含一些编辑) - 引用委托(可能意味着“模拟”? - 我想不出它如何/为什么会击中另一台服务器以需要“委托”。 ..)

  7. 我们的安全人员不喜欢“无约束委派”,虽然我不能说“具体为什么”或“有多少”它不受欢迎 - 老实说,我还没有学过“无约束委派”。 :-)

任何想法这可能是什么?这个问题似乎应该非常“可用于谷歌”,但我一直无法解决它。

这是我尝试使用我的域帐户安装 SQL Server 时的安装日志(失败)。同样,我不确定这个问题是否与我所询问的 SSMS 登录问题有关。

Overall summary:
 Final result: Failed: see details below
 Exit code (Decimal): -2068774911
 Exit facility code: 1201
 Exit error code: 1
 Exit message: There was an error generating the XML document.
 Start time: 2018-09-20 20:04:48
 End time: 2018-09-20 20:05:11
 Requested action: Install
 Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=13.0.4001.0&EvtType=0xE0C083E6%400xB2215DAC&EvtType=0xE0C083E6%400xB2215DAC

Setup completed with required actions for features.
Troubleshooting information for those features:
 Next step for SQLEngine: SQL Server Setup was canceled before completing the operation. Try the setup process again.
 Next step for Replication: SQL Server Setup was canceled before completing the operation. Try the setup process again.
 Next step for Conn: SQL Server Setup was canceled before completing the operation. Try the setup process again.
 Next step for Writer: SQL Server Setup was canceled before completing the operation. Try the setup process again.
 Next step for Browser: SQL Server Setup was canceled before completing the operation. Try the setup process again.


Machine Properties:
 Machine name: EC2AMAZ-#######
 Machine processor count: 2
 OS version: Microsoft Windows Server 2016 Datacenter (10.0.14393)
 OS service pack:
 OS region: United States
 OS language: English (United States)
 OS architecture: x64
 Process architecture: 64 Bit
 OS clustered: No

Product features discovered:
 Product Instance Instance ID Feature  Language Edition Version Clustered Configured
 SQL Server 2016  SSMS  1033  13.0.16106.4 No Yes
 SQL Server 2016  Adv_SSMS  1033  13.0.16106.4 No Yes
 SQL Server 2016  Integration Services 1033 Enterprise Edition: Core-based Licensing 13.1.4001.0 No Yes

Package properties:
 Description: Microsoft SQL Server 2016
 ProductName: SQL Server 2016
 Type: RTM
 Version: 13
 Installation location: E:\x64\setup\
 Installation edition: Enterprise Edition: Core-based Licensing

 Slipstream: True
 SP Level 1

Product Update Status:
 Success: KB 3182545

Product Updates Selected for Installation:
 Title: Microsoft SQL Server 2016 with SP1
 Knowledge Based Article: KB 3182545
 Version: 13.1.4001.0
 Architecture: x64
 Language: 1033

 Update Source: Slipstream


User Input Settings:
 ACTION: Install
 ADDCURRENTUSERASSQLADMIN: false
 AGTSVCACCOUNT: TrustingDomain1\sql.agent
 AGTSVCPASSWORD: *****
 AGTSVCSTARTUPTYPE: Automatic
 ASBACKUPDIR: Backup
 ASCOLLATION: Latin1_General_CI_AS
 ASCONFIGDIR: Config
 ASDATADIR: Data
 ASLOGDIR: Log
 ASPROVIDERMSOLAP: 1
 ASSERVERMODE: MULTIDIMENSIONAL
 ASSVCACCOUNT: <empty>
 ASSVCPASSWORD: <empty>
 ASSVCSTARTUPTYPE: Automatic
 ASSYSADMINACCOUNTS: <empty>
 ASTELSVCACCT: <empty>
 ASTELSVCPASSWORD: <empty>
 ASTELSVCSTARTUPTYPE: 0
 ASTEMPDIR: Temp
 BROWSERSVCSTARTUPTYPE: Disabled
 CLTCTLRNAME: <empty>
 CLTRESULTDIR: <empty>
 CLTSTARTUPTYPE: 0
 CLTSVCACCOUNT: <empty>
 CLTSVCPASSWORD: <empty>
 CLTWORKINGDIR: <empty>
 COMMFABRICENCRYPTION: 0
 COMMFABRICNETWORKLEVEL: 0
 COMMFABRICPORT: 0
 CONFIGURATIONFILE: C:\SetupScripts\ConfigurationFile.ini
 CTLRSTARTUPTYPE: 0
 CTLRSVCACCOUNT: <empty>
 CTLRSVCPASSWORD: <empty>
 CTLRUSERS: <empty>
 ENABLERANU: false
 ENU: true
 EXTSVCACCOUNT: NT Service\MSSQLLaunchpad
 EXTSVCPASSWORD: <empty>
 FEATURES: SQLENGINE, REPLICATION, CONN
 FILESTREAMLEVEL: 0
 FILESTREAMSHARENAME: <empty>
 FTSVCACCOUNT: <empty>
 FTSVCPASSWORD: <empty>
 HELP: false
 IACCEPTROPENLICENSETERMS: true
 INDICATEPROGRESS: false
 INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server\
 INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server\
 INSTALLSQLDATADIR: I:\MSSQL\Data
 INSTANCEDIR: C:\Program Files\Microsoft SQL Server
 INSTANCEID: MSSQLSERVER
 INSTANCENAME: MSSQLSERVER
 ISSVCACCOUNT: NT Service\MsDtsServer130
 ISSVCPASSWORD: <empty>
 ISSVCSTARTUPTYPE: Automatic
 ISTELSVCACCT: <empty>
 ISTELSVCPASSWORD: <empty>
 ISTELSVCSTARTUPTYPE: 0
 MATRIXCMBRICKCOMMPORT: 0
 MATRIXCMSERVERNAME: <empty>
 MATRIXNAME: <empty>
 MRCACHEDIRECTORY:
 NPENABLED: 0
 PBDMSSVCACCOUNT: <empty>
 PBDMSSVCPASSWORD: <empty>
 PBDMSSVCSTARTUPTYPE: 0
 PBENGSVCACCOUNT: <empty>
 PBENGSVCPASSWORD: <empty>
 PBENGSVCSTARTUPTYPE: 0
 PBPORTRANGE: <empty>
 PBSCALEOUT: false
 PID: *****
 QUIET: false
 QUIETSIMPLE: true
 ROLE:
 RSINSTALLMODE: DefaultNativeMode
 RSSHPINSTALLMODE: DefaultSharePointMode
 RSSVCACCOUNT: <empty>
 RSSVCPASSWORD: <empty>
 RSSVCSTARTUPTYPE: Automatic
 SAPWD: *****
 SECURITYMODE: SQL
 SQLBACKUPDIR: P:\Backups
 SQLCOLLATION: SQL_Latin1_General_CP1_CI_AS
 SQLSVCACCOUNT: TrustingDomain1\sql.service
 SQLSVCINSTANTFILEINIT: true
 SQLSVCPASSWORD: *****
 SQLSVCSTARTUPTYPE: Automatic
 SQLSYSADMINACCOUNTS: TrustedDomain\SQLAdmins
 SQLTELSVCACCT: NT Service\SQLTELEMETRY
 SQLTELSVCPASSWORD: <empty>
 SQLTELSVCSTARTUPTYPE: Automatic
 SQLTEMPDBDIR: I:\MSSQL\TempDB
 SQLTEMPDBFILECOUNT: 8
 SQLTEMPDBFILEGROWTH: 256
 SQLTEMPDBFILESIZE: 512
 SQLTEMPDBLOGDIR: F:\User Logs
 SQLTEMPDBLOGFILEGROWTH: 128
 SQLTEMPDBLOGFILESIZE: 512
 SQLUSERDBDIR: D:\User Data
 SQLUSERDBLOGDIR: F:\User Logs
 SUPPRESSPRIVACYSTATEMENTNOTICE: false
 TCPENABLED: 1
 UIMODE: Normal
 UpdateEnabled: true
 UpdateSource: Slipstream
 USEMICROSOFTUPDATE: false
 X86: false

 Configuration file: C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20180920_200447\ConfigurationFile.ini

Detailed results:
 Feature: Database Engine Services
 Status: Failed: see logs for details
 Reason for failure: Setup was canceled for the feature.
 Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

 Feature: SQL Server Replication
 Status: Failed: see logs for details
 Reason for failure: Setup was canceled for the feature.
 Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

 Feature: Client Tools Connectivity
 Status: Failed: see logs for details
 Reason for failure: Setup was canceled for the feature.
 Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

 Feature: SQL Writer
 Status: Failed: see logs for details
 Reason for failure: Setup was canceled for the feature.
 Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

 Feature: SQL Browser
 Status: Failed: see logs for details
 Reason for failure: Setup was canceled for the feature.
 Next Step: SQL Server Setup was canceled before completing the operation. Try the setup process again.

Rules with failures:

Global rules:

Scenario specific rules:

Rules report file: C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log\20180920_200447\SystemConfigurationCheck_Report.htm

Exception summary:
The following is an exception stack listing the exceptions in outermost to innermost order
Inner exceptions are being indented

Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
 Message:
 There was an error generating the XML document.
 HResult : 0x84b10001
 FacilityCode : 1201 (4b1)
 ErrorCode : 1 (0001)
 Data:
 DisableWatson = true
 Stack:
 at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
 at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(Object objectToSerialize)
 at Microsoft.SqlServer.Chainer.Infrastructure.PublicConfigurationBridge.Calculate()
 at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.CalculateSettings(IEnumerable`1 settingIds)
 at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.CalculateAllSettings(Boolean chainerSettingOnly)
 at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
 at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
 at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)
 Inner exception type: System.InvalidOperationException
 Message:
 There was an error generating the XML document.
 HResult : 0x80131509
 Stack:
 at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
 at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
 at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
 Inner exception type: System.Security.Cryptography.CryptographicException
 Message:
 The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.

 HResult : 0x80090345
 Stack:
 at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
 at Microsoft.SqlServer.Common.SqlSecureString.WriteXml(XmlWriter writer)
 at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAgentConfigurationPublic.Write6_AgentConfigurationPublic(String n, String ns, AgentConfigurationPublic o, Boolean isNullable, Boolean needType)
 at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterAgentConfigurationPublic.Write7_AgentConfigurationPublic(Object o)

【问题讨论】:

  • “当我使用本地 Windows 帐户启动 SSMS 时” - 您是说在这种情况下您可以使用 SQL 帐户(示例中的sa)登录吗?我不希望运行 SSMS 的帐户对您是否可以连接 SQL 帐户有任何影响。但是有些事情我不知道!
  • 是的... Shift-右键单击 ssms 图标,“以其他用户身份运行”,选择本地用户,它将毫无问题地运行。但是,在注册表中添加 DWORD 似乎已经让它消失了。

标签: sql-server amazon-ec2 ssms


【解决方案1】:

我不知道为什么会这样,但我在写完这篇文章后又用谷歌搜索了一次,我发现了这篇文章...... https://social.technet.microsoft.com/Forums/en-US/d3561211-2a72-4ab8-8675-158a93e16490/error-0x80090345-the-requested-operation-cannot-be-completed-the-computer-must-be-trusted-for?forum=winserver8gen

此服务器在 \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Protect\Providers\ 中有两个“Providers”节点(拼写相同)

其中一个有他们正在谈论的密钥,另一个没有。我将它添加到第二个,并且修复了它。周末快乐!

【讨论】:

  • 很奇怪。调整注册表以使工具工作并不是最佳选择,但恭喜您找到解决问题的方法!
猜你喜欢
  • 1970-01-01
  • 2015-01-26
  • 1970-01-01
  • 2011-01-29
  • 1970-01-01
  • 1970-01-01
  • 2015-05-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多