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:
-
Whether the affected username contains special characters or characters requiring URL encoding.
-
Whether the final URL generated by the Java code differs for the failed request.
-
Whether the request is being redirected.
-
Whether the
DELETEmethod is preserved during a redirect. -
Whether another thread/process is simultaneously modifying or deleting the same user.
-
Whether a reverse proxy/web server is involved in handling the request.
-
Openfire server logs at the exact time of the 405 response.
-
The response headers, particularly the
Allowheader. -
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.