twrecked / hass-aarlo

Asynchronous Arlo Component for Home Assistant
GNU Lesser General Public License v3.0
383 stars 78 forks source link

Error: authentication failed #978

Open mclausha1 opened 1 month ago

mclausha1 commented 1 month ago

I am unable to set up the intigration. I have followed steps that are found in the following video and it is not working for me.

https://youtu.be/Z3kk5N7VaCM?si=z2ZXJgffePxx71wY

This error originated from a custom integration.

Logger: custom_components.aarlo Source: custom_components/aarlo/init.py:421 integration: Arlo Camera Support (documentation, issues) First occurred: 9:08:09 AM (4 occurrences) Last logged: 9:10:57 AM

unable to connect to Arlo: attempt=1,sleep=15,error=authentication failed unable to connect to Arlo: attempt=2,sleep=30,error=authentication failed unable to connect to Arlo: attempt=3,sleep=60,error=authentication failed unable to connect to Arlo: attempt=4,sleep=120,error=authentication failed

tanderson1973 commented 1 month ago

Similar, had working and now wont/cant authenticate, Have tried removing, restarting, new gmail email, creating new app password, nothing........

Screenshot 2024-08-14 at 5 43 57 AM
nsleigh commented 1 month ago

Mine has just started failing (been running for months and only went wrong after OS upgrade). Checking my HASS Arlo mailbox there wasn't any recent 2FA emails.

This is in the debug log: 2024-08-14 10:43:46.716 WARNING (SyncWorker_17) [pyaarlo] error in new response={'meta': {'code': 400, 'error': 9204, 'message': 'Browser is not trusted'}} 2024-08-14 10:43:46.916 ERROR (SyncWorker_17) [pyaarlo] imap connection failed[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] ssl/tls alert handshake failure (_ssl.c:1000) 2024-08-14 10:43:46.917 ERROR (SyncWorker_17) [pyaarlo] 2fa startup failed

I have tried user_agent = arlo and linux but the same error.

@twrecked more detailed encrypted log attached. dump.txt

Edit: tried logging on to arlo webite with the same account (not my normal Arlo account) and I see the 2FA email but none from HA.

nsleigh commented 1 month ago

Looks like I fixed my issue, I can add either of these to aarlo.yaml cipher_list: "HIGH:!DH:!aNULL" or default_ciphers: True

Guess it is something related to the SSL config of my email provider.

pavlick commented 3 weeks ago

same issue for me, but adding ciphers to config didn't help

twrecked commented 3 weeks ago

@nsleigh Sorry; was busy; but that is the fix, and your right, maybe something changed with their certificate. You can try connecting with openssl and see if it reports anything strange.

@pavlick I'll push an update today, it won't fix your issue but it should give better error reporting - ie, it should say what exactly failed. It might not be an IMAP problem.

pavlick commented 3 weeks ago

@twrecked Most probably it is an IMAP problem:

2024-08-22 12:02:43.113 WARNING (SyncWorker_10) [pyaarlo] error in new response={'meta': {'code': 400, 'error': 9204, 'message': 'Browser is not trusted'}} 2024-08-22 12:02:43.856 ERROR (SyncWorker_10) [pyaarlo] imap connection failedb'[AUTHENTICATIONFAILED] Authentication Failed' 2024-08-22 12:02:43.856 ERROR (SyncWorker_10) [pyaarlo] login failed: 2fa: startup failed 2024-08-22 12:02:43.866 ERROR (SyncWorker_10) [custom_components.aarlo] unable to connect to Arlo: attempt=1,sleep=15,error=login failed: 2fa: startup failed

twrecked commented 3 weeks ago

You have the wrong username/password for your IMAP account.

The easiest way to check/change it is in this file .storage/core.config_entries.

pavlick commented 3 weeks ago

@twrecked it's all the same as it was before it stopped working after update

twrecked commented 3 weeks ago

Can you try the new release - it has better error reporting - and if it still doesn't work can you paste in the logs.

mclausha1 commented 3 weeks ago

