Я пытаюсь развернуть свое приложение Node.js на AWS ElasticBeanstalk с помощью AWS CodePipeline. Поскольку мое приложение использует WebSockets, я включил следующий файл конфигурации в .ebextensions
.
container_commands:
enable_websocket:
command:
sed -i '/\s*proxy_set_header\s*Connection/c \
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
Однако CodePipeline не работает в процессе развертывания, и файл журнала ElasticBeanstalk cfn-init.log
сообщает следующее:
2020-06-18 12:43:42,345 [INFO] -----------------------Starting build-----------------------
2020-06-18 12:43:42,352 [INFO] Running configSets: Infra-EmbeddedPostBuild
2020-06-18 12:43:42,355 [INFO] Running configSet Infra-EmbeddedPostBuild
2020-06-18 12:43:42,359 [INFO] Running config postbuild_0_drcha
2020-06-18 12:43:42,381 [ERROR] Command enable_websockets (sed -i '/\s*proxy_set_header\s*Connection/c \
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf) failed
2020-06-18 12:43:42,381 [ERROR] Error encountered during build of postbuild_0_drcha: Command enable_websockets failed
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
changes['commands'] = CommandTool().apply(self._config.commands)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
raise ToolError(u"Command %s failed" % name)
ToolError: Command enable_websockets failed
2020-06-18 12:43:42,383 [ERROR] -----------------------BUILD FAILED!------------------------
2020-06-18 12:43:42,383 [ERROR] Unhandled exception during build: Command enable_websockets failed
Traceback (most recent call last):
File "/opt/aws/bin/cfn-init", line 171, in <module>
worklog.build(metadata, configSets)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 129, in build
Contractor(metadata).build(configSets, self)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 530, in build
self.run_config(config, worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 542, in run_config
CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/construction.py", line 260, in build
changes['commands'] = CommandTool().apply(self._config.commands)
File "/usr/lib/python2.7/site-packages/cfnbootstrap/command_tool.py", line 117, in apply
raise ToolError(u"Command %s failed" % name)
ToolError: Command enable_websockets failed
В чем причина отказа?