Search code examples
node.jsvisual-studio-codeazure-web-app-serviceyarnpkgoryx

Yarn install timeout on Azure App Service (Oryx)


When using the Azure App Service through vscode, when deploying to a webapp. The Oryx operations may fail because of a timeout during the installation of packages with Yarn with the message "There appears to be trouble with your network connection."

[…]
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.

Solution

  • The Azure team resolved this issue, I created the wiki for future reference.

    Linked to https://github.com/yarnpkg/yarn/issues/4890

    Linked to Yarn - There appears to be trouble with your network connection. Retrying

    To circumvent the issue during the Oryx operations, you must create a configuration file that will specify a longer timeout when downloading packages.

    At the time Oryx uses Yarn V1.22.15

    Create a .yarnrc file at the project root add network-timeout 240000 to the file

    You can change 240000 to any value that is appropriate.

    In case Oryx updates Yarn to 2.x, the file to be created will be named .yarnrc.yml and the value to append will be httpTimeout: 240000