@twreked when I put in my credentials the 2fa fails to start instantly This error originated from a custom integration.

Logger: custom_components.aarlo Source: custom_components/aarlo/init.py:422 integration: Arlo Camera Support (documentation, issues) First occurred: 8:34:23 AM (16 occurrences) Last logged: 9:06:43 AM

unable to connect to Arlo: attempt=1,sleep=15,error=login failed: 2fa: startup failed unable to connect to Arlo: attempt=2,sleep=30,error=login failed: 2fa: startup failed unable to connect to Arlo: attempt=3,sleep=60,error=login failed: 2fa: startup failed unable to connect to Arlo: attempt=4,sleep=120,error=login failed: 2fa: startup failed

pavlick commented 3 weeks ago

Here’s what I get: 2024-08-22 23:31:29.062 WARNING (SyncWorker_8) [pyaarlo] body-error=KeyError 2024-08-22 23:31:29.291 WARNING (SyncWorker_8) [pyaarlo] body-error=KeyError 2024-08-22 23:31:29.431 WARNING (SyncWorker_8) [pyaarlo] error in new response={'meta': {'code': 400, 'error': 9204, 'message': 'Browser is not trusted'}} 2024-08-22 23:31:30.360 ERROR (SyncWorker_8) [pyaarlo] imap connection failedb'[AUTHENTICATIONFAILED] Authentication Failed' 2024-08-22 23:31:30.361 ERROR (SyncWorker_8) [pyaarlo] login failed: 2fa: startup failed 2024-08-22 23:31:30.369 ERROR (SyncWorker_8) [custom_components.aarlo] unable to connect to Arlo: attempt=4,sleep=120,error=login failed: 2fa: startup failed 2024-08-22 23:31:30.370 ERROR (SyncWorker_8) [custom_components.aarlo] unable to connect to Arlo: stopping retries, too may failures

twrecked commented 3 weeks ago

@pavlick Can you turn on verbose debug, I need to see what is happening before the KeyError.

pavlick commented 3 weeks ago

@twrecked I removed credentials only:

2024-08-23 10:05:20.996 DEBUG (MainThread) [custom_components.aarlo] async setup for aarlo 2024-08-23 10:05:20.996 DEBUG (MainThread) [custom_components.aarlo.cfg] _async_load_yaml1 file_name for /config/aarlo.yaml 2024-08-23 10:05:21.002 DEBUG (MainThread) [custom_components.aarlo.cfg] _async_load_yaml2 file_name for /config/aarlo.yaml 2024-08-23 10:05:21.004 DEBUG (MainThread) [custom_components.aarlo.cfg] _async_load_yaml3 file_name for /config/aarlo.yaml 2024-08-23 10:05:21.009 DEBUG (MainThread) [custom_components.aarlo.cfg] l-config-file=/config/aarlo.yaml 2024-08-23 10:05:21.009 DEBUG (MainThread) [custom_components.aarlo.cfg] l-main-config={'cipher_list': '', 'recent_time': datetime.timedelta(seconds=3600), 'no_unicode_squash': True, 'refresh_devices_every': 2, 'save_media_to': '', 'packet_dump': False, 'conf_dir': '', 'backend': 'auto', 'refresh_modes_every': 0, 'http_connections': 5, 'save_updates_to': '', 'cache_videos': False, 'library_days': 27, 'stream_snapshot_stop': 0, 'serial_ids': False, 'request_timeout': datetime.timedelta(seconds=15), 'user_stream_delay': 1, 'http_max_size': 10, 'auth_host': 'https://ocapi-app.arlo.com', 'last_format': '%m-%d %H:%M', 'save_session': True, 'tfa_timeout': datetime.timedelta(seconds=3), 'stream_snapshot': False, 'verbose_debug': True, 'db_ding_time': datetime.timedelta(seconds=10), 'media_retry': [5, 15, 25], 'mqtt_hostname_check': True, 'scan_interval': datetime.timedelta(seconds=60), 'stream_timeout': datetime.timedelta(seconds=120), 'host': 'https://myapi.arlo.com', 'user_agent': 'arlo', 'mqtt_host': 'mqtt-cluster.arloxcld.com', 'snapshot_checks': [], 'reconnect_every': 0, 'db_motion_time': datetime.timedelta(seconds=30), 'hide_deprecated_services': True, 'mode_api': 'auto', 'mqtt_transport': 'tcp', 'tfa_total_timeout': datetime.timedelta(seconds=60), 'no_media_upload': False, 'snapshot_timeout': datetime.timedelta(seconds=45), 'injection_service': False} 2024-08-23 10:05:21.009 DEBUG (MainThread) [custom_components.aarlo.cfg] empty options, using defaults 2024-08-23 10:05:21.010 DEBUG (MainThread) [custom_components.aarlo.cfg] m-main-config={'username': '####', 'password': '####', 'tfa_type': 'email', 'add_aarlo_prefix': True, 'tfa_source': 'imap', 'tfa_host': 'imap.mail.me.com', 'tfa_username': '####', 'tfa_password': '####', 'cipher_list': '', 'recent_time': datetime.timedelta(seconds=3600), 'no_unicode_squash': True, 'refresh_devices_every': 2, 'save_media_to': '', 'packet_dump': False, 'conf_dir': '', 'backend': 'auto', 'refresh_modes_every': 0, 'http_connections': 5, 'save_updates_to': '', 'cache_videos': False, 'library_days': 27, 'stream_snapshot_stop': 0, 'serial_ids': False, 'request_timeout': datetime.timedelta(seconds=15), 'user_stream_delay': 1, 'http_max_size': 10, 'auth_host': 'https://ocapi-app.arlo.com', 'last_format': '%m-%d %H:%M', 'save_session': True, 'tfa_timeout': datetime.timedelta(seconds=3), 'stream_snapshot': False, 'verbose_debug': True, 'db_ding_time': datetime.timedelta(seconds=10), 'media_retry': [5, 15, 25], 'mqtt_hostname_check': True, 'scan_interval': datetime.timedelta(seconds=60), 'stream_timeout': datetime.timedelta(seconds=120), 'host': 'https://myapi.arlo.com', 'user_agent': 'arlo', 'mqtt_host': 'mqtt-cluster.arloxcld.com', 'snapshot_checks': [], 'reconnect_every': 0, 'db_motion_time': datetime.timedelta(seconds=30), 'hide_deprecated_services': True, 'mode_api': 'auto', 'mqtt_transport': 'tcp', 'tfa_total_timeout': datetime.timedelta(seconds=60), 'no_media_upload': False, 'snapshot_timeout': datetime.timedelta(seconds=45), 'injection_service': False} 2024-08-23 10:05:21.011 DEBUG (MainThread) [custom_components.aarlo.cfg] m-alarm-config={'disarmed_mode_name': 'disarmed', 'home_mode_name': 'home', 'away_mode_name': 'armed', 'night_mode_name': 'night', 'code_arm_required': False, 'code_disarm_required': False, 'trigger_time': datetime.timedelta(seconds=60), 'alarm_volume': 3, 'command_template': '{{action}}'} 2024-08-23 10:05:21.011 DEBUG (MainThread) [custom_components.aarlo.cfg] m-binary-sensor-config={'monitored_conditions': ['sound', 'motion', 'ding', 'cry', 'connectivity', 'contact', 'light', 'tamper', 'leak']} 2024-08-23 10:05:21.011 DEBUG (MainThread) [custom_components.aarlo.cfg] m-sensor-config={'monitored_conditions': ['last_capture', 'total_cameras', 'recent_activity', 'captured_today', 'battery_level', 'signal_strength', 'temperature', 'humidity', 'air_quality']} 2024-08-23 10:05:21.012 DEBUG (MainThread) [custom_components.aarlo.cfg] m-switch-config={'siren': True, 'all_sirens': True, 'siren_allow_off': True, 'siren_volume': 3, 'siren_duration': datetime.timedelta(seconds=10), 'snapshot': True, 'snapshot_timeout': datetime.timedelta(seconds=15), 'doorbell_silence': True} 2024-08-23 10:05:21.013 DEBUG (SyncWorker_17) [custom_components.aarlo.cfg] config={'username': '####', 'password': '####', 'tfa_type': 'email', 'add_aarlo_prefix': True, 'tfa_source': 'imap', 'tfa_host': 'imap.mail.me.com', 'tfa_username': '####', 'tfa_password': '####', 'cipher_list': '', 'recent_time': datetime.timedelta(seconds=3600), 'no_unicode_squash': True, 'refresh_devices_every': 2, 'save_media_to': '', 'packet_dump': False, 'conf_dir': '', 'backend': 'auto', 'refresh_modes_every': 0, 'http_connections': 5, 'save_updates_to': '', 'cache_videos': False, 'library_days': 27, 'stream_snapshot_stop': 0, 'serial_ids': False, 'request_timeout': datetime.timedelta(seconds=15), 'user_stream_delay': 1, 'http_max_size': 10, 'auth_host': 'https://ocapi-app.arlo.com', 'last_format': '%m-%d %H:%M', 'save_session': True, 'tfa_timeout': datetime.timedelta(seconds=3), 'stream_snapshot': False, 'verbose_debug': True, 'db_ding_time': datetime.timedelta(seconds=10), 'media_retry': [5, 15, 25], 'mqtt_hostname_check': True, 'scan_interval': datetime.timedelta(seconds=60), 'stream_timeout': datetime.timedelta(seconds=120), 'host': 'https://myapi.arlo.com', 'user_agent': 'arlo', 'mqtt_host': 'mqtt-cluster.arloxcld.com', 'snapshot_checks': [], 'reconnect_every': 0, 'db_motion_time': datetime.timedelta(seconds=30), 'hide_deprecated_services': True, 'mode_api': 'auto', 'mqtt_transport': 'tcp', 'tfa_total_timeout': datetime.timedelta(seconds=60), 'no_media_upload': False, 'snapshot_timeout': datetime.timedelta(seconds=45), 'injection_service': False} 2024-08-23 10:05:21.013 DEBUG (SyncWorker_17) [custom_components.aarlo.cfg] options={'username': '####', 'password': '####', 'tfa_type': 'email', 'add_aarlo_prefix': True, 'tfa_source': 'imap', 'tfa_host': 'imap.mail.me.com', 'tfa_username': '####', 'tfa_password': '####', 'cipher_list': '', 'recent_time': 3600, 'no_unicode_squash': True, 'refresh_devices_every': 2, 'save_media_to': '', 'packet_dump': False, 'conf_dir': '', 'backend': 'auto', 'refresh_modes_every': 0, 'http_connections': 5, 'save_updates_to': '', 'cache_videos': False, 'library_days': 27, 'stream_snapshot_stop': 0, 'serial_ids': False, 'request_timeout': 15, 'user_stream_delay': 1, 'http_max_size': 10, 'auth_host': 'https://ocapi-app.arlo.com', 'last_format': '%m-%d %H:%M', 'save_session': True, 'tfa_timeout': 3, 'stream_snapshot': False, 'verbose_debug': True, 'db_ding_time': 10, 'media_retry': [5, 15, 25], 'mqtt_hostname_check': True, 'scan_interval': 60, 'stream_timeout': 120, 'host': 'https://myapi.arlo.com', 'user_agent': 'arlo', 'mqtt_host': 'mqtt-cluster.arloxcld.com', 'snapshot_checks': [], 'reconnect_every': 0, 'db_motion_time': 30, 'hide_deprecated_services': True, 'mode_api': 'auto', 'mqtt_transport': 'tcp', 'tfa_total_timeout': 60, 'no_media_upload': False, 'snapshot_timeout': 45, 'injection_service': False, 'dump': False, 'storage_dir': '/config/.aarlo', 'wait_for_initial_setup': False} 2024-08-23 10:05:21.013 INFO (SyncWorker_17) [pyaarlo] pyarlo 0.8.0.9 starting... 2024-08-23 10:05:21.248 WARNING (SyncWorker_17) [pyaarlo] body-error=KeyError 2024-08-23 10:05:21.500 WARNING (SyncWorker_17) [pyaarlo] body-error=KeyError 2024-08-23 10:05:21.631 WARNING (SyncWorker_17) [pyaarlo] error in new response={'meta': {'code': 400, 'error': 9204, 'message': 'Browser is not trusted'}} 2024-08-23 10:05:22.645 ERROR (SyncWorker_17) [pyaarlo] imap connection failedb'[AUTHENTICATIONFAILED] Authentication Failed' 2024-08-23 10:05:22.646 ERROR (SyncWorker_17) [pyaarlo] login failed: 2fa: startup failed 2024-08-23 10:05:22.652 ERROR (SyncWorker_17) [custom_components.aarlo] unable to connect to Arlo: attempt=1,sleep=15,error=login failed: 2fa: startup failed

nsleigh commented 3 weeks ago

@nsleigh Sorry; was busy; but that is the fix, and your right, maybe something changed with their certificate. You can try connecting with openssl and see if it reports anything strange.

@twrecked No problem, just glad you are providing this component!

Not sure if this helps you/anyone, this is the response from the IMAP server - SSL-Session: Protocol : TLSv1.2 Cipher : AES256-SHA

twrecked commented 1 week ago

@pavlick It looks like you're hitting cloudflare issues. Can you try adding send_source into your aarlo.yaml, like this:

version: 1
aarlo:
  send_source: true

And there are a bunch of other things to try here.

If that doesn't work can you try enabling verbose debug.

pavlick commented 1 week ago

I'm not sure whether it's an arlo issue or iCloud imap. Here's what I've got: 2024-09-04 16:38:29.147 ERROR (SyncWorker_21) [pyaarlo] imap connection failedb'[AUTHENTICATIONFAILED] Authentication Failed' 2024-09-04 16:38:29.147 ERROR (SyncWorker_21) [pyaarlo] login failed: 2fa: startup failed 2024-09-04 16:38:29.207 ERROR (SyncWorker_21) [custom_components.aarlo] unable to connect to Arlo: attempt=1,sleep=15,error=login failed: 2fa: startup failed 2024-09-04 16:38:44.208 DEBUG (SyncWorker_21) [custom_components.aarlo] login-attempt=2 2024-09-04 16:38:44.209 DEBUG (SyncWorker_21) [custom_components.aarlo.cfg] config={'username': '...', 'password': '...', 'tfa_type': 'email', 'add_aarlo_prefix': True, 'tfa_source': 'imap', 'tfa_host': 'imap.mail.me.com', 'tfa_username': '...', 'tfa_password': '...', 'reconnect_every': 0, 'tfa_total_timeout': datetime.timedelta(seconds=60), 'refresh_modes_every': 0, 'save_session': False, 'conf_dir': '', 'stream_snapshot': False, 'injection_service': False, 'save_updates_to': '', 'mqtt_hostname_check': True, 'user_agent': 'linux', 'snapshot_timeout': datetime.timedelta(seconds=45), 'db_motion_time': datetime.timedelta(seconds=30), 'auth_host': 'https://ocapi-app.arlo.com', 'scan_interval': datetime.timedelta(seconds=60), 'last_format': '%m-%d %H:%M', 'refresh_devices_every': 2, 'verbose_debug': True, 'no_unicode_squash': True, 'mqtt_host': 'mqtt-cluster.arloxcld.com', 'no_media_upload': False, 'cipher_list': '', 'stream_snapshot_stop': 0, 'host': 'https://myapi.arlo.com', 'user_stream_delay': 1, 'mqtt_transport': 'tcp', 'library_days': 27, 'http_connections': 5, 'mode_api': 'auto', 'media_retry': [5, 15, 25], 'snapshot_checks': [], 'backend': 'auto', 'hide_deprecated_services': True, 'cache_videos': False, 'save_media_to': '', 'packet_dump': False, 'http_max_size': 10, 'request_timeout': datetime.timedelta(seconds=15), 'recent_time': datetime.timedelta(seconds=3600), 'stream_timeout': datetime.timedelta(seconds=120), 'db_ding_time': datetime.timedelta(seconds=10), 'tfa_timeout': datetime.timedelta(seconds=3), 'serial_ids': False, 'send_source': True, 'ecdh_curve': 'secp384r1'} 2024-09-04 16:38:44.209 DEBUG (SyncWorker_21) [custom_components.aarlo.cfg] options={'username': '...', 'password': '...', 'tfa_type': 'email', 'add_aarlo_prefix': True, 'tfa_source': 'imap', 'tfa_host': 'imap.mail.me.com', 'tfa_username': '...', 'tfa_password': '...', 'reconnect_every': 0, 'tfa_total_timeout': 60, 'refresh_modes_every': 0, 'save_session': False, 'conf_dir': '', 'stream_snapshot': False, 'injection_service': False, 'save_updates_to': '', 'mqtt_hostname_check': True, 'user_agent': 'linux', 'snapshot_timeout': 45, 'db_motion_time': 30, 'auth_host': 'https://ocapi-app.arlo.com', 'scan_interval': 60, 'last_format': '%m-%d %H:%M', 'refresh_devices_every': 2, 'verbose_debug': True, 'no_unicode_squash': True, 'mqtt_host': 'mqtt-cluster.arloxcld.com', 'no_media_upload': False, 'cipher_list': '', 'stream_snapshot_stop': 0, 'host': 'https://myapi.arlo.com', 'user_stream_delay': 1, 'mqtt_transport': 'tcp', 'library_days': 27, 'http_connections': 5, 'mode_api': 'auto', 'media_retry': [5, 15, 25], 'snapshot_checks': [], 'backend': 'auto', 'hide_deprecated_services': True, 'cache_videos': False, 'save_media_to': '', 'packet_dump': False, 'http_max_size': 10, 'request_timeout': 15, 'recent_time': 3600, 'stream_timeout': 120, 'db_ding_time': 10, 'tfa_timeout': 3, 'serial_ids': False, 'send_source': True, 'ecdh_curve': 'secp384r1', 'dump': False, 'storage_dir': '/config/.aarlo', 'wait_for_initial_setup': False} 2024-09-04 16:38:44.210 INFO (SyncWorker_21) [pyaarlo] pyarlo 0.8.0.9 starting... 2024-09-04 16:38:44.454 WARNING (SyncWorker_21) [pyaarlo] body-error=KeyError 2024-09-04 16:38:44.699 WARNING (SyncWorker_21) [pyaarlo] body-error=KeyError 2024-09-04 16:38:44.845 WARNING (SyncWorker_21) [pyaarlo] error in new response={'meta': {'code': 400, 'error': 9204, 'message': 'Browser is not trusted'}} 2024-09-04 16:38:45.863 ERROR (SyncWorker_21) [pyaarlo] imap connection failedb'[AUTHENTICATIONFAILED] Authentication Failed' 2024-09-04 16:38:45.864 ERROR (SyncWorker_21) [pyaarlo] login failed: 2fa: startup failed 2024-09-04 16:38:45.874 ERROR (SyncWorker_21) [custom_components.aarlo] unable to connect to Arlo: attempt=2,sleep=30,error=login failed: 2fa: startup failed

and this is the config: version: 1 aarlo: verbose_debug: true send_source: true user_agent: linux save_session: false ecdh_curve: secp384r1

twrecked commented 1 week ago

It's looking more like an IMAP issue.

Did you set up an app specific password for iCloud?

pavlick commented 1 week ago

Yep, I have an app specific password. And as I mentioned it worked just fine right before the upgrade of the addon. Well, probably there was an active session for some time, it all stopped working with the upgrade

twrecked commented 1 week ago

Sorry, you did say it worked before. I have an icloud account somewhere, I'll try it here.