Timeout on report pulling

Ronald3 years ago

greetings!

I am facing this challenge:
each time i try to pull a larger report e.g trips for 14 days, i get the error below:

<html>
<head>
<title>Error 504 Gateway Timeout</title>
</head>
<body>
<h2>HTTP ERROR: 504</h2><pre>Gateway Timeout</pre>
<p>RequestURI=http://XX.XX.XX.XX(IP Address)/api/reports/trips?_dc=1628025658300&deviceId=589&type=allEvents&from=2021-06-23T22%3A00%3A00.000Z&to=2021-07-08T21%3A59%3A00.000Z&daily=false&page=1&start=0&limit=25</p>
                               
                                                
</body>
</html>

If i reduce the number of days to 3 for example, the trips are pulled well.

I have monitored RAM usage during the query and while it`s rising a little, it is not being exhausted.
I have also tried to increase Mysql timeouts to no avail.

The query is terminating in about 40 seconds.

Any pointers would be greatly appreciated

Ronald3 years ago

I also get the following error at times:

Can not read response from server. Expected to read 378 bytes, read 105 bytes before connection was unexpectedly lost. - EOFException (... < QueryBuilder:390 < DataManager:328 < Summary:102 < ...)
Anton Tananaev3 years ago

Who returns the timeout? Do you have some proxy?

Ronald3 years ago

I'm not quite sure what's returning the timeout but it is served to the user when attempting to pull the report as seen in the image below.
I am not using a proxy, i have a straight installation and traccar is running on port 80.
I do not have any other app/site running on the VPS

Ronald3 years ago
Anton Tananaev3 years ago

Are you using reverse geocoding?

Ronald3 years ago

Yes, i am using nominatim. Do you think it is the one timing out?

Anton Tananaev3 years ago

Possibly. Try disabling.

Ronald3 years ago

Hi Anton. Thanks for the suggestion. I have tried disabling it but sadly still getting the timeout though it seems to be taking a little more time to load now (as if it`s going to complete the request) . At some point i am just getting a "connection error". I have also noticed a new error after disabling reverse geocoding which is showing up sometimes:

<html>
<body>
Error 502 - Bad Request<br>
The server could not resolve your request for uri: http://www.(domain).com/api/reports/trips?_dc=1628102934313&deviceId=529&type=allEvents&from=2021-06-30T22%3A00%3A00.000Z&to=2021-07-31T22%3A00%3A00.000Z&daily=false&page=1&start=0&limit=25
</body>
</html>

Any thoughts?

Anton Tananaev3 years ago

What are the response headers?

Ronald3 years ago

Okay, i am not quite sure of what those are but in the spirit of asking things without searching first, i made a quick google search on how to acquire the info. I went to "inspect element" then "network" and got the data. If i got the wrong info, may you kindly direct me.

I seem to get the "forbidden" message when i paste all the data here, i guess i am not formatting it well so i have uploaded it on a text file that can be previewed online here
https://evo.co.zw/headers.txt

There are 3 headers, one upon clicking "show"(trips) and the other two upon the query failing.

Hope i pulled the correct data

Ronald3 years ago

Additional comment*
Upon further looking, i am realizing that these may be request headers. All 3 have no data on the "Response" window

Anton Tananaev3 years ago

Yes, those are requests. If there are no responses then where does the original error come from? 502 is a server error, so it cannot be generated by the browser itself.

Ronald3 years ago

Hello Anton.
I could not get any response headers as you had pointed above so i copied the server to another test server to run some checks.
I have noticed that Gateway timeout error goes away when i move web access back to port 8082, queries have improved but i still face challenges if the report is bigger, i get the 'Connection Failure" error.

If i manually execute the same query (or even bigger) in mysql via command line, it completes in about two minutes with no problem. Any thoughts?

Ronald3 years ago

I have tried incresing browser timeout to no avail