.net core web application throwing a 404 on an internal page

157 views Asked by At

Okay so I will start by saying I'm stumped even trying to explain this issue:

I have a .net core web application which has the following file tree structure

INDEX (WORKING)
 |
 +-- YOUR-COURSES (WORKING)
 |    
 +-- COURSE (WORKING)
 |  |  
 |  +-- SEARCH (WORKING)
 |  |
 |  +-- DETAIL (404 ERROR)
 |       |
 |       +--{COURSE CODE} (404 ERROR)
 | 
 +-- HELP (WORKING)

I have checked whether the Controller is correct and it is - and all the code appears like it should work - The strange part is it has worked before -- changes made prior to the error:

  • NuGET UserSecrets updated
  • Added a new column to the database (updated the Model accordingly)

Having made a publish - The course/detail page is no longer accessible I went to restore a backup and we have the same issue.

I am completely stumped - I am sorry that this question isn't very great, but I have absolutely no idea why or what or where it went wrong.

No changes have been made to IIS either

EDIT: Forgot to mention - I also checked all files were published and they are all available on the server - with correct access permissions

EDIT 2:

<failedRequest url="http://va.brooksbymelton.ac.uk:80/course/details/57356"
               siteId="17"
               appPoolId=".NET Core"
               processId="5072"
               verb="GET"
               authenticationType="NOT_AVAILABLE"               activityId="{800000A6-0000-E300-B63F-84710C7967BB}"
               failureReason="STATUS_CODE"
               statusCode="401.2"
               triggerStatusCode="401.2"
               timeTaken="31"
               xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb">

So it appears to be an authentication issue... great

EDIT 3: AFTER even more digging the 401.2 error, was a bogey (trying to throw me off the scent) turns out the model and table context files weren't quite set up correctly, so after re writing the model and context file, it now loads the page...

One new column on a database broke everything - why can't it have a simple SQL error - would have made life easier

Thanks @Lex li for mentioning the Failed request logging

1

There are 1 answers

0
Jack Wright On BEST ANSWER

ANSWER:

Turns out my context and model files weren't quite mapping the database correctly, few small changes job done