Azure Deployment error involving New Relic Extension? - azure

I have been using the Git deployment in Azure with some success but today I am getting an odd error message that is pointing to my New Relic extension being busy.
KuduSync.NET from: 'C:\DWASFiles\Sites\mySite\Temp\c974b345-d98d-4fa4-967a-24c5d3318f63' to: 'D:\home\site\wwwroot'
Error: The process cannot access the file 'D:\home\site\wwwroot\newrelic\NewRelic.Agent.Core.dll' because it is being used by another process.
Copying file: 'Web.config'
Copying file: 'newrelic\NewRelic.Agent.Core.dll'
Failed exitCode=1, command="kudusync" -v 50 -f "C:\DWASFiles\Sites\mySite\Temp\c974b345-d98d-4fa4-967a-24c5d3318f63" -t "D:\home\site\wwwroot" -n
"D:\home\site\deployments\b0cafe3c6458e4bd3b597f91c7dbada951e87ef8\manifest" -p
"D:\home\site\deployments\fe17821502ade78d0242c1992ea0841e48e2dce4\manifest" -i
".git;.hg;.deployment;deploy.cmd"
An error has occurred during web site deployment.
Has anyone else seen this and figured out how to fix it?

There is a known issue with Azure Web Sites where the DLL files are locked due to being in use (since the site is running).
In the Azure portal you can force Azure to unload the profiler DLL file by setting the app setting COR_ENABLE_PROFILING to 0 and hitting save. This will restart IIS and unload the DLL without users seeing any error (just a delay in getting the site). After you make changes you can set it back to 1 and it will start the agent back up. This can also be done via Azure PowerShell.

Related

Web application no longer restarts automatically on Azure WebApps on TOMCAT server : HTTP 404

My applications were working properly on Azure, but after a Microsoft Docker update, they don't all restart automatically.
I have an HTTP 404:
My analysis :
This application was deployed with Microsoft tools
az webapp deploy ...
in log : /home/DeploymentLogStream/ xxx.log
the application is deployed correctly and it is present on file system
...
"Clean deploying to /home/site/wwwroot/webapps/wholesale"}
"Generating deployment script."}
"Using cached version of deployment script (command: 'azure -y --no-dot
"Running deployment command..."}
"Command: \"/home/site/deployments/tools/deploy.sh\""}
"Handling Basic Web Site deployment."}
....
"Requesting site restart"}
"Requesting site restart. Attempt #1"}
"Successfully requested a restart. Attempt #1"}
"Deployment successful. deployer = OneDeploy deploymentPath = OneDeploy
In Docker Log file I see an update of Microsoft image :
675db21ca06b Extracting 133B / 133B
675db21ca06b Extracting 133B / 133B
675db21ca06b Pull complete
Digest: sha256:932deb9018db39b74249774b4206906424f3fea09b791e9318c43316dc695aff
Status: Downloaded newer image for mcr.microsoft.com/azure-app-service/tomcat:8.5-jre8_220406005815
Pull Image successful, Time taken: 1 Minutes and 11 Seconds
Starting container for site
docker run -d -p 8871:80 --name ..
Container ... initialized successfully and is ready to serve requests.
But in Tomcat log File I only see the default ROOT module and not my Web application.
and indeed my app is not copy from /home/site/wwwroot/webapps/wholesale to /usr/local/tomcat/webapps/wholesale
/usr/local/tomcat/webapps
Redeployment does not change the problem.
Multiple restarts solve the problem but without understanding why.
The workaround is to manually copy the directory from /home to /usr, but next update will remove it.
Someone has an idea to solve the problem ?
Apologies for the inconvenience with this issue and delayed response here.
Users using the auto-update version of Tomcat on Linux that deploy multiple applications in the webapps directory may see their apps return 404.
You may manually change the version to respective working version:
Tomcat 8.5: 8.5.72
Tomcat 9.0: 9.0.54
Tomcat 10.0: 10.0.12
You may also check Azure Service Health history, notification info.
Kindly let us know how it goes.

