0

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 pool to Azure pipelines windows-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, and Master.cshtml files

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 to Hosted VS2017 Agent pool as 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)

3
  • 1
    see if any of the answers for this question helps you to find the root cause. Commented Nov 11, 2021 at 11:55
  • Unfortunately, I don't see any relations in the proposed solutions of the linked question to my posted question. Most of the answers are .NET Core specific, and even in that case, I did not change any of the settings that could be related to those answers. The only thing that I see that might have something to do with it, is the fact that the Agent pool in the pipeline is changed, which internally changed some hosting properties which may affect routing in some way. However, I'm not sure what it could be, or how I could debug it. I didn't see any unusual logs in Kudu. Commented Nov 11, 2021 at 13:53
  • I've added information regarding the deprecated Hosted VS2017 Agent pool, and the fact that I wasn't able to revert to it completely, but rather selected vs2017-win2016 in the reversion process. Commented Nov 11, 2021 at 13:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.