projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'Generating Deployment Script' step consistently failing during Zip Push Deploy - applicationinsights node module exception

NathanBlaise-MSFT opened this issue · comments

Repro steps.

Our project consistently builds on our local dev machine, and even when we attempt to deploy a zip file that was previously deployed successfully (and currently running in the deployed build), this error still reproduces.

We usually use Zip Push Deploy via the Kudu API, but have also attempted using the Kudu UI and encountered the same issue.
The issue still reproduces after starting the web app.

The log/error given by the failure.

After the deployment step 'Generating Deployment Script' we get the following error:

2022-07-19T21:39:58.0694341Z : Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted"'.
 2022-07-19T21:40:01.6167091Z : D:\PROGRA2\<redacted>\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43
 2022-07-19T21:40:01.6167091Z : exports.statAsync = util_1.promisify(fs.stat);
 2022-07-19T21:40:01.6319568Z : ^
 2022-07-19T21:40:01.6475574Z :
 2022-07-19T21:40:01.6475574Z : TypeError: util_1.promisify is not a function
 2022-07-19T21:40:01.6631792Z : at Object.<anonymous> (D:\PROGRA2\<redacted>\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43:28)
 2022-07-19T21:40:01.6631792Z : at Module._compile (module.js:570:32)
 2022-07-19T21:40:01.678833Z : at Object.Module._extensions..js (module.js:579:10)
 2022-07-19T21:40:01.678833Z : at Module.load (module.js:487:32)
 2022-07-19T21:40:01.6944674Z : at tryModuleLoad (module.js:446:12)
 2022-07-19T21:40:01.6944674Z : at Function.Module._load (module.js:438:3)
 2022-07-19T21:40:01.7100815Z : at Module.require (module.js:497:17)
 2022-07-19T21:40:01.7100815Z : at require (internal/module.js:20:19)
 2022-07-19T21:40:01.7256807Z : at Object.<anonymous> (D:\PROGRA2\<redacted>\nodejs\node_modules\applicationinsights\out\Library\InternalAzureLogger.js:48:24)
 2022-07-19T21:40:01.7256807Z : at Module._compile (module.js:570:32)
 2022-07-19T21:40:01.7569624Z : D:\PROGRA2\<redacted>\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.<anonymous> (D:\PROGRA2\<redacted>\nodejs\node_modules\applicationinsights\out\Library\FileSystemHelper.js:43:28)\r\n at Module._compile (module.js:570:32)\r\n at Object.Module._extensions..js (module.js:579:10)\r\n at Module.load (module.js:487:32)\r\n at tryModuleLoad (module.js:446:12)\r\n at Function.Module._load (module.js:438:3)\r\n at Module.require (module.js:497:17)\r\n at require (internal/module.js:20:19)\r\n at Object.<anonymous> (D:\PROGRA2\<redacted>\nodejs\node_modules\applicationinsights\out\Library\InternalAzureLogger.js:48:24)\r\n at Module._compile (module.js:570:32)\r\nD:\Program Files (x86)\SiteExtensions\Kudu\97.40427.5713\bin\Scripts\starter.cmd "D:\Program Files (x86)\SiteExtensions\Kudu\97.40427.5713\bin\node_modules\.bin\kuduscript.cmd" -y --no-dot-deployment -r "D:\local\Temp\zipdeploy\extracted" -o "D:\home\site\deployments\tools" --basic --sitePath "D:\local\Temp\zipdeploy\extracted"

Mention any other details that might be useful.

Kudu Version: 97.40427.5713

I was able to deploy by disabling Application Insights on the Web App. While this is a workaround for now it seems there's a bug in the NodeApplicationInsightsAgent Site Extension being used by the kuduscript.cmd to generate the deployment script.

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure:
https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano
Azure App Service