Unable to complete Kudu deployments on Azure Websites

I have set up a deployment following the guidelines here:
https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github
The deployment was working successfully when first set up. Today I made changes to my code for a redeploy and it stopped working.
I get the following error:
Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment with MSBuild16.7.0.
Access is denied.
Failed exitCode=1, command="D:\Program Files (x86)\MSBuilds\16.8.3\MSBuild\Current\Bin\MSBuild.exe" /restore "D:\home\site\repository\myproject\myproject.Web.csproj" /p:DeployOnBuild=true /p:configuration=Release /p:publishurl="D:\local\Temp\8d8f7e05bbfa782"
An error has occurred during web site deployment.
Access is denied.\r\nD:\Program Files (x86)\SiteExtensions\Kudu\92.30310.5111\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"
I then connected to the Kudu debug portal and attempted to run the command myself. It failed. Then I attempted to navigate to D:\Program Files (x86)\MSBuilds\16.8.3\MSBuild\Current\Bin
That version of MSBuild is missing. The only versions present are:
03/27/2021 09:33 AM <DIR> MSBuild-15.3.409.57025
03/27/2021 09:33 AM <DIR> MSBuild-15.9.21.664
03/27/2021 09:33 AM <DIR> MSBuild-16.4
How do I get 16.8.3 installed?
Azure web app is run in a sandbox environment, and the contents of the folder under D:/home have read and write permissions. All other folders have read-only permissions.
Azure web app has a web environment that supports deployment in various languages, so there is no need to install the 16.8.3 version of MSBuild.
For your question, I can only provide the following troubleshooting steps:
Check what version of your project is. Net framework, .net core 2.2 or 3.1, .net5 ?
Check if the Stack settings of your azure web app is consistent with the project.
(Optional step) Set the Stack settings to .Net5, and modify any file in github, such as a new file. Check the deployment results.
Download your project and run it locally to see if it can run normally.
Create a test slot, redeploy to see if it can be deployed normally, and set the traffic to temporarily not affect your web operation. See if the problem will recur. If the problem persists, please contact Microsoft.
Related Posts:
1. Error - Access is denied - deployment to Azure App Services

Delete existing files from Kudu /site/wwwroot/ before new Azure app deployment

I'm trying to delete my previous app deployment files present in kudu /site/wwwroot/ before a new Azure deployment. I tried running the curl command with delete method -
curl -u username:password -X DELETE "https://{web-app-name}.scm.azurewebsites.net/api/vfs/site/wwwroot/"
But I got the following error :-
Cannot delete directory. It is either not empty or access is not allowed
Any idea how I can delete the files via the terminal window without actually having to manually delete them?
Any help would be greatly appreciated, Thanks!
If you are using Visual Studio for deployment you can check this box before deployment,
Or you can use Powershell script by calling Kudu VFS API
DELETE
https://{site}.scm.azurewebsites.net/api/vfs/wwwroot/some.config.default

NopCommerce error SevenSpikes.Nop.Plugins.Core.dll' is denied

I got this error continually on my nopCommerce website.
Application startup exception:
System.Exception: Plugin 'Seven Spikes Core'.
Access to the path
'C:\Inetpub\wwwroot\mywebsite\Plugins\bin\SevenSpikes.Nop.Plugins.Core.dll' is denied.
I have tried disabling overlapped recycle in the application pool and still, I still get the same error occasionally. What's the permanent fix?
I'm using nopCommerce version 4.20 version.
It is because of the shadow copy of plugin which is resolved at the nopCommerce4.2. To resolve the error you need to follow below steps
You need to stop app_pool and the website.
Remove the all .dll from the plugin bin folder(your website==>Plugins==>bin)
At the appsetting.json(root directory of the website) change "UsePluginsShadowCopy" :
true to "UsePluginsShadowCopy": false
Start the app_pool first then website.
It should resolved the error. I faced same problem and get solution by following the above steps. You do not need to disable overlapped recycle.
After I copied the site folder to a new folder I gave this folder the APP-POOL permisions:
'IIS APPPOOL\My-IIS-Site-Name' then - restart IIS.

