<p>I figured this one out, it was bad error handling on my part.</p>

<p>If the service you're calling returns NULL, this will appear in the network tab as a 404.</p>

CC BY-SA 4.0
2018-12-19T17:48:37.677Z
2018-12-19T17:48:37.677Z
slander
<p>I've created a module for a project that has several actions, all of which are called through AJAX. Each is a post request that sends over any required params plus the CSRF token using the method described here: <a href="https://craftcms.com/guides/enabling-csrf-protection#updating-your-javascript" rel="nofollow noreferrer">https://craftcms.com/guides/enabling-csrf-protection#updating-your-javascript</a></p>

<p>On localhost, everything works correctly. On the staging server, some work correctly but others return a 404 error. Specifically, the response gives "Template not found: actions/module-name/location/geocode-inputs".</p>

<p>web.log doesn't look to be throwing any errors, and I'm not sure where else to look. Any ideas on what might be going wrong?</p>

<controller><multi-environment><404><modules>
Some (but not all) controller action routes return 404 on staging server
# Some (but not all) controller action routes return 404 on staging server

(Asked by: username_0 on 2018-12-11)

I've created a module for a project that has several actions, all of which are called through AJAX. Each is a post request that sends over any required params plus the CSRF token using the method described here: <https://craftcms.com/guides/enabling-csrf-protection#updating-your-javascript>

On localhost, everything works correctly. On the staging server, some work correctly but others return a 404 error. Specifically, the response gives "Template not found: actions/module-name/location/geocode-inputs".

web.log doesn't look to be throwing any errors, and I'm not sure where else to look. Any ideas on what might be going wrong?

**Tags:** controller, multi-environment, 404, modules


---

## 1 answers

### Answer by username_0 on 2018-12-19. Score: 2 | Accepted answer

I figured this one out, it was bad error handling on my part.

If the service you're calling returns NULL, this will appear in the network tab as a 404.


---

