owntracks / ios

OwnTracks' iPhone App
http://owntracks.org
Other
315 stars 90 forks source link

OwnTracks 17.0.3 immediately crashes and closes on non-json payloads #755

Closed ArjanM83 closed 6 months ago

ArjanM83 commented 6 months ago

Since upgrading to iOS 17.2, when opening OwnTracks, it immediately crashes and closes. Also, it does not send out reports.

jpmens commented 6 months ago

Which release of OwnTracks are you using, and in which mode (MQTT or HTTP)?

ArjanM83 commented 6 months ago

Which release of OwnTracks are you using, and in which mode (MQTT or HTTP)?

Sorry forgot to add details:

ckrey commented 6 months ago

I have a device with 17.0.3 and upgraded to iOS 17.2 without problems. With previous iOS updates we saw problems on a few devices which could be solved by restarting the phone...

ArjanM83 commented 6 months ago

I have a device with 17.0.3 and upgraded to iOS 17.2 without problems. With previous iOS updates we saw problems on a few devices which could be solved by restarting the phone...

I tried restarting. But still when opening OwnTracks, it closes again in 1-2 seconds. I can't reach the settings in time to change anything.

ckrey commented 6 months ago

Would you put the iPhone in Flight mode and try again? If it works then, the problem is related to the backend connection. What kind of backend do you use? recorder?

ArjanM83 commented 6 months ago

Would you put the iPhone in Flight mode and try again? If it works then, the problem is related to the backend connection. What kind of backend do you use? recorder?

Thank you for the suggestion. In Flight mode OwnTracks does not close.

My backend connection is a custom HTTPS server that hasn't changed in years.

ckrey commented 6 months ago

Now you can use the new log feature: On the status screen, select log, then select the most recent logfile and export it. Have a look, or send it to us (support@owntracks.org)

ArjanM83 commented 6 months ago

Now you can use the new log feature: On the status screen, select log, then select the most recent logfile and export it. Have a look, or send it to us (support@owntracks.org)

Sounds good. I will check it tonight.

CharlieParcer commented 6 months ago

I'm seeing the same behavior (crashing immediately upon opening the app, and it not sending updates) but I'm still running iOS 17.1.2. I am on the latest Owntracks (17.0.3) and using a custom HTTP server that hasn't changed in long time.

Between App Store auto updates and not leaving the house I can't pinpoint it but would guess it was introduced in the latest Owntracks update.

It still crashes after a reboot. It does not crash in airplane mode with WiFi turned off.

jpmens commented 6 months ago

Could you please show us an example of the data being returned from your custom HTTP server to OwnTracks on iOS? You are welcome to redact the values of course but please DO NOT modify any quotation marks.

In case of doubt, gladly send the data to support@owntracks.org for us to look at.

jpmens commented 6 months ago

@CharlieParcer we’d also appreciate if you could please

  1. enable flight mode so OwnTracks can’t contact your server
  2. open the app and where the settings are you should see a “Logs” menu.
  3. select the last two or three logs and mail them to yourself or directly to us at the above email; during the emailing you’ll need to disable flight mode of course :-)
ArjanM83 commented 6 months ago

Now you can use the new log feature: On the status screen, select log, then select the most recent logfile and export it. Have a look, or send it to us (support@owntracks.org)

I restarted my HTTPS-server to be sure there is no problem on that side, but it's working fine with other HTTPS-services.

While in Flight mode, I extracted the last log from the log screen in OwnTracks, removed my credentials and Wi-Fi SSID and emailed it to support@owntracks.org

Let me know if you need any more testing, but I won't be able to reply until tomorrow morning.

ckrey commented 6 months ago

Problem is now clear: It is not related to iOS 17.2, but just to the new OwnTracks app version 17.0.3 It crashes if a non-json payload is sent by the backend. This happens in HTTP or MQTT mode. Returning e.g. an empty json {} avoids the problem when in HTTP mode. Will provide a new version, but this will take a day or two until it hits the App Store.

jpmens commented 6 months ago

@ArjanM83 thank you for the data you provided!

ckrey commented 6 months ago

A new version 17.0.4 is available in the app store now. Sodrry again for the inconvenience anf thanks for reporting

yantoz commented 6 months ago

I still get crashes with 17.0.4 on similar JSON issue. I got this in the log:

2023-12-15T14:37:58.693Z  Validation error: Error Domain=com.argentumko.JSONSchemaValidationError Code=300 "JSON instance validation against the schema failed." UserInfo={path=, object={
  "_type" : "lwt",
  "tst" : 1702479180
}, NSLocalizedDescription=JSON instance validation against the schema failed., validator=<DSJSONSchemaObjectValidator: 0x2820b7260>{ maximum properties: none, minimum properties: 0, required properties: _type, data }, NSLocalizedFailureReason=Object is missing required properties: 'data'.} with {"_type":"lwt","tst":1702479180}

I am using websockets/https protocol. The app connected to the mqtt server and sent lwt message before crashed.

jpmens commented 6 months ago

@yantoz that's a validation failure which shouldn't be the cause of the crash.

Please send us (support@owntracks.org) the last two logs, available from the (I) screen. If need be switch to flight mode to enter the app.

ckrey commented 6 months ago

you are probably using application level encryption. Will have to look. lwt message is not and never was encrypted

nlanfran commented 6 months ago

It is still crashing with iOS 17.2 and 17.0.4 using MQTT. The app is fine until I insert the MQTT host address, then it crashes and not being able to open it since (opens and immediately closes).

jpmens commented 6 months ago

Have you tried putting the device in flight mode until you enter a valid configuration?

yantoz commented 6 months ago

@yantoz that's a validation failure which shouldn't be the cause of the crash.

Please send us (support@owntracks.org) the last two logs, available from the (I) screen. If need be switch to flight mode to enter the app.

ok, just sent the log. I have only one log file.

yellowonblack commented 6 months ago

The same issue for me, app crashes immediately after opening,which started few days ago:

yellowonblack commented 6 months ago

The same error in the logs like @yantoz already provided:

2023-12-16T07:43:54.829Z Validation error: Error Domain=com.argentumko.JSONSchemaValidationError Code=300 "JSON instance validation against the schema failed." UserInfo={path=, object={ "_type" : "lwt", "tst" : 1702568586 }, NSLocalizedDescription=JSON instance validation against the schema failed., validator=<DSJSONSchemaObjectValidator: 0x283e6b580>{ maximum properties: none, minimum properties: 0, required properties: _type, data }, NSLocalizedFailureReason=Object is missing required properties: 'data'.} with {"_type":"lwt","tst":1702568586}

nlanfran commented 6 months ago

I just sent the log file to support@owntracks.org

ckrey commented 6 months ago

Thanks @nlanfran your log was very helpful. I found the problem caused by mixing encrypted and unencrypted messages, which are not handled correctly since version 17.0.3

ckrey commented 6 months ago

@yantoz thanks for providing the log. The problem is now solved and will be available shortly as version 17.0.5 in the app store

yantoz commented 6 months ago

@yantoz thanks for providing the log. The problem is now solved and will be available shortly as version 17.0.5 in the app store

@ckrey I confirmed that 17.0.5 solves this issue. No crashes anymore. Thanks!

ckrey commented 6 months ago

Happy to hear that

yellowonblack commented 6 months ago

Problem solved in 17.0.5. Thanks @ckrey.