Azure / webapps-deploy

Enable GitHub developers to deploy to Azure WebApps using GitHub Actions
MIT License
260 stars 185 forks source link

util_1.promisify is not a function #422

Open RashmiBK5 opened 1 month ago

RashmiBK5 commented 1 month ago

I am trying to deploy .net core Web Api (.net 6) to Azure web app but I am getting an error "_C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43 exports.statAsync = util1.promisify(fs.stat);"

the same workflow was working fine till last working day, but all of a sudden it is throwing exception

Log from last working day: Generate deployment script was success full with script:

Using cached version of deployment script (command: 'azure -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted"').

But now getting an error related to Node.js.

Yaml File:

- name: Download artifact from build job
  uses: actions/download-artifact@v3
  with:
    name: webapp

 - name: Deploy to Azure WebApp
  uses: azure/webapps-deploy@v2
  with:
    app-name: ${{ env.AZURE_WEBAPP_NAME }}
    publish-profile: ${{ secrets.FredApiAppService_0F0E }}
    package: '.'

Error:

Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted"'. C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43 exports.statAsync = util_1.promisify(fs.stat); ^

TypeError: util_1.promisify is not a function at Object. (C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43:28) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at Object. (C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\InternalAzureLogger.js:48:24) at Module._compile (module.js:577:32) C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43\r\nexports.statAsync = util_1.promisify(fs.stat);\r\n ^\r\n\r\nTypeError: util_1.promisify is not a function\r\n at Object. (C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43:28)\r\n at Module._compile (module.js:577:32)\r\n at Object.Module._extensions..js (module.js:586:10)\r\n at Module.load (module.js:494:32)\r\n at tryModuleLoad (module.js:453:12)\r\n at Function.Module._load (module.js:445:3)\r\n at Module.require (module.js:504:17)\r\n at require (internal/module.js:20:19)\r\n at Object. (C:\PROGRA~2\SITEEX~1\NODEAP~1\210~1.4\nodejs\node_modules\applicationinsights\out\Library\InternalAzureLogger.js:48:24)\r\n at Module._compile (module.js:577:32)\r\nC:\Program Files (x86)\SiteExtensions\Kudu\102.10502.001\bin\Scripts\starter.cmd "C:\Program Files (x86)\SiteExtensions\Kudu\102.10502.001\bin\node_modules.bin\kuduscript.cmd" -y --no-dot-deployment -r "C:\local\Temp\zipdeploy\extracted" -o "C:\home\site\deployments\tools" --basic --sitePath "C:\local\Temp\zipdeploy\extracted"

AndyEdmonds commented 1 month ago

I'm getting exactly the same error trying to deploy several webapps.

RashmiBK5 commented 1 month ago

Hi @AndyEdmonds I added WEBSITE_NODE_DEFAULT_VERSION =14.17.0 in Web app environment setting and it started working.

AndyEdmonds commented 1 month ago

Hi Rashmi, Thanks, will try it.

casepulvec commented 3 weeks ago

Hi @RashmiBK5 Thank you so much for your reply. I had the same issue for several days when trying to deploy a bot from Bot Framework Composer to App Services App and Azure Bot Services. Setting the environment variable WEBSITE_NODE_DEFAULT_VERSION as 14.17.0, allow me to finally deploy the app.

For future reference, if someone else has the same issue when deploying an app from Bot Framework Composer, the following are the errors I was able to solve by following Rashmi's recommendations. Error from Bot Framework Composer thumbnail_image

Error log in App Services image image