Ebconfigurations: Enable-WindowsOptionalFeature IIS-WebSockets fails reboot

0

Hi, I have ebextensios script that enable IIS-WebSockets and then a step to reboot the machine to enable it (cause enabling this feture requires reboot) but the reboot fails.

files:
  "C:/mysetup/app-server.ps1":
    content: |
      $LASTEXITCODE = 0

      Write-Host "Unistall Windows Defender";
      Uninstall-WindowsFeature -Name Windows-Defender

      Write-Host "Enable IIS WebSockets";
      Enable-WindowsOptionalFeature -FeatureName IIS-WebSockets -Online -NoRestart

      exit $LASTEXITCODE
 container_commands:
  03-configure-application-server:
    command: powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:/mysetup/app-server.ps1"
    ignoreErrors: true
    waitAfterCompletion: 0
  04-reboot-server:
    command: powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Restart-Computer -Confirm -Force"
    waitAfterCompletion: 0

I tried iven with waitAfterCompletion: forever. Here's the error I get:

2022-10-25 12:26:30,420 [INFO] Command 03-configure-application-server succeeded
2022-10-25 12:26:31,822 [ERROR] Command 04-reboot-server (powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Restart-Computer -Confirm -Force") failed
2022-10-25 12:26:31,822 [ERROR] Error encountered during build of postbuild_1_pcube: Command 04-reboot-server failed
Traceback (most recent call last):
  File "cfnbootstrap\construction.pyc", line 578, in run_config
  File "cfnbootstrap\construction.pyc", line 146, in run_commands
  File "cfnbootstrap\command_tool.pyc", line 127, in apply
cfnbootstrap.construction_errors.ToolError: Command 04-reboot-server failed
2022-10-25 12:26:31,822 [ERROR] -----------------------BUILD FAILED!------------------------
2022-10-25 12:26:31,822 [ERROR] Unhandled exception during build: Command 04-reboot-server failed
Traceback (most recent call last):
  File "cfn-init", line 176, in <module>
  File "cfnbootstrap\construction.pyc", line 137, in build
  File "cfnbootstrap\construction.pyc", line 564, in build
  File "cfnbootstrap\construction.pyc", line 578, in run_config
  File "cfnbootstrap\construction.pyc", line 146, in run_commands
  File "cfnbootstrap\command_tool.pyc", line 127, in apply
cfnbootstrap.construction_errors.ToolError: Command 04-reboot-server failed

Thanks Michele

질문됨 2년 전58회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