home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.3k stars 636 forks source link

WearOS Could not register watch / Watch was unable to register #4606

Closed AnnoyingTechnology closed 1 month ago

AnnoyingTechnology commented 1 month ago

Home Assistant Android app version(s): 2024.7.3-full

Android version(s): 13

Device model(s): Pixel 7 Pro Pixel Watch 2

Home Assistant version: 2024.4.3 20240404.2

Last working Home Assistant release (if known): none

Description of problem, include YAML if issue is related to notifications: Cannot login using Pixel Watch / WearOS

Error Could not register watch on the Android side Error Watch was unable to register in the logs

Companion App Logs:

--------- beginning of main
09-04 19:37:52.760  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10298; state: ENABLED
09-04 19:37:52.792  5182  5182 W ziparchive: Unable to open '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/split_config.arm64_v8a.dm': No such file or directory
09-04 19:37:52.792  5182  5182 W ziparchive: Unable to open '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/split_config.arm64_v8a.dm': No such file or directory
09-04 19:37:52.792  5182  5182 W mpanion.android: Entry not found
09-04 19:37:52.793  5182  5182 W ziparchive: Unable to open '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/split_config.xxxhdpi.dm': No such file or directory
09-04 19:37:52.793  5182  5182 W ziparchive: Unable to open '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/split_config.xxxhdpi.dm': No such file or directory
09-04 19:37:52.793  5182  5182 W mpanion.android: Entry not found
09-04 19:37:52.796  5182  5182 W mpanion.android: JIT profile information will not be recorded: profile file does not exist.
09-04 19:37:52.796  5182  5182 W mpanion.android: JIT profile information will not be recorded: profile file does not exist.
09-04 19:37:52.802  5182  5182 V GraphicsEnvironment: ANGLE Developer option for 'io.homeassistant.companion.android' set to: 'default'
09-04 19:37:52.802  5182  5182 V GraphicsEnvironment: ANGLE GameManagerService for io.homeassistant.companion.android: false
09-04 19:37:52.802  5182  5182 V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
09-04 19:37:52.804  5182  5182 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
09-04 19:37:52.806  5182  5182 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
09-04 19:37:52.816  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 183155436; UID 10298; state: ENABLED
09-04 19:37:52.818  5182  5182 I FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
09-04 19:37:52.821  5182  5182 I FirebaseInitProvider: FirebaseApp initialization successful
09-04 19:37:52.827  5182  5182 D WM-WrkMgrInitializer: Initializing WorkManager with default configuration.
09-04 19:37:52.830  5182  5182 W mpanion.android: Accessing hidden field Ljava/util/Collections$SynchronizedCollection;->mutex:Ljava/lang/Object; (max-target-o, reflection, denied)
09-04 19:37:52.830  5182  5182 W mpanion.android: Accessing hidden method Ljava/util/Collections$SynchronizedSet;-><init>(Ljava/util/Set;Ljava/lang/Object;)V (max-target-o, reflection, denied)
09-04 19:37:52.830  5182  5182 W mpanion.android: Accessing hidden method Ljava/util/Collections$SynchronizedCollection;-><init>(Ljava/util/Collection;Ljava/lang/Object;)V (max-target-o, reflection, denied)
09-04 19:37:52.831  5182  5182 D WM-PackageManagerHelper: Skipping component enablement for androidx.work.impl.background.systemjob.SystemJobService
09-04 19:37:52.831  5182  5182 D WM-Schedulers: Created SystemJobScheduler and enabled SystemJobService
09-04 19:37:52.833  5182  5182 D Sentry  : io.sentry.auto-init read: false
09-04 19:37:52.833  5182  5182 I Sentry  : Retrieving auto-init from AndroidManifest.xml
09-04 19:37:52.857  5182  5210 D CompatibilityChangeReporter: Compat change id reported: 160794467; UID 10298; state: ENABLED
09-04 19:37:52.869  5182  5210 D CompatibilityChangeReporter: Compat change id reported: 194532703; UID 10298; state: ENABLED
09-04 19:37:52.883  5182  5220 D WearOnboardingListener: onMessageReceived: MessageEventParcelable[16452,/request_home_assistant_instance, size=0]
09-04 19:37:52.883  5182  5220 D WearOnboardingListener: sendHomeAssistantInstance: 7f5019e1
09-04 19:37:52.891  5182  5220 D ServerConnectionInfo: Using external URL
09-04 19:37:52.894  5182  5182 D SensorReceiver: Received intent: android.net.wifi.STATE_CHANGE
09-04 19:37:52.895  5182  5182 D SensorReceiver: Received intent: android.net.wifi.WIFI_STATE_CHANGED
09-04 19:37:52.895  5182  5182 D SensorReceiver: Sensor(s) [wifi_state] corresponding to received event android.net.wifi.WIFI_STATE_CHANGED are disabled, skipping sensors update
09-04 19:37:52.895  5182  5182 D SensorReceiver: Received intent: android.media.RINGER_MODE_CHANGED
09-04 19:37:52.896  5182  5182 D SensorReceiver: Sensor(s) [audio_sensor] corresponding to received event android.media.RINGER_MODE_CHANGED are disabled, skipping sensors update
09-04 19:37:52.898  5182  5213 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:37:52.923  5182  5182 D WearOnboardingListener: sendHomeAssistantInstance: success
09-04 19:37:52.941  5182  5213 E SensorReceiver: Issue requesting updates for Notification sensors
09-04 19:37:52.941  5182  5213 E SensorReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:146)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.updateActiveNotificationCount(NotificationSensorManager.kt:236)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.requestSensorUpdate(NotificationSensorManager.kt:102)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorManager$DefaultImpls.requestSensorUpdate(SensorManager.kt:138)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.requestSensorUpdate(NotificationSensorManager.kt:25)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.updateSensors(SensorReceiverBase.kt:184)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorReceiverBase$onReceive$3.invokeSuspend(SensorReceiverBase.kt:154)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
09-04 19:37:52.941  5182  5213 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
09-04 19:37:52.957  5182  5215 I WebViewFactory: Loading com.android.webview version 117.0.5938.140 (code 593814001)
09-04 19:37:52.968  5182  5215 D nativeloader: classloader namespace configured for unbundled product apk. library_path=/product/app/webview/lib/arm64:/product/app/webview/webview.apk!/lib/arm64-v8a:/product/lib64:/system/product/lib64
09-04 19:37:52.995  5182  5215 I cr_WVCFactoryProvider: Loaded version=117.0.5938.140 minSdkVersion=1 isBundle=false multiprocess=true packageId=2
09-04 19:37:53.009  5182  5215 I cr_LibraryLoader: Successfully loaded native library
09-04 19:37:53.009  5182  5215 I cr_CachingUmaRecorder: Flushed 7 samples from 7 histograms, 0 samples were dropped.
09-04 19:37:53.014  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:37:53.014  5182  5214 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:37:53.015  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:37:53.015  5182  5222 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=d62d7e4d-f4d0-4f9d-81ef-2a59147b3572, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
09-04 19:37:53.057  5182  5238 D TrafficStats: tagSocket(104) with statsTag=0xffffffff, statsUid=-1
09-04 19:37:53.160  5182  5215 D SensorReceiver: Nothing to update for server 1 (Home)
09-04 19:37:53.161  5182  5215 I SensorReceiver: Sensor updates and sync completed
09-04 19:37:53.758  5182  5249 D vulkan  : searching for layers in '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/lib/arm64'
09-04 19:37:53.758  5182  5249 D vulkan  : searching for layers in '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/base.apk!/lib/arm64-v8a'
09-04 19:37:53.758  5182  5249 D vulkan  : searching for layers in '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/split_config.arm64_v8a.apk!/lib/arm64-v8a'
09-04 19:37:53.761  5182  5249 D vulkan  : searching for layers in '/data/app/~~Fkt-Dz4-fooxRWKLffipig==/io.homeassistant.companion.android-OYzOX6oY4MdCpNs8Z1yiTQ==/split_config.xxxhdpi.apk!/lib/arm64-v8a'
09-04 19:37:53.781  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 10298; state: ENABLED
09-04 19:37:53.797  5182  5182 D SettingsWearAct: Waiting on Results for both connected nodes and nodes with app
09-04 19:37:53.804  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 237531167; UID 10298; state: DISABLED
09-04 19:37:53.810  5182  5182 D SettingsWearAct: Waiting on Results for both connected nodes and nodes with app
09-04 19:37:53.810  5182  5182 D SettingsWearAct: Capable Nodes: [Node{Google Pixel Watch 2, id=7f5019e1, hops=1, isNearby=true}]
09-04 19:37:53.810  5182  5182 D SettingsWearAct: Installed on all devices
09-04 19:37:53.828  5182  5264 I Gralloc4: Adding additional valid usage bits: 0x0
09-04 19:37:53.859  5182  5182 W mpanion.android: Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateMap.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Common causes for lock verification issues are non-optimized dex code
09-04 19:37:53.859  5182  5182 W mpanion.android: and incorrect proguard optimizations.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method void androidx.compose.runtime.snapshots.SnapshotStateMap.update(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method boolean androidx.compose.runtime.snapshots.SnapshotStateMap.removeIf$runtime_release(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method boolean androidx.compose.runtime.snapshots.SnapshotStateList.conditionalUpdate(boolean, kotlin.jvm.functions.Function1) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method boolean androidx.compose.runtime.snapshots.SnapshotStateList.conditionalUpdate$default(androidx.compose.runtime.snapshots.SnapshotStateList, boolean, kotlin.jvm.functions.Function1, int, java.lang.Object) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateList.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method void androidx.compose.runtime.snapshots.SnapshotStateList.update(boolean, kotlin.jvm.functions.Function1) failed lock verification and will run slower.
09-04 19:37:53.859  5182  5182 W mpanion.android: Method void androidx.compose.runtime.snapshots.SnapshotStateList.update$default(androidx.compose.runtime.snapshots.SnapshotStateList, boolean, kotlin.jvm.functions.Function1, int, java.lang.Object) failed lock verification and will run slower.
09-04 19:37:53.949  5182  5182 D SettingsWearViewModel: Requesting config from node 7f5019e1
09-04 19:37:53.954  5182  5182 D SettingsWearViewModel: Request for config sent successfully
09-04 19:37:54.101  5182  5182 D SettingsWearViewModel: onDataChanged 1
09-04 19:37:54.126  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 191844585; UID 10298; state: ENABLED
09-04 19:37:54.181  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 214741472; UID 10298; state: ENABLED
09-04 19:37:54.183  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 171228096; UID 10298; state: ENABLED
09-04 19:37:54.207  5182  5308 D libEGL  : loaded /vendor/lib64/egl/libGLES_mali.so
09-04 19:37:54.208  5182  5281 W cr_media: BLUETOOTH_CONNECT permission is missing.
09-04 19:37:54.208  5182  5281 W cr_media: registerBluetoothIntentsIfNeeded: Requires BLUETOOTH permission
09-04 19:37:54.214  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 193247900; UID 10298; state: ENABLED
09-04 19:37:56.237  5182  5362 D WearOnboardingListener: onMessageReceived: MessageEventParcelable[16454,/request_home_assistant_instance, size=0]
09-04 19:37:56.238  5182  5362 D WearOnboardingListener: sendHomeAssistantInstance: 7f5019e1
09-04 19:37:56.238  5182  5362 D ServerConnectionInfo: Using external URL
09-04 19:37:56.241  5182  5182 D WearOnboardingListener: sendHomeAssistantInstance: success
09-04 19:37:56.952  5182  5182 W cr_AwAutofillManager: Autofill is disabled: AutofillManager isn't available in given Context.
09-04 19:37:56.965  5182  5182 D InputMethodManager: showSoftInput() view=android.webkit.WebView{aa4033b VFEDHVC.. .F...... 0,0-1440,2976 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
09-04 19:37:57.004  5182  5182 D InsetsController: show(ime(), fromIme=true)
09-04 19:37:58.599  5182  5374 D ProfileInstaller: Skipping profile installation for io.homeassistant.companion.android
09-04 19:37:59.322  5182  5182 W cr_AwAutofillManager: Autofill is disabled: AutofillManager isn't available in given Context.
09-04 19:37:59.336  5182  5182 D InputMethodManager: showSoftInput() view=android.webkit.WebView{aa4033b VFEDHVC.. .F...... 0,0-1440,1779 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
09-04 19:37:59.386  5182  5182 D InsetsController: show(ime(), fromIme=true)
09-04 19:37:59.400  5182  5182 D InsetsController: show(ime(), fromIme=true)
09-04 19:38:04.322  5182  5192 W mpanion.android: Cleared Reference was only reachable from finalizer (only reported once)
09-04 19:38:04.330  5182  5192 I mpanion.android: Background concurrent copying GC freed 223695(10MB) AllocSpace objects, 34(1400KB) LOS objects, 75% free, 9748KB/38MB, paused 93us,39us total 111.130ms
09-04 19:38:07.312  5182  5182 D CompatibilityChangeReporter: Compat change id reported: 78294732; UID 10298; state: ENABLED
09-04 19:38:07.330  5182  5182 D SettingsWearViewModel: Successfully sent auth to wear
09-04 19:38:07.333  5182  5182 D SettingsWearViewModel: onDataChanged 1
09-04 19:38:07.844  5182  5249 D OpenGLRenderer: endAllActiveAnimators on 0xb400006fa1331820 (UnprojectedRipple) with handle 0xb400006eb129a1e0
09-04 19:38:08.602  5182  5182 D SettingsWearViewModel: onDataChanged 1
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel: Watch was unable to register: retrofit2.HttpException: HTTP 404 
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:529)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at java.lang.Thread.run(Thread.java:1012)
09-04 19:38:08.617  5182  5182 D SettingsWearViewModel: onDataChanged 1
09-04 19:38:12.162  5182  5249 D OpenGLRenderer: endAllActiveAnimators on 0xb400006fa1215740 (UnprojectedRipple) with handle 0xb400006eb1277380
09-04 19:38:13.342  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.342  5182  5182 D ServerConnectionInfo: Using external URL
09-04 19:38:13.342  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.343  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.343  5182  5182 D ServerConnectionInfo: Using external URL
09-04 19:38:13.343  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.345  5182  5233 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.371  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.383  5182  5233 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.384  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.404  5182  5233 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.404  5182  5233 D ServerConnectionInfo: Using external URL
09-04 19:38:13.407  5182  5233 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.407  5182  5233 D ServerConnectionInfo: Using external URL
09-04 19:38:13.414  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.415  5182  5182 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 0, currentMillis: 1725471493415)
09-04 19:38:13.418  5182  5182 D WebviewActivity: Current webview package com.android.webview and version 117.0.5938.140
09-04 19:38:13.419  5182  5182 D WebviewActivity: Matter/Thread step changed to NOT_STARTED
09-04 19:38:13.420  5182  5241 D TrafficStats: tagSocket(126) with statsTag=0xffffffff, statsUid=-1
09-04 19:38:13.421  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.421  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.421  5182  5182 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 0, currentMillis: 1725471493421)
09-04 19:38:13.481  5182  5427 D WebSocketRepository: Websocket: onOpen
09-04 19:38:13.483  5182  5427 D WebSocketRepository: Websocket: onMessage (text)
09-04 19:38:13.487  5182  5427 D WebSocketRepository: Message number null received
09-04 19:38:13.487  5182  5427 D WebSocketRepository: Websocket: onMessage (text)
09-04 19:38:13.487  5182  5233 D WebSocketRepository: Auth Requested
09-04 19:38:13.487  5182  5427 D WebSocketRepository: Message number null received
09-04 19:38:13.488  5182  5215 D WebSocketRepository: Sending message 1: {type=supported_features, id=1, features={coalesce_messages=1}}
09-04 19:38:13.488  5182  5215 D WebSocketRepository: Sending message 2: {type=auth/current_user, id=2}
09-04 19:38:13.488  5182  5215 D WebSocketRepository: Message number 2 sent
09-04 19:38:13.498  5182  5427 D WebSocketRepository: Websocket: onMessage (text)
09-04 19:38:13.498  5182  5427 D WebSocketRepository: Message number 1 received
09-04 19:38:13.503  5182  5427 D WebSocketRepository: Websocket: onMessage (text)
09-04 19:38:13.504  5182  5427 D WebSocketRepository: Message number 2 received
09-04 19:38:13.513  5182  5214 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.514  5182  5223 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=8cbd1dd8-db5f-4b62-92f0-9f17437a80b1, tags={ io.homeassistant.companion.android.websocket.WebsocketManager } ]
09-04 19:38:13.515  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.517  5182  5219 I WM-Processor: Moving WorkSpec (6cc40780-e4fc-450c-a2b1-290055be8c96) to the foreground
09-04 19:38:13.521  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.521  5182  5182 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 0, currentMillis: 1725471493521)
09-04 19:38:13.521  5182  5215 D SensorWorker: Updating all Sensors in foreground.
09-04 19:38:13.522  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.525  5182  5182 I WM-SystemFgDispatcher: Started foreground service Intent { act=ACTION_START_FOREGROUND cmp=io.homeassistant.companion.android/androidx.work.impl.foreground.SystemForegroundService (has extras) }
09-04 19:38:13.528  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.528  5182  5182 D ServerConnectionInfo: Using external URL
09-04 19:38:13.529  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.529  5182  5182 D ServerConnectionInfo: Using external URL
09-04 19:38:13.553  5182  5215 E SensorReceiver: Issue requesting updates for Notification sensors
09-04 19:38:13.553  5182  5215 E SensorReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:146)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.updateActiveNotificationCount(NotificationSensorManager.kt:236)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.requestSensorUpdate(NotificationSensorManager.kt:102)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorManager$DefaultImpls.requestSensorUpdate(SensorManager.kt:138)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.requestSensorUpdate(NotificationSensorManager.kt:25)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.updateSensors(SensorReceiverBase.kt:184)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorWorkerBase$doWork$2.invokeSuspend(SensorWorkerBase.kt:67)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
09-04 19:38:13.553  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
09-04 19:38:13.561  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.562  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.654  5182  5215 D SensorReceiver: Nothing to update for server 1 (Home)
09-04 19:38:13.654  5182  5215 I SensorReceiver: Sensor updates and sync completed
09-04 19:38:13.658  5182  5219 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=6cc40780-e4fc-450c-a2b1-290055be8c96, tags={ io.homeassistant.companion.android.sensors.SensorWorker } ]
09-04 19:38:13.661  5182  5182 I WM-SystemFgDispatcher: Stopping foreground service
09-04 19:38:13.674  5182  5444 D WebviewActivity: External bus {"type":"config/get","id":1}
09-04 19:38:13.676  5182  5182 D WebviewActivity: externalBus({"id":1,"type":"result","success":true,"result":{"hasSettingsScreen":true,"canWriteTag":true,"hasExoPlayer":true,"canCommissionMatter":true,"canImportThreadCredentials":true,"hasAssist":true,"hasBarCodeScanner":1}});
09-04 19:38:13.692  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:13.692  5182  5182 D ServerConnectionInfo: Using external URL
09-04 19:38:13.693  5182  5182 D WebviewActivity: Callback null
09-04 19:38:13.693  5182  5182 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
09-04 19:38:13.693  5182  5182 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
09-04 19:38:13.694  5182  5215 D WebViewPresenterImpl: Try getting color from webview color "#101e24".
09-04 19:38:13.694  5182  5215 I WebViewPresenterImpl: Found color -15720924.
09-04 19:38:13.694  5182  5215 D WebViewPresenterImpl: Try getting color from webview color "#111111".
09-04 19:38:13.694  5182  5215 I WebViewPresenterImpl: Found color -15658735.
09-04 19:38:14.114  5182  5444 D WebviewActivity: External bus {"type":"connection-status","payload":{"event":"connected"},"id":2}
09-04 19:38:14.163  5182  5444 D WebviewActivity: External bus {"type":"theme-update","id":3}
09-04 19:38:14.165  5182  5182 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:14.193  5182  5182 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
09-04 19:38:14.193  5182  5182 D WebviewActivity: Color from webview is "#101e24-SPACER-#111111"
09-04 19:38:14.193  5182  5215 D WebViewPresenterImpl: Try getting color from webview color "#101e24".
09-04 19:38:14.193  5182  5215 I WebViewPresenterImpl: Found color -15720924.
09-04 19:38:14.193  5182  5215 D WebViewPresenterImpl: Try getting color from webview color "#111111".
09-04 19:38:14.193  5182  5215 I WebViewPresenterImpl: Found color -15658735.
09-04 19:38:17.896  5182  5444 D WebviewActivity: External bus {"type":"config_screen/show","id":4}
09-04 19:38:17.907  5182  5182 D IntegrationRepository: setAppActive(): false
09-04 19:38:17.907  5182  5182 D IntegrationRepository: setAppActive(): false
09-04 19:38:17.939  5182  5182 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 0, currentMillis: 1725471497939)
09-04 19:38:17.946  5182  5182 D SensorReceiver: Received intent: io.homeassistant.companion.android.UPDATE_SENSORS
09-04 19:38:17.948  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:17.982  5182  5215 E SensorReceiver: Issue requesting updates for Notification sensors
09-04 19:38:17.982  5182  5215 E SensorReceiver: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:146)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.updateActiveNotificationCount(NotificationSensorManager.kt:236)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.requestSensorUpdate(NotificationSensorManager.kt:102)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorManager$DefaultImpls.requestSensorUpdate(SensorManager.kt:138)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.sensors.NotificationSensorManager.requestSensorUpdate(NotificationSensorManager.kt:25)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorReceiverBase.updateSensors(SensorReceiverBase.kt:184)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at io.homeassistant.companion.android.common.sensors.SensorReceiverBase$onReceive$3.invokeSuspend(SensorReceiverBase.kt:154)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
09-04 19:38:17.982  5182  5215 E SensorReceiver:    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)
09-04 19:38:17.988  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:17.988  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:17.992  5182  5215 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
09-04 19:38:18.004  5182  5239 D TrafficStats: tagSocket(328) with statsTag=0xffffffff, statsUid=-1
09-04 19:38:18.050  5182  5215 D SensorReceiver: Nothing to update for server 1 (Home)
09-04 19:38:18.050  5182  5215 I SensorReceiver: Sensor updates and sync completed
09-04 19:38:18.127  5182  5182 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: false, expireMillis: 0, currentMillis: 1725471498127)
09-04 19:38:18.127  5182  5182 D IntegrationRepository: setAppActive(): true
09-04 19:38:23.400  5182  5249 D OpenGLRenderer: endAllActiveAnimators on 0xb400006fa13f09f0 (RippleDrawable) with handle 0xb400006eb12c20b0
09-04 19:38:23.422  5182  5182 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: true, expireMillis: 0, currentMillis: 1725471503422)
09-04 19:38:23.422  5182  5182 D IntegrationRepository: setAppActive(): true
09-04 19:38:26.484  5182  5215 D LogcatReader: Read logcat for pid 5182

