-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConnectionResetError in v2.x #362
Comments
This comment has been minimized.
This comment has been minimized.
Thanks, Alan Tse. Here the info: Step 1: Step 2: Step 3:
Step 4: For info: the config section in configuration.yalm
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi Alan Tse, No luck. Same error:
|
Now, testing v2.2.0. I think is a related problem.
Error:
|
The history for me:
|
Need some testers on a theory on why we're seeing disconnects. You'll need to be comfortable directly editing your alexalogin.py. Please report back what happens if you make each of these edits. If it works with the first option, you can stop. At line 55 add one additional line. Original: self._ssl = ssl.create_default_context(
purpose=ssl.Purpose.SERVER_AUTH, cafile=certifi.where()
)
self._cookies: Optional[Dict[Text, Text]] = {} Option 1 (False): self._ssl = ssl.create_default_context(
purpose=ssl.Purpose.SERVER_AUTH, cafile=certifi.where()
)
self._ssl = False
self._cookies: Optional[Dict[Text, Text]] = {} Option 2 (None): self._ssl = ssl.create_default_context(
purpose=ssl.Purpose.SERVER_AUTH, cafile=certifi.where()
)
self._ssl = None
self._cookies: Optional[Dict[Text, Text]] = {} I'm wondering if all the disconnect errors are from enforcing SSL. When we had requests in the v1.x branch, we basically didn't check the SSL cert. Make a backup or just delete the extra line if you want to go back to what we have now. |
Alan Tse, is it possible to do this test under Hassio addon? I mean, where is located the alexalogin.py file? |
idem. Would like to help but can't seem to find the file. (Hassio) |
There is a way. Follow the instructions for installing alexapy manually in your /config directory. The specific command is: To restore to the defaults, you can delete the |
Option 1:
|
Option 2: Other problems: |
Thanks @Beertje135. Did the fix persist through reboots? For the update issue, check #374. |
After restart no problem. Reboot didn't work so had to cut power and reboot that way.
|
Ok, let's try this fix. Apparently other components ran into this in HA so this is the fix they proposed. |
doesn't seem to help. After restart the problem is back. PS: before implementation of: |
|
Did another change in the fix. Please let me know if it helps. |
Tested with no luck.
|
Just a note. After the test described in my previous comment, I have downgraded again to v1.4.1 and working. However, 'integration' is now visible in config section and looks show properly information (name, firmware, switches,...) |
@somar05 Thanks for testing. Yes, that is a side effect of loading once with Config Flow. It'll create the necessary entries and then it'll remember your devices even in 1.4.1. However, since it's not directly connected anymore through the component, no idea when it'll break. ;) I'll probably need to slowly work through the error so will have a few edits here and there in the next few hours. |
Just to give some feedback after a night of using some fixes. For now I have the fix for the status updates +
After restart the above error ssl - Deleted Integration - Reconnected integration Anyway I can help? if you need more tests let us know. |
Ok, new build, same link. One thing that may help is to enable you have advanced debugging on and providing the log right before the error so I can see where you are in the process. Please scrub your logs of the cookie data like I have as this level of debugging does provide login info. I suspect you should see something like:
|
Ok how to explain this. Should restart with step 2 I think, to see what happens. |
Ok Step 1: removed integration - removed pickle - restart --> hass found new integration + errors
|
Step 2: Configure integration (like picture above) --> stays white screen
|
Step 3: added integration with + --> integration works |
Step 4: restart --> back broken
|
By my side, I think I have similar (if not identical) problem that @Beertje135 . But if my logs can help, I'll try the tests. Awaiting :) |
Step 5: removed integration - added integration with + --> integration works I'm lost... |
I just want to clarify one thing. Is the issue happening with restarting HA or rebooting the device? Or does it not make a difference? |
Thanks for all the help. Let's try a different direction for a little. Please restore your alexapy and let's instead attack it from the alexa_media side. Please replace your alexa_media files with changed files here.
On this issue, that may be a HA 99.0 error. Are you on 99.2? |
I used the restart button in Settings, Not the reboot button under Hass.io |
|
@Beertje135 Thanks for the clarification, please let me know how the latest set of files works (not alexapy). |
@alandtse , same here than @Beertje135 : HA 0.99.2 and restart (not reboot) Regarding the test using the files of branch #362 (fix: add retry logic to setup_entry #381), there something strange. There are not errors related the component during the start up (I think it take now more time to finish), but when I force something to test the 'notify' I receive that (not found notify/alexa_media). Maybe I am doing something wrong:
|
Ok here we go. PS: I think the alexapy/websockets upgrade was implemented also, sorry forgot to revert back. (I will check now) --> after check, it was implemented as shown in Link |
PS 2: before te latest fix in alexa_media I had the same errors as @somar05 on startup because notify wasn't ready when first notifications fired. But now with the fix in alexa_media it is loaded fairly fast so no errors. |
It's ok to have the websockets fix. I just didn't want you to have the fixes to alexapy I had proposed before. It's not clear, are you saying everything is working except for notify? I may need to see the full log as it boots up. Are either of you on discord? It may be easier to message me( |
Step 4: Restart 2 --> all working, no errors and status updates working I think this is very great news!! |
Made account on discord but again it is new for me. :-)
|
Describe the bug
Since v.1.4.1, any of the v.2.x can works
To Reproduce
Steps to reproduce the behavior:
Expected behavior
For v1.4.1 there are no problem. Always run properly
System details
const.py
or HA startup): 2.1.2 (any 2.x)pip show alexapy
or HA startup): 1.1.2Logs
2019-09-14 08:33:27 ERROR (MainThread) [homeassistant.setup] Error during setup of component alexa_media
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 924, in _wrap_create_connection
await self._loop.create_connection(*args, **kwargs))
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 981, in create_connection
ssl_handshake_timeout=ssl_handshake_timeout)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1009, in _create_connection_transport
await waiter
ConnectionResetError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 168, in _async_setup_component
hass, processed_config
File "/config/custom_components/alexa_media/init.py", line 132, in async_setup
await login.login_with_cookie()
File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 165, in login_with_cookie
await self.login(cookies=self._cookies)
File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 312, in login
if (cookies and await self.test_loggedin(cookies)):
File "/usr/local/lib/python3.7/site-packages/alexapy/alexalogin.py", line 233, in test_loggedin
ssl=self._ssl
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 476, in _request
timeout=real_timeout
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 522, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 854, in _create_connection
req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 992, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 974, in _create_direct_connection
req=req, client_error=client_error)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 931, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
Additional context
Login zone: amazon.es
The text was updated successfully, but these errors were encountered: