question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App doesn't always connect using external address - works fine in browser

See original GitHub issue

Home 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:closed
  • Created 2 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dshokouhicommented, Mar 27, 2022

One question I have though is, it would switch from nabu casa URL to my internal URL if I was on local connection right if let’s say the wifi went down, even though the setting you just said is turned off now?

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.

1reaction
dshokouhicommented, Mar 27, 2022

I think I have this issue too, as soon as I disable "Prioritize internal URL", that fixes the android app.

Unrelated to this issue. You should only enable that setting if you leave location off as it mentions in the setting description.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Programs aren't able to connect to internet, but my browsers are
Hello, I just recently posted about this topic and I thought it was solved but the problem has arisen again. All of my...
Read more >
How to Fix the ERR_CONNECTION_REFUSED Error in Chrome
When you visit a website using Google Chrome and encounter this message, it means that your attempt to connect was refused. This error...
Read more >
How to fix the problem 'can't connect to server' but the internet ...
It means that your computer is sending out packets addressed to some other computer's IP address, but it's not receiving any response packets...
Read more >
Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
Localhost refused to connect error can be caused by an incorrectly configured port, insufficient permissions, or an inoperative web server.
Read more >
Fix internet connection problems on Android devices
If you can't access the Internet on your Android device, either through an app or a website, try these troubleshooting steps. Signs of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found