A newer version of the Ed-Fi ODS / API is now available. See the Ed-Fi Technology Version Index for a link to the latest version.

Resolving Sandbox Admin 405 Error

Steps to Reproduce

In an IIS-based deployment (not from Visual Studio):

  1. Create a new sandbox using the Sandbox Admin web application.
  2. Try to delete that sandbox

Expected Result

Sandbox is deleted

Actual Result

The API call is blocked and returns status code 405. UI displays an appropriate message: Error: Method Not Allowed.

Environment

  • Generally only impacts IIS installations, not IIS Express (which is used by Visual Studio). Can be demonstrated on the Ed-Fi Staging and Production environments
  • Affects version 5.0+

Diagnosis

  1. In IIS, turn on Failed Request Logging with status code 405.
  2. Find the request log and it will probably show that WebDav is the cause.
  3. This is a well-known issue.  This link gives a good explanation of how the situation arises.
    1. https://docs.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/troubleshooting-http-405-errors-after-publishing-web-api-applications

Workaround

Remove the WebDav module in the Sandbox Admin web.config file. The file probably contains this line:

<modules runAllManagedModulesForAllRequests="true" />

Change to this:

<modules runAllManagedModulesForAllRequests="true"> <remove name="WebDAVModule" /> </modules>

This setting was present in the default web.config in versions prior to the .NET Core conversion (ODS/API 5.0), hence the error is isolated to these newer versions.