msdeploy stop working, getting error Code: ERROR_USER_NOT_ADMIN

I am using msdeploy to deploy codes to dev server. this morning it stops working. and I am getting ERROR_USER_NOT_ADMIN. nothing changed, at least not that I know of.
abc\jqin, this user is a domain account, its a local admin. why am I still getting ERROR_USER_NOT_ADMIN
Deploy: "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-verb:sync -source:package="C:\NetBuild\Packages\IRViewerSvc\IRViewerSvc.zip" -dest:iisApp=IRViewerSvc,computerName=tvw-irwebsvc,username="abc\jqin",password=********
Info: Using ID '51e98b9d-456e-4c7e-8f1a-c696c240f431' for
connections to the remote server. EXEC : error Code:
ERROR_USER_NOT_ADMIN [C:\NetBuild\BuildScript\IRViewerSvc.build]
More Information: Connected to 'tvw-irwebsvc' using the Web Deployment
Agent Service, but could not authorize. Make sure you are an
administrator on 'tvw-irwebsvc'. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error : The remote server returned an error : (401) Unauthorized.
[C:\NetBuild\BuildScript\IRViewerSvc.build] EXEC : error count: 1.
[C:\NetBuild\BuildScript\IRViewerSvc.build]
C:\NetBuild\BuildScript\IRViewerSvc.build(71,5): error MSB3073: The
command ""C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-verb:sync -source:package="C:\NetBuild\Packages\IRViewerSvc\IRViewerSvc.zip" -dest:iisApp=IRViewerSvc,computerName=tvw-irwebsvc,username="abc\jqin",password=********"
exited with code -1. Done Building Project
"C:\NetBuild\BuildScript\IRViewerSvc.build" (deploy target(s)) --
FAILED.
Try search mmc and run it click on File add or remove snap-ins, select Local Users and Groups hit ok.
Click on the User uncheck everything and check only Password never expires.
Now go to Groups add new group if it does not exists MSDepSvcUsers, Double click on it and add your User as a member.
Go to Services and restart the Web Deployment Agent Service.
Now try and run your MSDeploy.
I hope this was helpful.
Trosago
The NetLogon solution posted here didn't work on our AWS EC2 Windows Server 2019 instances because of the following:
This computer is configured as a member of a workgroup, not as a member of a domain. The Netlogon service does not need to run in this configuration.
The MSDepSvcUsers solution posted here didn't work completely either:
[16:19:20] Error: (2/10/2020 5:19:20 PM) An error occurred when the request was processed on the remote computer.
[16:19:20] Error: An error occurred when reading the IIS Configuration File 'MACHINE/REDIRECTION'. The identity performing the operation was 'EC2AMAZ-ABCDEFG\SomeUserName'.
[16:19:20] Error: Filename: \\?\C:\Windows\system32\inetsrv\config\redirection.config
[16:19:20] Error: Cannot read configuration file due to insufficient permissions
As noted here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/083efb2e-d087-4a03-9f6a-662a218cacf8/machineredirection-error?forum=tfsgeneral
Adding the Read & execute and Read access to the folder containing the redirection.config file for the user doing the deploy didn't fix the issue, but adding read permissions for the NETWORK SERVICE user on that same folder did.
I recently encountered an interment problem where builds were failing with ERROR_USER_NOT_ADMIN.
This was after an OS upgrade to Windows 2016.
The error from MsDeploy was not entirely correct in our situation and we noticed that if the deployment user was remoted onto the server the deploy would complete successfully.
Upon looking at the event log I noticed that there was an error stating that the deployment account failed to logon with a reason 'The NetLogon component is not active.'
Sure enough, the NetLogon service was stopped. Starting it meant the deployments worked again.

Resources