traccar: OwnTracks Bad Request no log entries
Describe the bug Using OwnTracks as a tracker and Caddy as a reverse proxy (and providing SSL) for the HTTP server running at port 5144, it seems the server returns a HTTP 400 status code, however there are no log entries that show that actually help resolving the issue
To Reproduce Steps to reproduce the behavior:
- Setup latest traccar in docker container
- Setup Caddy server using following config for http app
"traccar-owntracks": {
"listen": [":5144"],
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"transport": {
"protocol": "http"
},
"upstreams": [
{
"dial": "127.0.0.1:5144"
}
]
}
],
"match": [
{
"host": [
"traccar.example.com"
]
}
],
"terminal": true
}
]
}
- Configure OwnTracks in HTTP mode:
Endpoint = https://traccar.example.comDevice ID = 1234Tracker ID = 1Username = example - Create device in Traccar with identifier
owntracks/example/1234 - Wait and check logs
Expected behavior An entry in the log file that states why a 400 status code is being raised, but this doesn’t happen.
Screenshots N/A, log below
2024-12-31 10:24:49 INFO: [Ta2e08722: owntracks < 172.16.55.205] POST / HTTP/1.1\r\nHost: traccar.example.com:5144\r\nUser-Agent: Owntracks-Android/gms/420503003\r\nContent-Length: 127\r\nAccept-Encoding: gzip\r\nContent-Type: application/json; charset=utf-8\r\nX-Forwarded-For: 140.228.92.32\r\nX-Forwarded-Host: traccar.example.com:5144\r\nX-Forwarded-Proto: https\r\nX-Limit-D: 1234\r\nX-Limit-U: jordan\r\n\r\n{"_type":"status","_id":"6491e098","android":{"hib":1,"bo":0,"loc":0,"ps":1,"wifi":1},"topic":"owntracks/example/1234/status"}
2024-12-31 10:24:49 INFO: [Ta2e08722: owntracks > 172.16.55.205] HTTP/1.1 400 Bad Request\r\ncontent-length: 0\r\n\r\n
Smartphone (please complete the following information):
- Device: [e.g. iPhone6] S23 Ultra
- OS: [e.g. iOS8.1] Android 14
- Browser [e.g. stock browser, safari] OwnTracks
- Version [e.g. 22] 2.5.3
Additional context I wonder if this is actually because the lat / long is missing in the payload? It would be useful for Traccar to either silently discard these messages (returning a 200 status code) as OwnTracks will queue these messages and keep retrying them constantly without a timeout as far as I can see.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 15 (13 by maintainers)
Commits related to this issue
- Complete OwnTracks decoder cleanup with updated test cases #5486 — committed to ckrey/traccar by ckrey 2 years ago
Yeah, I’m pretty sure it’s because the location is missing.
Any chance to get the Docker images updated with the fix?
This should fix the problem: https://github.com/traccar/traccar/commit/0f0bb36283bba13657d666220f3cb0d06cf44859.