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

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.

Related

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

How Azure pipelines can get source from Internal TFS and External Git? How can I update the proxy?

I am setting up Azure Pipelines, I have few that get sources from GitHub and trying to setup pipelines to reach TFS on Intranet, I created a Service Connection of type: “Azure Repos/Team Foundation Server” using this Other Git URL: https://tfs.myCie.com/defaultcollection/MyProject/_versionControl
When I run the pipeline, it takes some time then it displays a 504 Timeout error but the pipeline is still pending. After a while, it goes into error with this message in the step “Checkout repository#master to s”:
git -c http.proxy="http://myProxy.myCie.com:80" fetch --force --tags --prune --progress --no-recurse-submodules origin
fatal: unable to access 'https://tfs. myCie.com/defaultcollection/myProject/_versionControl/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to tfs.oecd.org:443
##[warning] Git fetch failed with exit code 128, back off 3.667 seconds before retry.
Security team says that I should use a PAC file to setup the proxy and that should enable intranet and Internet calls but I don’t see how to update the proxy settings of my Self-Hosted Windows Agent.
Can I specify a file? Can there be a configuration for Internet and another one for intranet?
I don’t see how to update the proxy settings of my Self-Hosted Windows
Agent. Can I specify a file?
For the agent you need to create a .proxy file with the proxy URL in the root directory of your agent.
Locate the root directory of your build agent (this is the folder
that contains the run.exe and the _work folder).
Open a Command Prompt at this location.
Type this command, but replace PROXYIP & PORT with your values:
echo http://PROXYIP:PORT > .proxy
Check that your .proxy file is created at the right place:
Optional: If your proxy needs authentication, you must set these
environment variables:
set VSTS_HTTP_PROXY_USERNAME=user
set VSTS_HTTP_PROXY_PASSWORD=password
Restart the service for your build agent.
When you know that you need a proxy at the time of the installation, you can configure the proxy settings right when you call config.cmd:
./config.cmd --proxyurl http://127.0.0.1:8888 --proxyusername "user" --proxypassword "password"
For details, please refer to this blog.
Here is the official document you can refer to.

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.

Azure Deployment error involving New Relic Extension?

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.

couchdb dead but pid file exists

I have a Centos 6.4 x64 server with epel repo enabled. I installed couchdb via the yum package manager (version 1.0.4) with no errors. I edited the /etc/couchdb/local.ini file with my port (default 5984) and server ip address. Whenever I run the service couchdb start, it returns the ok message:
Starting couchdb: [ OK ]
However, if I run a service couchdb status right after, I get this:
couchdb dead but pid file exists
and, of course, the server does not work.
The weird part is that service couchdb start always returns the success message, although the server never actually runs. Also, there is no log files created at all by couchdb (my /var/log/couchdb/ folder is empty - doubled checked couchdb configuration files for the path).
When I delete the /var/run/subsys/couchdb.pid file, service shows couchdb as not started, and when I try to restart couchdb (service couchdb start), I get the success message again and so on.
Any help will be greatly appreciated. :)
EDIT: I forgot to mention that when I run couchdb it works fine (giving me only this warning warning: "TODO: max is currently unsupported"), so it is just the service that doesn't work.
May be there are so many instances running for couchdb you have to kill each and every and then restart the servcie. Hope it works fine.

Resources