App引擎部署出现“无法验证Node.js二进制文件”的问题。

10
我的应用引擎部署(灵活环境,node js 12)突然开始失败,似乎是由于谷歌端的node js问题导致的。
构建输出在此处:
Step #1: Already have image (with digest): gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870
Step #1: [36mINFO[0m[0000] Removing ignored files from build context: [node_modules .dockerignore Dockerfile npm-debug.log yarn-error.log .git .hg .svn app.yaml]
Step #1: [36mINFO[0m[0004] Downloading base image gcr.io/google-appengine/nodejs@sha256:ef8be7b4dc77c3e71fbc85ca88186b13214af8f83b8baecc65e8ed85bb904ad5
Step #1: [36mINFO[0m[0019] Taking snapshot of full filesystem...
Step #1: [36mINFO[0m[0035] Using files from context: [/workspace]
Step #1: [36mINFO[0m[0036] COPY . /app/
Step #1: [36mINFO[0m[0036] Taking snapshot of files...
Step #1: [36mINFO[0m[0037] RUN /usr/local/bin/install_node '>=12.0.0'
Step #1: [36mINFO[0m[0037] cmd: /bin/sh
Step #1: [36mINFO[0m[0037] args: [-c /usr/local/bin/install_node '>=12.0.0']
Step #1:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Step #1:                                  Dload  Upload   Total   Spent    Left  Speed
100 32.1M  100 32.1M    0     0  66.9M      0 --:--:-- --:--:-- --:--:-- 66.8M
Step #1:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Step #1:                                  Dload  Upload   Total   Spent    Left  Speed
100  3838  100  3838    0     0  23116      0 --:--:-- --:--:-- --:--:-- 23260
Step #1: gpg: Signature made Tue Sep 8 15:43:07 2020 UTC using RSA key ID C17AB93C gpg: Can't check signature: public key not found
Step #1: The Node.js binary could not be verified.
Step #1: This means it may not be an officially released Node.js binary
Step #1: or may have been tampered with.
Step #1:
Step #1: Aborting the installation.
Step #1:
Step #1: The installation can be forced using the --ignore-verification-failure
Step #1: flag. However, it is strongly recommended that you install a version
Step #1: of Node.js that can be verified.
Step #1:
Step #1: Node installation failed: /opt/gcp/runtime/bootstrap_node exited with a non-zero exit code: 1
Step #1: error building image: error building stage: waiting for process to exit: exit status 1
Finished Step #1
ERROR
ERROR: build step 1 "gcr.io/kaniko-project/executor@sha256:f87c11770a4d3ed33436508d206c584812cd656e6ed08eda1cff5c1ee44f5870" failed: step exited with non-zero status: 1
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

还有其他人遇到这个问题吗?

谢谢

Chris


1
我遇到了同样的错误。目前有进展吗? - Ilya Schukin
3个回答

13

在我们的情况下,问题是因为我们在package.json中写入了"node": "14.x"导致App Engine安装了Node 14.10.0版本。看起来最新版本有一些问题。

我通过将引擎更改为固定版本来解决部署问题:

"engines": {
    "node": "14.9"
}

如果您正在使用12.x版本,请尝试一些之前的版本,看看是否有效。


如果您正在使用 Flex 环境,则无法指定节点版本。 - coderman
2
@coderman 在 package.json 中可以设置 Node 版本,如我所述。请查看官方文档:https://cloud.google.com/appengine/docs/flexible/nodejs/runtime#nodejs_version - Dima Kolodko
我尝试了14.x,14.12.0,14.12,但都失败了,然后14.9可行。看起来像是随机错误。 - dodgy_coder
注意那些从GAE标准环境转换到弹性环境的人,要非常谨慎成本 - 弹性环境默认情况下会保持1个实例永久运行,并伴随着24x7运行的CPU成本!我是走了弯路才发现这一点。 - dodgy_coder

1

0

每当发布新的Nodejs版本时,这种情况经常发生,因为GAE构建器“在次要版本升级之间并不完全向后兼容”(来源:https://github.com/GoogleCloudPlatform/nodejs-docker/issues/214#issuecomment-1276728834)。

解决方法固定下上一个正常工作的版本(在大多数情况下,是最近发布的第二个版本https://nodejs.org/en/download/releases/)。您很可能会注意到,在您的构建开始失败时,可能会发布一个nodejs版本。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接