

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 一般故障排除
<a name="troubleshooting-general"></a>

以下是您在使用 Amazon WorkSpaces 应用程序时可能出现的一般问题。

**Topics**
+ [SAML 联合身份验证功能无法正常运行。用户无权查看 WorkSpaces 应用程序应用程序。](#troubleshooting-13)
+ [从 ADFS 门户联合后，我的流式传输会话无法启动。我收到错误消息“抱歉，连接中断了”。](#troubleshooting-adfs-upn)
+ [我收到了指示重定向 URI 无效的错误。](#troubleshooting-14)
+ [我的映像生成器和实例集永不会达到运行状态。我的 DNS 服务器位于 Simple AD 目录。](#fleets-image-builders-dont-run-simple-ad)
+ [我已为用户启用应用程序设置持久性，但其持久性应用程序设置未保存或未加载。](#app-settings-save-load-failure)
+ [我为我的用户启用了应用程序设置持久性，但对于某些流应用程序，用户的密码不会跨会话保留。](#app-settings-passwords-not-persisting)
+ [Google Chrome 数据将填写包含用户的持久性应用程序设置的 VHD 文件。这样可防止其设置持久性存在。我如何管理 Chrome 配置文件？](#chrome-filling-up-app-settings-VHD)
+ [我为嵌入式 WorkSpaces 应用程序流式传输会话设置了自定义域，但是我的 WorkSpaces 应用程序流式传输 URLs 没有重定向到我的自定义域。](#embedded-streaming-sessions-streaming-urls-not-redirected-to-custom-domain)
+ [我在支持智能卡的应用程序群上启动了一个 WorkSpaces 应用程序，但可供该应用程序进行身份验证的证书数量有限（或没有）。](#no-or-limited-certificates-for-authentication-on-smartcard-fleet)
+ [认证传播服务尚未在我的支持智能卡 WorkSpaces 的应用程序群中启动。](#certification-propogation-not-starting-on-smartcard-fleet)
+ [SAML 身份验证后，我无法使用我的 Active Directory 用户名或密码登录。](#troubleshooting-saml-auth)

## SAML 联合身份验证功能无法正常运行。用户无权查看 WorkSpaces 应用程序应用程序。
<a name="troubleshooting-13"></a>

出现此问题的原因可能是为 SAML 2.0 联合身份验证 IAM 角色嵌入的内联策略不包含对堆栈 ARN 的权限。IAM 角色由访问 WorkSpaces 应用程序堆栈的联合用户担任。编辑角色权限以包含堆栈 ARN。有关更多信息，请参阅《IAM 用户指南》**中的 [亚马逊 WorkSpaces 应用程序与 SAML 2.0 集成](external-identity-providers.md)和 [Troubleshooting SAML 2.0 Federation with AWS](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_saml.html)。

## 从 ADFS 门户联合后，我的流式传输会话无法启动。我收到错误消息“抱歉，连接中断了”。
<a name="troubleshooting-adfs-upn"></a>

将声明规则中 **NameID** SAML 属性的 **Incoming Claim Type** 设置为 **UPN**，然后重试连接。

## 我收到了指示重定向 URI 无效的错误。
<a name="troubleshooting-14"></a>

出现此错误的原因是 WorkSpaces 应用程序堆栈中继状态 URL 格式错误或无效。确保在联合设置中配置的中继状态与通过 WorkSpaces 应用程序控制台显示在堆栈详细信息中的堆栈中继状态相同。如果它们相同但问题仍然存在，请与联系 AWS 支持。有关更多信息，请参阅 [亚马逊 WorkSpaces 应用程序与 SAML 2.0 集成](external-identity-providers.md)。

## 我的映像生成器和实例集永不会达到运行状态。我的 DNS 服务器位于 Simple AD 目录。
<a name="fleets-image-builders-dont-run-simple-ad"></a>

WorkSpaces 应用程序依靠您的 VPC 内的 DNS 服务器为不存在的本地域名返回不存在的域 (NXDOMAIN) 响应。这使 WorkSpaces 应用程序管理的网络接口能够与管理服务器通信。

使用 Simple AD 创建目录时， AWS Directory Service 会创建两个同时代表您充当 DNS 服务器的域控制器。由于域控制器不提供 NXDOMAIN 响应，因此它们不能与应用程序一起 WorkSpaces 使用。

## 我已为用户启用应用程序设置持久性，但其持久性应用程序设置未保存或未加载。
<a name="app-settings-save-load-failure"></a>

WorkSpaces 应用程序会自动保存在 Windows 实例的特定位置创建的应用程序设置。仅当您的应用程序将这些设置保存在以下位置之一时，这些设置才会得以保存。有关受支持的位置的列表，请参阅[应用程序设置持久性如何工作](how-it-works-app-settings-persistence.md)。如果您的应用程序配置为保存到 C:\$1Users\$1%username%，而用户的应用程序设置在会话之间不是持久性的，则可能无法创建挂载点。这会使设置无法保存到包含用户持久性应用程序设置的 VHD 文件中。

要解决该问题，请完成以下步骤：

1. 在实例集实例中，打开文件资源管理器并浏览到用户配置文件目录 C:\$1Users\$1%username%。

1. 确认此目录是否包含一个符号链接，然后执行以下任一操作：
   + 如果存在一个符号链接，确认它指向 D:\$1%username%。
   + 如果没有符号链接，请尝试删除 C:\$1Users\$1%username% 目录。

     如果您无法删除此目录，请确定目录中使该目录无法删除的文件以及创建该文件的应用程序。然后与应用程序供应商联系，以获取有关如何更改文件权限或移动文件的信息。

     如果可以删除此目录，请联系以 AWS 支持 获取解决此问题的进一步指导。有关更多信息，请参阅 [AWS 支持 中心](https://console.aws.amazon.com/support/home#/)。

## 我为我的用户启用了应用程序设置持久性，但对于某些流应用程序，用户的密码不会跨会话保留。
<a name="app-settings-passwords-not-persisting"></a>

此问题在以下情况下会出现：
+ 用户正在流式传输应用程序（如 Microsoft Outlook），这些应用程序使用 [Microsoft Data Protection API](https://docs.microsoft.com/en-us/windows/desktop/seccng/cng-dpapi)。
+ 已为未加入 Active Directory 域的流实例启用应用程序设置持久性。

如果流媒体实例未加入 Active Directory 域，则每个队列实例上的 Windows 用户是不同的。 PhotonUser由于 DPAPI 安全模型的运行方式，用户的密码不会为在此情况下使用 DPAPI 的应用程序保留。如果流实例已加入 Active Directory 域并且用户是域用户，则 Windows 用户名为已登录用户的用户名，并且用户的密码将为使用 DPAPI 的应用程序保留。

## Google Chrome 数据将填写包含用户的持久性应用程序设置的 VHD 文件。这样可防止其设置持久性存在。我如何管理 Chrome 配置文件？
<a name="chrome-filling-up-app-settings-VHD"></a>

默认情况下，Google Chrome 将用户数据和本地磁盘缓存都存储在 Windows 用户配置文件中。为防止本地磁盘缓存中的数据填充包含用户的持久性应用程序设置的 VHD 文件，可将 Chrome 配置为仅保存用户数据。为此，请在实例集实例中以管理员身份打开命令行，并用以下参数启动 Chrome，以更改磁盘缓存的位置：

`chrome.exe --disk-cache-dir C:\`*path-to-unsaved-location*`\`

使用这些参数运行 Chrome 可以防止在 WorkSpaces 应用程序会话之间保留磁盘缓存。

## 我为嵌入式 WorkSpaces 应用程序流式传输会话设置了自定义域，但是我的 WorkSpaces 应用程序流式传输 URLs 没有重定向到我的自定义域。
<a name="embedded-streaming-sessions-streaming-urls-not-redirected-to-custom-domain"></a>

要解决此问题，请验证在创建 WorkSpaces 应用程序流媒体网址时，是否已将 WorkSpaces 应用程序端点替换为自定义域。默认情况下， WorkSpaces 应用程序流媒体的格式 URLs 如下：

```
https://appstream2.region.aws.amazon.com/authenticate?parameters=authenticationcode
```

要替换直播网址中的默认 WorkSpaces 应用程序端点，请将网址**https://appstream2.***region*中的默认应用端点替换为自定义网域。例如，如果您的自定义域是 **training.example.com**，新的流式传输 URL 必须遵循以下格式：

```
https://training.example.com/authenticate?parameters=authenticationcode
```

有关为嵌入式 WorkSpaces 应用程序流式传输会话配置自定义域的更多信息，请参阅[使用自定义域的配置要求](create-streaming-url-user-authentication.md#configuration-requirements-custom-domains)。

## 我在支持智能卡的应用程序群上启动了一个 WorkSpaces 应用程序，但可供该应用程序进行身份验证的证书数量有限（或没有）。
<a name="no-or-limited-certificates-for-authentication-on-smartcard-fleet"></a>

如果应用程序在[证书传播](https://docs.microsoft.com/en-us/windows/security/identity-protection/smart-cards/smart-card-certificate-propagation-service)服务处于运行状态之前启动，就会发生这种情况。

要解决此问题，请使用 [Get-Serv](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-service?view=powershell-7.1) ice PowerShell 模块查询证书传播服务的状态，并在启动应用程序之前确保其处于运行状态。

例如，在证书传播服务运行之前，以下脚本不会启动应用程序：

```
$logFile = "$Env:TEMP\AS2\Logging\$(Get-Date -Format "yyyy-MM-dd-HH-mm-ss")_applaunch.log"
New-Item -path $logfile -ItemType File -Force | Out-Null

Function Write-Log {
    Param ([string]$message)
    $stamp = Get-Date -Format "yyyy/MM/dd HH:mm:ss"
    $logoutput = "$stamp $message"
    Add-content $logfile -value $logoutput
}

if (Get-Service -Name "CertPropSvc" | Where-Object -Property Status -eq Running) {

    Write-Log "The Certificate Propagation Service is running. Launching Application..."
    try {
        Start-Process -FilePath "Path to Application" -WindowStyle Maximized -ErrorAction Stop
    }
    catch {
        Write-Log "There was an error launching the application: $_"
        
    }
    
}   
else {

    do {
        
        $status = Get-Service "CertPropSvc" | select-object -ExpandProperty Status
        Write-Log "The Certificate Propagation service status is currently $status"
        Start-Sleep -Seconds 2

    
    } until (Get-Service -Name "CertPropSvc" | Where-Object -Property Status -eq Running)
    
    write-log "The Certificate Propagation Service is running. Launching Application..."
    try {
        Start-Process -FilePath "Path to Application" -WindowStyle Maximized -ErrorAction Stop
    }
    catch {
        Write-Log "There was an error launching the application: $_"
        
    }
}
```

## 认证传播服务尚未在我的支持智能卡 WorkSpaces 的应用程序群中启动。
<a name="certification-propogation-not-starting-on-smartcard-fleet"></a>

如果[证书传播](https://docs.microsoft.com/en-us/windows/security/identity-protection/smart-cards/smart-card-certificate-propagation-service)服务未启动，该服务的启动类型可能设置为**已禁用**。要解决此问题，请在用于创建队列映像的 WorkSpaces 应用程序映像生成器上启动 Windows 服务 Microsoft 管理控制台，并确保证书传播服务的启动类型未设置为 “**已禁用**”。

如果启动类型未设置为 “**已禁用**”，并且该服务仍未在您的 WorkSpaces 应用程序队列上启动，请在队列实例[启动时使用 Start-Ser](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-service?view=powershell-7.1) vice PowerShell 模块启动证书传播服务。

例如，如果以下 PowerShell 脚本检测到服务处于停止状态，它将启动该服务：

```
$logFile = "C:\AppStream\Logging\$(Get-Date -Format "yyyy-MM-dd-HH-mm-ss")_certpropcheck.log"
New-Item -path $logfile -ItemType File -Force | Out-Null

Function Write-Log {
    Param ([string]$message)
    $stamp = Get-Date -Format "yyyy/MM/dd HH:mm:ss"
    $logoutput = "$stamp $message"
    Add-content $logfile -value $logoutput
}

if (Get-Service -Name "CertPropSvc" | Where-Object -Property Status -eq Running) {

    Write-Log "The Certificate Propagation Service is running. Exiting..."
    Exit
}
else {
    do {

        if (Get-Service -Name "CertPropSvc" | Where-Object -Property Status -eq Stopped) {

            Write-Log "The Certificate Propagation Service is stopped, attepmting to start..."
            try {
                Start-Service -Name "CertPropSvc" -ErrorAction Stop
                
            }
            catch {
                Write-Log "There was a problem starting the service: $_"
                break               
            }

            $status = Get-Service "CertPropSvc" | select-object -ExpandProperty Status
            Write-Log "The Certificate Propagation service status is currently $status"
            

        }
        else {
        
            $status = Get-Service "CertPropSvc" | select-object -ExpandProperty Status
            Write-Log "The Certificate Propagation service status is currently $status"
            break
        }
    
    } until (Get-Service -Name "CertPropSvc" | Where-Object -Property Status -eq Running)
}
```

## SAML 身份验证后，我无法使用我的 Active Directory 用户名或密码登录。
<a name="troubleshooting-saml-auth"></a>

SAML 声明中的 nameID 需要与 Active Directory 中的 username 相匹配。有些 IdPs 需要在调整某些属性后进行更新、刷新或重新部署。如果您进行了调整，但未反映在您的 SAML 捕获中，请参阅您的 IdP 文档或支持计划，了解使更改生效所需的具体步骤。