*Home Assistant Android version:
1.7
Android version:
10
Phone model:
Samsung Galaxy S10 plus
Home Assistant version:
0.105.3
Last working Home Assistant release (if known):
0.105.3 app version. 1.05
Description of problem:
First off, thanks for a great app.
I just upgraded to 1.7 and noticed that all my home screen widgets stopped working. They would just spin.
First thing I did was to delete all the all the widgets and try to recreate them. When attempting to add them back, when I select the widget and drag it to the home screen, the config options flash for a sec and the widget selection page reappears. If I repeat this a few times the app will eventually crash.
Second, I tried clearing the app cache and data. I then reinstalled the app, cleared the integration from home assistant and restarted ha. Finally I went through the setup process again and attempted to setup a fresh widget. Same behavior, the app just crashes.
Third I disabled the launcher (Nova Launcher) and went through the whole process with the stock launcher. No joy.
This is the expection class from the system report
com.fasterxml.jackson.module.kotlin.missingkotlinparameterexception
Traceback (if applicable):
Additional information:
I can reproduce the crash by attempting to a add widget 3 times in row.
Found the crash in Crashlytics here
Fatal Exception: com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class io.homeassistant.companion.android.domain.integration.ServiceData] value failed for JSON property fields due to missing (therefore NULL) value for creator parameter fields which is a non-nullable type
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 42273] (through reference chain: java.lang.Object[][34]->io.homeassistant.companion.android.data.integration.entities.DomainResponse["services"]->java.util.LinkedHashMap["values_update"]->io.homeassistant.companion.android.domain.integration.ServiceData["fields"])
at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:198)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:422)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1287)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:527)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:364)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:29)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:530)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:528)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:417)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1287)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:195)
at com.fasterxml.jackson.databind.deser.std.ObjectArrayDeserializer.deserialize(ObjectArrayDeserializer.java:21)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1719)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1244)
at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:32)
at retrofit2.converter.jackson.JacksonResponseBodyConverter.convert(JacksonResponseBodyConverter.java:23)
at retrofit2.OkHttpCall.parseResponse(OkHttpCall.java:225)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:121)
at okhttp3.RealCall$AsyncCall.run(RealCall.kt:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
@KBerstene Can you take a look at this? We've got 106 users with this crash in the last 24 hours. Looks like it goes back to 1.5.1.
Same issue as last time: bad custom component service creation. The offender of that crash is Circadian Lighting
As a quick fix (but not a true fix), we can add a try/catch block around the service list import. I had it in my original code when I was working on dynamic services import but didn't put it back in when I added onto @JBassett's excellent work.
The problem with adding a try/catch around that section is that NO dynamic field text inputs will be created, so even if you are trying to do something standard like light.toggle, the custom component kills the entire import.
Would you like to kill the entire import until we can find a more elegant way to exclude just the custom component, or just take a few days to look for the more elegant way?
I think that would be for the best, at least for now.
Personally I say we catch the exception and display an error to the user stating that a custom integration is causing the issue. At least until we come up with a better solution. We should only go so far to support invalid custom integrations.
I agree that we shouldn't be going out of our way to support custom integrations, but it would a much better solution to remove ONLY the services that have incorrect configuration, and I don't know where to do that.
Thanks for the heads up and the PR. I added the services.yaml basically as soon as it was implemented, before the full documentation was available. I'll get that merged ASAP.
Most helpful comment
Thanks for the heads up and the PR. I added the services.yaml basically as soon as it was implemented, before the full documentation was available. I'll get that merged ASAP.