A couple of days ago, all endpoints on certain API controllers of our application started returning 404 - as if the endpoint doesn't exist at all. Some other API controllers were working correctly, meaning that all endpoints within these controllers work as expected.
The API controllers are consumed by the Angular.js part of the monolith application (jQuery, Ajax).
This application, including the controllers that stopped working, have been running for years without this issue ever occurring.
It is an ASP.NET 4.7.2 MVC application, that in addition to MVC controllers has API controllers as well. It also has Umbraco 7 installed, so the Startup class inherits from UmbracoDefaultOwinStartup. The app is deployed to Azure App Service, using Azure DevOps Pipelines. Note: The issue is only on some API controllers, all MVC controllers work correctly.
The code, when run on localhost, doesn't show the errors, everything works normally, it's just that the deployed environment has the issue.
Here is what we changed during the period when the issue started occurring, which might have caused the issue in the first place:
- Updated the Azure DevOps Pipeline Agent pool from
Hosted VS2017 Agent poolto Azure pipelineswindows-2019(as we received a warning that vs 2017 and windows-2016 images will be deprecated). More info on this url: https://github.com/actions/virtual-environments/issues/4312 - Made changes on the
Gruntfile.js,BundleConfig.cs, andMaster.cshtmlfiles
What we tried so far:
- running the app in localhost - unable to recreate the issue, localhost works fine
- reverting the changes made on the files - the issue still persists
- set the pipelines Agent pool to
vs2017-win2016- the issue still persists. I was not able to set it completely back toHosted VS2017 Agent poolas it is deprecated. This means that, if the issue was caused by changing the Agent pool, I was not able to revert it. - testing the endpoints that don't work via Postman, adding logs within the controller actions to see whether the endpoint will be triggered - but it always simply returns 404 without ever entering the controller action
UPDATE: we've reset the remote branch to a state where we're certain that all APIs were working correctly, but the 404 status codes persist. This indicates that this issue isn't caused by changes in code, but rather something environment specific.
UPDATE 2: when reviewing the LogFiles folder through Kudu DebugConsole, I've found that all these 404 requests have the following logged event, so this proves that the ednpoint isn't recognized at all:
MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName IIS Web Core
Notification MAP_REQUEST_HANDLER
HttpStatus 404
HttpReason Not Found
HttpSubStatus 0
ErrorCode The system cannot find the file specified. (0x80070002)