App doesn't always connect using external address - works fine in browser
See original GitHub issueHome Assistant Android version: beta-2162-2de85151-full
Android version: 12
Phone model: Pixel 5a
Home Assistant version: 2022.3.4
Last working Home Assistant release (if known): don’t remember
Description of problem: I’m seeing intermittent weirdness.
If I connect locally and turn off wifi , it works and I get this in the log
2022-03-13 18:51:29 ERROR (MainThread) [frontend.js.latest.202203011] https://<external_ip>/lovelace/home?external_auth=1:0:0 Uncaught
When I’m away for a period of time, I’m unable to connect externally and this is in the log I can also replicate this by restarting HASS and then trying to connect using the app
2022-03-13 19:04:36 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 172.xx.xx.xx (172.xx.xx.xx). (HomeAssistant/Android Pixel 5a beta-2162-2de58151-2162)
I searched all folders and can’t find any ip_bans.yaml so it doesn’t seem to actually be banning the IP.
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
This is from the app log and seems to be the only mention of not being able to connect to the external URL
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: Unable to retrieve external auth
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: io.homeassistant.companion.android.common.data.authentication.AuthorizationException
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.ensureValidSession(AuthenticationRepositoryImpl.kt:231)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl.access$ensureValidSession(AuthenticationRepositoryImpl.kt:27)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at io.homeassistant.companion.android.common.data.authentication.impl.AuthenticationRepositoryImpl$ensureValidSession$1.invokeSuspend(Unknown Source:15)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at android.os.Handler.handleCallback(Handler.java:938)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at android.os.Handler.dispatchMessage(Handler.java:99)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at android.os.Looper.loopOnce(Looper.java:201)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at android.os.Looper.loop(Looper.java:288)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at android.app.ActivityThread.main(ActivityThread.java:7839)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at java.lang.reflect.Method.invoke(Native Method)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
03-13 19:06:18.704 24736 24736 E WebViewPresenterImpl: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
03-13 19:06:18.707 24736 24736 D UrlRepository: localUrl is: true and usesInternalSsid is: false
03-13 19:06:18.707 24736 24736 D UrlRepository: Using external URL
03-13 19:06:18.709 24736 24736 D UrlRepository: localUrl is: true and usesInternalSsid is: false
03-13 19:06:21.094 24736 24791 D OpenGLRenderer: endAllActiveAnimators on 0xb40000766d42b310 (RippleDrawable) with handle 0xb40000757d3e9480
Screenshot of problem:
Additional information: I’m not using a proxy. I have pfSense and my HASS instance is NAT’d
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (8 by maintainers)
Top GitHub Comments
Prioritize internal always tries the internal URL first, exactly as it says. Otherwise the internal URL will be used when the app detected the home wifi SSID which was required to be setup before the user can enter the internal URL.
Unrelated to this issue. You should only enable that setting if you leave location off as it mentions in the setting description.