1

I have a controller method which was previously working and it's not clear what change, if any, has caused the following problem:

The controller is not hit. There is no exception, no response, no status code or indeed any response from the server (checked in Fiddler). The request eventually times out.

UPDATE

See my answer below. Also see my follow up question:

Web API Controller method executes to end. No HTTP response. Hangs

Community
  • 1
  • 1
Tom
  • 7,994
  • 8
  • 45
  • 62
  • Try tracert to the end point to see if it is still active and accessible. – Theo Jan 03 '17 at 16:27
  • 1
    Can you telnet into whichever port (probably 80) the server is running on? –  Jan 03 '17 at 16:27
  • How is the auth in your app? Do your API has `[Authorize]`? I had this problem when trying to access an API with Authorize attribute, which tried to redict to login page, but login page didn't exist (it's a shoot). – Alisson Reinaldo Silva Jan 03 '17 at 16:37
  • Where is this running? Locally on your machine? Deployed on a network? Add more information to your question to make it easier to help you, – user469104 Jan 03 '17 at 16:43
  • However, I believe the port is open as the browser is able to send the request. – Tom Jan 03 '17 at 16:58

2 Answers2

0

Is your project under source control? You mention that it was previously working. If you're under source control you may be able to rollback changes to your controller, test and isolate the change that caused the problem.

Another thing to check would be changes to routing. Perhaps your controller hasn't changed, but something with routing did. Routing can be tricky, there are some tools to help. A quick Google search came up with this:

https://blogs.msdn.microsoft.com/webdev/2013/04/04/debugging-asp-net-web-api-with-route-debugger/

I haven't used it myself, but I may in the future as I've run into routing problems before.

Joe Williams
  • 26
  • 1
  • 3
0

This problem appears to be an artefact of the actual problem; which appears to be that the browser/middleware/web-app are queuing the requests and previous hung requests are causing the behaviour described eventually noticed to be 'waiting for available socket...')

What happens in a clean room situation is slightly different (the controller method executes to the end and returns a result, however there is no HTTP response) and warrants a new question, see Web API Controller method executes to end. No HTTP response. Hangs

Community
  • 1
  • 1
Tom
  • 7,994
  • 8
  • 45
  • 62