Intermittent HTTP 405 Method Not Allowed when deleting users via REST API

Hi Openfire community,

I am seeing an intermittent issue when deleting users through the Openfire REST API from Java.

I am using the Openfire REST API to delete users with an HTTP DELETE request.

The endpoint being used is:

DELETE /plugins/restapi/v1/users/{username}

The operation normally works correctly. For example, I deleted 7 users sequentially:

  • 6 users were deleted successfully.

  • 1 user returned HTTP 405 Method Not Allowed.

  • The user was not deleted from Openfire.

The important point is that the issue is intermittent. The same Java code and REST API endpoint successfully delete other users, so this does not appear to be a consistently incorrect HTTP method or endpoint.

Observed behavior

Successful requests:

HTTP DELETE
/plugins/restapi/v1/users/<username>
Response: 200
User deleted

Failed request:

HTTP DELETE
/plugins/restapi/v1/users/<username>
Response: 405 Method Not Allowed
User remains in Openfire

The 405 occurs only occasionally. It does not happen for every deletion.

Things I am investigating

I am currently checking:

  1. Whether the affected username contains special characters or characters requiring URL encoding.

  2. Whether the final URL generated by the Java code differs for the failed request.

  3. Whether the request is being redirected.

  4. Whether the DELETE method is preserved during a redirect.

  5. Whether another thread/process is simultaneously modifying or deleting the same user.

  6. Whether a reverse proxy/web server is involved in handling the request.

  7. Openfire server logs at the exact time of the 405 response.

  8. The response headers, particularly the Allow header.

  9. Whether the REST API plugin has any known edge cases involving user deletion.

Questions

Has anyone seen an intermittent HTTP 405 Method Not Allowed when deleting users through the Openfire REST API?

Could Openfire return 405 depending on the username/resource being accessed, or would a 405 generally indicate that the request was routed to a resource that does not support DELETE?

Are there any known issues in the Openfire REST API plugin related to intermittent DELETE requests?

Any guidance on what Openfire-side logging or debugging I should enable to identify why this particular DELETE request is returning 405 would be appreciated.

Thanks.

Hi Sterlin! Sorry that you’re running into this. It does not immediately resonate with me. I’m interested if you can reproduce this consistently, and if you can find anything in log files. Are you using the latest version of Openfire and the plugin?

Hi Guus,

This is not consistently reproduceable , the openfire version is 4.7.5 and the Rest API plugin is 1.10.2.

Openfire 4.7.5 is uncomfortably old. My advise would be: upgrade to the latest release of Openfire, and see if the problem persists.