Route sometimes cannot be found on POST

Details:

Mature MVC ticketing app, kind of, with implemented payment gateway. Recently I had to change payment gateway and the problem started.

Basically, after payment, payment gateway issues POST request back to shop, to simple controller method decorated with HttpPost attribute.

The problem is that approx. 5 out of 10 times (not a rule) IIS issues 404, resource not found. Takes place only in production.

What I know for sure:

1. Controller method is the same as for old payment gateway (except for the name)
2. With old payment gateway I never had any problems (also POSTs to method)
3. Identical application is running in testing environment on the same server (except for the HTTPS and sandbox gateway) and after quite some testing I can’t reproduce this behavior.
4. Web server had no problems, nor it has been restarted when errors have occurred
5. Application pool was not recycled
6. Application had no other errors nor it has been restarted
7. In production, behavior is erratic: 3 times in a row route is found and accessed without any problems, then 4 times route is not foud, then again is found once etc. Sometimes in one minute.

What I’ve tried to reproduce behavior:

1. Testing environment, whole buying process, several dozens of times – NO error
2. Fiddler – direct post to testing environment, more than 250 times – NO error
3. Method implemented in production (does nothing, but exists). Fiddler – 250 times – NO error

So, I’m stuck on this one. The real problem is that I can’t reproduce behavior (404) let alone solve it.

Any suggestion how to reproduce this behavior, or solve it, would be much appreciated.

imakis

after payment, payment gateway issues POST request back to shop, to simple controller method decorated with HttpPost attribute.

The problem is that approx. 5 out of 10 times (not a rule) IIS issues 404, resource not found.

maybe POST does not fulfill all parameters. Show action

Is the site behind a load balancer?

Leave a Reply