Screenshot or video of problem:

Additional information: HTTP logs

192.168.1.38 - - [04/Sep/2024:17:50:59 +0000] "GET /auth/providers HTTP/2.0" 200 102 "-" "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro Build/X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36"
192.168.1.38 - - [04/Sep/2024:17:50:59 +0000] "POST /auth/login_flow HTTP/2.0" 200 199 "-" "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro Build/X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36 Home Assistant/2024.7.3-13278 (Android 13; Pixel 7 Pro)"
192.168.1.38 - - [04/Sep/2024:17:51:01 +0000] "GET /service_worker.js HTTP/2.0" 304 0 "https://ha.julienarnaud.fr/service_worker.js" "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro Build/X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36"
192.168.1.38 - - [04/Sep/2024:17:51:13 +0000] "POST /auth/login_flow/9034565REDACTEDd8d89b5 HTTP/2.0" 200 160 "-" "Mozilla/5.0 (Linux; Android 13; Pixel 7 Pro Build/X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/117.0.0.0 Mobile Safari/537.36 Home Assistant/2024.7.3-13278 (Android 13; Pixel 7 Pro)"
192.168.1.210 - - [04/Sep/2024:17:51:15 +0000] "POST /auth/token HTTP/2.0" 404 107 "-" "Home Assistant/2024.7.3-13278 (Android 13; Google Pixel Watch 2)"

