Trouble with HTTP DELETE Request

David MQ2 years ago

Hello,

I'm currently facing an issue and I'm seeking some assistance.


Issue Type: Deleting via Web Interface.
Error Message: "Failed to fetch"
I send an HTTP DELETE request to my Traccar server via the web interface, I receive an error message that says "Failed to fetch."


Issue Type: Deleting via API.
Error Message: "Could not get response, error: socket hang up"
When I send the DELETE request through the API, I receive an error related to sockets: "Could not get response, error: socket hang up."


The HTTP POST and GET requests work perfectly. The only issue is with DELETE.

Thank you for your time :)

Anton Tananaev2 years ago

How much data do you associated with your device. The database query is likely timing out.

David MQ2 years ago

Hi!
The issue isn't the query/database or even the function inside the DELETE, the thing is that the request isn't even reaching the server, I suppose the reason for that is the configuration on the NGINX (which is the web server that I'm using to host it) that does not allow the delete request, I've reached this theory cause if I put in the server the DELETE request as an ADD, POST or PUT, the function works fine. I've been trying to solve this issue, but I didn't come up/found with a solution that works for me.

Update: while I was writing this, I found a solution. As I said the issue was in the configuration file of the NGINX, it had an if where it allowed all the methods but not DELETE, adding it there solved the issue. Thanks for replaying and for your time!!
Have a good day, Anton Tananaev