Trips endpoint throws 500 error

Sotiris K3 years ago

Hello,

I'm running the latest version of Traccar and I'm noticing that just the trips endpoint throws the following 500 error.

{"error":{"code":500,"message":"Failed to establish database connection:could not find driver"}}

Why would it be the only endpoint having problems with the database while all the others are working fine?

Is there a way to troubleshoot this?

Anton Tananaev3 years ago

This doesn't look like an error message from Traccar. It should have a stack trace.

Sotiris K3 years ago

Screenshot from traccar (old interface)

Request URL

https://traccar.MY-DOMAIN.HERE/api/reports/trips?_dc=1624375031540&deviceId=4&type=allEvents&from=2021-06-21T21%3A00%3A00.000Z&to=2021-06-22T21%3A00%3A00.000Z&daily=false&page=1&start=0&limit=25

Request Headers

GET /api/reports/trips?_dc=1624375031540&deviceId=4&type=allEvents&from=2021-06-21T21%3A00%3A00.000Z&to=2021-06-22T21%3A00%3A00.000Z&daily=false&page=1&start=0&limit=25 HTTP/1.1
Host: traccar.MY-DOMAIN.HERE
Connection: keep-alive
sec-ch-ua: " Not;A Brand";v="99", "Microsoft Edge";v="91", "Chromium";v="91"
Accept: application/json
DNT: 1
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 Edg/91.0.864.54
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://traccar.MY-DOMAIN.HERE/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,el;q=0.8
Cookie: JSESSIONID=node0x5mi4lxiny43pxlu2dl1v5za3296.node0; ext-devices-grid=o%3Acolumns%3Da%253Ao%25253Aid%25253Ds%2525253Ah1%255Eo%25253Aid%25253Ds%2525253Ah2%255Eo%25253Aid%25253Ds%2525253Ah3%255Eo%25253Aid%25253Ds%2525253Ah4%255Eo%25253Aid%25253Ds%2525253Ah5%255Eo%25253Aid%25253Ds%2525253Ah6%255Eo%25253Aid%25253Ds%2525253Ah7%255Eo%25253Aid%25253Ds%2525253Ah8%255Eo%25253Aid%25253Ds%2525253Ah9%255Eo%25253Aid%25253Ds%2525253Ah10%5Eweight%3Dn%253A0; ext-show-geofences-button=o%3Apressed%3Db%253A1; ext-show-live-routes-button=o%3Apressed%3Db%253A0; ext-state-grid=o%3Acolumns%3Da%253Ao%25253Aid%25253Ds%2525253Ah1%255Eo%25253Aid%25253Ds%2525253Ah2%5EstoreState%3Do%253Asorters%253Da%25253Ao%2525253Aroot%2525253Ds%252525253Adata%2525255Eproperty%2525253Ds%252525253Apriority%2525255Edirection%2525253Ds%252525253AASC%2525255Eid%2525253Ds%252525253Apriority%5Eweight%3Dn%253A10; ext-devices-and-state-panel=o%3Aweight%3Dn%253A-10; ext-device-follow-button=o%3Apressed%3Db%253A0

Response Headers

HTTP/1.1 500 Server Error
Date: Tue, 22 Jun 2021 15:17:12 GMT
Server: Apache/2.4.48 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS,GET
Content-Type: application/json;charset=utf-8
access-control-allow-headers: origin, content-type, accept, authorization
access-control-allow-credentials: true
Content-Length: 96
Connection: close

Response

{"error":{"code":500,"message":"Failed to establish database connection:could not find driver"}}

Where should I find the stack trace?

Anton Tananaev3 years ago

I see that it's served by Apache. Connect directly to Traccar and provide the same details.

Sotiris K3 years ago

Request URL

http://MYDOMAIN.HERE:8080/api/reports/trips?_dc=1624377094009&deviceId=4&type=allEvents&from=2021-06-21T21%3A00%3A00.000Z&to=2021-06-22T21%3A00%3A00.000Z&daily=false&page=1&start=0&limit=25

Request Headers

GET /api/reports/trips?_dc=1624377094009&deviceId=4&type=allEvents&from=2021-06-21T21%3A00%3A00.000Z&to=2021-06-22T21%3A00%3A00.000Z&daily=false&page=1&start=0&limit=25 HTTP/1.1
Host: MYDOMAIN.HERE:8080
Connection: keep-alive
Accept: application/json
DNT: 1
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36 Edg/91.0.864.54
Referer: http://MYDOMAIN.HERE:8080/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,el;q=0.8
Cookie: JSESSIONID=node0ixuuwbqpvkk9xvqm9isva6ue3302.node0; ext-devices-grid=o%3Acolumns%3Da%253Ao%25253Aid%25253Ds%2525253Ah1%255Eo%25253Aid%25253Ds%2525253Ah2%255Eo%25253Aid%25253Ds%2525253Ah3%255Eo%25253Aid%25253Ds%2525253Ah4%255Eo%25253Aid%25253Ds%2525253Ah5%255Eo%25253Aid%25253Ds%2525253Ah6%255Eo%25253Aid%25253Ds%2525253Ah7%255Eo%25253Aid%25253Ds%2525253Ah8%255Eo%25253Aid%25253Ds%2525253Ah9%255Eo%25253Aid%25253Ds%2525253Ah10%5Eweight%3Dn%253A0; ext-show-geofences-button=o%3Apressed%3Db%253A1; ext-show-live-routes-button=o%3Apressed%3Db%253A0; ext-device-follow-button=o%3Apressed%3Db%253A0; ext-state-grid=o%3Acolumns%3Da%253Ao%25253Aid%25253Ds%2525253Ah1%255Eo%25253Aid%25253Ds%2525253Ah2%5EstoreState%3Do%253Asorters%253Da%25253Ao%2525253Aroot%2525253Ds%252525253Adata%2525255Eproperty%2525253Ds%252525253Apriority%2525255Edirection%2525253Ds%252525253AASC%2525255Eid%2525253Ds%252525253Apriority%5Eweight%3Dn%253A10; ext-devices-and-state-panel=o%3Aweight%3Dn%253A-10

Response Headers

HTTP/1.1 500 Server Error
Date: Tue, 22 Jun 2021 15:51:34 GMT
Server: Apache/2.4.48 (Ubuntu)
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS,GET
Connection: close
Content-Type: application/json;charset=utf-8
access-control-allow-headers: origin, content-type, accept, authorization
access-control-allow-credentials: true
Content-Length: 96

Response

{"error":{"code":500,"message":"Failed to establish database connection:could not find driver"}}

It's been so long since I've put the reverse proxy for the https that I had totally forgotten about it. Unfortunately though the problem persists even with direct connection to Traccar.

Sotiris K3 years ago

It's still served by Apache though. Did I misunderstand something? Is there another way to connect directly to Traccar other than port 8080?

Anton Tananaev3 years ago

Which port is your Traccar listening on? That's what you have to connect to.

Sotiris K3 years ago

OK, if you mean the web.port it's 8080 and the messages from my previous reply was from that port.

If you mean some other port, I see that traccar is listening on a ton of 5*** ports and none of them are usable through HTTP.

If you mean something else, I'd need a bit more details on how to find that port.

Anton Tananaev3 years ago

Web port, of course.

Sotiris K3 years ago

I just want to mention that the problem was located on the locally hosted nominatim instance for reverse geocoding.

After I upgraded it, everything works fine again.