当通过vscode使用Azure应用程序服务时,当部署到When应用程序时。Oryx操作可能会失败,因为在安装带有Yarn的包时,可能会出现超时,其消息是“您的网络连接出现问题”。
[…]
9:18:54 PM Azure-App-Service-Bug-Backend: Using Node version:
9:18:54 PM Azure-App-Service-Bug-Backend: v16.14.2
9:18:54 PM Azure-App-Service-Bug-Backend: Using Yarn version:
9:18:57 PM Azure-App-Service-Bug-Backend: 1.22.15
9:18:57 PM Azure-App-Service-Bug-Backend: Running 'yarn install --prefer-offline'...
9:18:58 PM Azure-App-Service-Bug-Backend: yarn install v1.22.15
9:18:59 PM Azure-App-Service-Bug-Backend: [1/4] Resolving packages...
9:19:01 PM Azure-App-Service-Bug-Backend: [2/4] Fetching packages...
9:20:31 PM Azure-App-Service-Bug-Backend: info There appears to be trouble with your network connection. Retrying...
[…]
9:25:26 PM Azure-App-Service-Bug-Backend: info There appears to be trouble with your network connection. Retrying...
[…]
9:28:53 PM Azure-App-Service-Bug-Backend: /bin/bash -c 'oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 16 -i /tmp/8da895c5510e8c2 -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log  | tee /tmp/oryx-build.log ; exit $PIPESTATUS '
9:28:54 PM Azure-App-Service-Bug-Backend: Generating summary of Oryx build
9:28:54 PM Azure-App-Service-Bug-Backend: Parsing the build logs
9:28:54 PM Azure-App-Service-Bug-Backend: Found 0 issue(s)
9:28:54 PM Azure-App-Service-Bug-Backend: Build Summary :
9:28:54 PM Azure-App-Service-Bug-Backend: ===============
9:28:55 PM Azure-App-Service-Bug-Backend: Errors (0)
9:28:55 PM Azure-App-Service-Bug-Backend: Warnings (0)
9:28:55 PM Azure-App-Service-Bug-Backend: Deployment Failed.发布于 2022-08-31 23:46:36
Azure团队解决了这个问题,我创建了wiki供将来参考。
链接到https://github.com/yarnpkg/yarn/issues/4890
要避免Oryx操作期间的问题,您必须创建一个配置文件,在下载包时指定更长的超时时间。
当时Oryx使用YarnV1.22.15
在项目根目录下创建一个.yarnrc文件,将network-timeout 240000添加到文件中
您可以将240000更改为任何适当的值。
如果Oryx将Yarn更新为2.x,则要创建的文件将命名为.yarnrc.yml,而要追加的值将为httpTimeout: 240000
https://stackoverflow.com/questions/73562965
复制相似问题