使用gcloud应用程序部署将Symfony 4应用程序部署到Google App Engine(Flex)。
安装依赖项后构建失败:
Step #1: Executing script cache:clear [OK]
Step #1: Executing script assets:install public [OK]
Step #1: Executing script security-checker security:check [KO]
Step #1: [KO]
Step #1: Script security-checker security:check returned with error code 127
Step #1: !! sh: 1: security-checker: not found
Step #1: !!
Step #1: Script @auto-scripts was called via post-install-cmd
Step #1: error building image: error building stage: waiting for process to exit: exit status 127
Finished Step #1
ERROR
我的作曲家“脚本”看起来像这样:
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"security-checker security:check": "script"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
}
我在部署前运行了composer更新,并为产品环境预热了缓存。
为什么构建失败?
答案 0 :(得分:1)
看来您的安全检查设置不正确:
"security-checker security:check": "script"
Step #1: Executing script security-checker security:check [KO] Step #1: [KO] Step #1: Script security-checker security:check returned with error code 127
意味着尝试失败的命令是security-checker security:check
。实际的失败原因在下一行中显示:
Step #1: !! sh: 1: security-checker: not found
意味着shell无法找到合适的security-checker
可执行文件。可能有多种原因,包括脚本本身或执行环境的问题,例如:
要修复此构建,您可以: