dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

Can't process owntracks app payloads

Open alangrafu opened this issue 1 year ago • 3 comments

Describe the bug Sending a payload from owntracks fails to be process

Version 0.16.9

To Reproduce Steps to reproduce the behavior:

  1. Go to iOS ownracks
  2. Click on Send location now
  3. Sidekiq returns WARN: ActiveRecord::RecordInvalid: Validation failed: Latitude can't be blank, Longitude can't be blank

Expected behavior latitude and longitude should be acknowledged and processed

Logs

 2024-11-25T18:39:00.098Z pid=122 tid=ic2 WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"default","wrapped":"Owntracks::PointCreatingJob","args":[{"job_class":"Owntracks::PointCreatingJob","job_id":"a2415393-cade-4440-a5fb-98e8eddbad1c","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[{"{\"bs\":1,\"p\":99.540000000000006,\"batt\":80,\"_type\":\"location\",\"tid\":\"NE\",\"topic\":\"[REDACTED]",\"alt\":157,\"lon\":[REDACTED],\"vel\":3,\"t\":\"u\",\"BSSID\":\"[REDACTED]\",\"tag\":\"personal\",\"SSID\":\"[REDACTED]\",\"conn\":\"w\",\"vac\":5,\"cog\":27,\"acc\":4,\"tst\":1732559897,\"lat\":[REDACTED],\"m\":2}":null,"api_key":"[REDACTED]","controller":"api/v1/owntracks/points","action":"create","_aj_hash_with_indifferent_access":true},1],"executions":0,"exception_executions":{},"locale":"en","timezone":"America/Los_Angeles","enqueued_at":"2024-11-25T18:38:17.066901446Z","scheduled_at":null}],"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","jid":"0b450b24cef7fb1cca76c746","created_at":1732559897.0678365,"enqueued_at":1732559940.0597396,"error_message":"Validation failed: Latitude can't be blank, Longitude can't be blank","error_class":"ActiveRecord::RecordInvalid","failed_at":1732559897.0954134,"retry_count":1,"retried_at":1732559913.5290737}}
dawarich_sidekiq  | 2024-11-25T18:39:00.098Z pid=122 tid=ic2 WARN: ActiveRecord::RecordInvalid: Validation failed: Latitude can't be blank, Longitude can't be blank

alangrafu avatar Nov 25 '24 19:11 alangrafu

@alangrafu is this still an issue on the most recent versions? I tried to reproduce it but wasn't able to

Freika avatar Dec 20 '24 15:12 Freika

@Freika I still see the same error on 0.21.1

dawarich_sidekiq           | 2024-12-27T23:41:12.311Z pid=117 tid=j1t WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"default","wrapped":"Owntracks::PointCreatingJob","args":[{"job_class":"Owntracks::PointCreatingJob","job_id":"c1e32289-1671-40d5-9f14-ec09e10a4ff8","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[{"{\"bs\":1,\"p\":98.988,\"batt\":69,\"_type\":\"location\",\"tid\":\"NE\",\"topic\":\"owntracks\\/<DELETED>\\/iphone\",\"alt\":157,\"lon\":<DELETED>,\"vel\":8,\"t\":\"u\",\"BSSID\":\"d8:47:32:74:54:14\",\"tag\":\"personal\",\"SSID\":\"<DELETED>\",\"conn\":\"w\",\"vac\":7,\"cog\":30,\"acc\":7,\"tst\":1735342554,\"lat\":<DELETED>,\"m\":1}":null,"api_key":"<DELETED>","controller":"api/v1/owntracks/points","action":"create","_aj_hash_with_indifferent_access":true},1],"executions":0,"exception_executions":{},"locale":"en","timezone":"America/Los_Angeles","enqueued_at":"2024-12-27T23:40:53.310159279Z","scheduled_at":null}],"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","jid":"97cd0bcfa952b51befb372a8","created_at":1735342853.3109791,"enqueued_at":1735342872.2571125,"error_message":"Validation failed: Latitude can't be blank, Longitude can't be blank","error_class":"ActiveRecord::RecordInvalid","failed_at":1735342853.3546479,"retry_count":0}}

alangrafu avatar Dec 27 '24 23:12 alangrafu

Got it. It seems something is odd with your data structure as Dawarich can't parse lat/lon and considering them empty, but I'll probably won't be able to debug it till the end of January. If you could compare your data payload to the ones that are already confirmed to be readable, it would be great

Freika avatar Dec 28 '24 14:12 Freika

After a few comments, edits and finally a delete now a possibly helpful comment.

I had the same problem when using GPSLogger. I could now solve it, as often it was rooted 15cm before the screen.

For me GPSLogger's HTTP Header setting seemed it was already sending as Content-Type: application/json. It turned out after setting up a small programm to track down the issue that this was not the case. One has to add the header:

Image

@alangrafu Maybe this helps you.

marcusfey avatar Jan 29 '25 07:01 marcusfey