seems to be a problematic 404 on /auth/token

dshokouhi commented 1 month ago

interesting your server returned a 404 error when attempting to register the device. Have you setup the Wear OS app before? Anything you can tell us about your networking setup?

404 errors are not ones the app can solve but usually indicate something on the server side.

09-04 19:38:07.330  5182  5182 D SettingsWearViewModel: Successfully sent auth to wear

So the phone was able to authenticate however it seems it got rejected by the watch.

09-04 19:38:08.604  5182  5182 E SettingsWearViewModel: Watch was unable to register: retrofit2.HttpException: HTTP 404 
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:529)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
09-04 19:38:08.604  5182  5182 E SettingsWearViewModel:     at java.lang.Thread.run(Thread.java:1012)
AnnoyingTechnology commented 1 month ago

Yeah, the phone has absolutely zero issue. It works very well and always has.

My network setup is fairly straightforward, HA in a LXC, Nginx as a reverse proxy in another LXC, ModSec, Suricata, Pfsense (split-DNS).

This is from my local network, with the phone on wifi.

The watch is brand new, purchased only for HA. A few days ago I tried a WatchOS of a colleague it logged-in to my HA instance just fine (this was from a different network).

edit: I can also access my HA instance fine from any network (1 year of hindsight)

dshokouhi commented 1 month ago

if you bypass your own proxy setup does it register as expected? i suspect somewhere in that setup something is getting rejected. By default Wear OS does its own proxy magic from phone to watch so your network setup may not see things properly as a result of that proxying that apps cant avoid.

the thing is if the server returns a 404 error we cant fix that as its happening on the server side.

AnnoyingTechnology commented 1 month ago

bypassing the proxy is honestly very painful. I would have to obtain a certificate, alter the DNS resolution, etc.

I'm not familiar with that WatchOS proxy magic, but maybe if you tell me more about it, or refer me to some documentation I would be able to diagnose the issue myself

AnnoyingTechnology commented 1 month ago

I'm quite baffled by a 404. 403 and packets dropped I could pinpoint to WAF or IDPS. But I can't make sense of what could produce a 404.

dshokouhi commented 1 month ago

its really just the first sentence from: https://developer.android.com/training/wearables/data/network-communication#network-access

When a watch has a Bluetooth connection to a phone, the watch's network traffic is generally proxied through the phone.

Have you made sure to properly configure the proxy and network to ensure the APIs are always accessible?

this page may provide some more tips for your own setup: https://companion.home-assistant.io/docs/troubleshooting/networking#addendum-reverse-proxy-via-nginx

I am not entirely sure where exactly the 404 is coming but the app makes a request and we get a response and in this case the response is not expected.

AnnoyingTechnology commented 1 month ago

I may be on something, I hide services from Google. The Pixel presents itself as "Pixel 7 Pro", the watch presents itself as "Google Pixel Watch 2". Pretty sure it's on my side that I ban the word Google. Going to check this out

AnnoyingTechnology commented 1 month ago

Ok, very sorry. That was it.