"A public action method 'Index​' was not found on controller" thrown when using Sitecore Forms


Description

HTTP requests different from GET and POST (for example, HEAD) to an MVC Form rendering might fail with a 404 Not found status code and an unhandled exception. The following message can be found in the logs:

Exception: System.Web.HttpException
Message: A public action method 'Index' was not found on controller 'Sitecore.ExperienceForms.Mvc.Controllers.FormBuilderController'.
Source: System.Web.Mvc
   at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
   at System.Web.Mvc.Controller.ExecuteCore()
   at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
   at Sitecore.Mvc.Controllers.ControllerRunner.ExecuteController(Controller controller)
   at Sitecore.Mvc.Controllers.ControllerRunner.Execute(TextWriter writer)
   at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)
   ...

Solution

To resolve the issue, consider one of the following options: