TheLogicMaster / SDH-AnimationChanger

A Steam Deck Homebrew plugin for changing and randomizing boot/suspend animations
Other
65 stars 9 forks source link

SteamDeckRepo Browse Fails to Load #20

Closed hummelm10 closed 1 year ago

hummelm10 commented 2 years ago

I've tried multiple restarts of both the Steam client and SteamDeck. The Browse section is unable to load and I get a spinning dial. This is with version 1.1.0 installed via decky.

The log in /tmp appears to point to a DNS resolution error but I can access the site via a browser on the deck and it happens on multiple networks not just my own.

[Animation Changer] 2022-10-16 15:13:40,610 ERROR Failed to fetch steamdeckrepo
Traceback (most recent call last):
  File "aiohttp/connector.py", line 1154, in _create_direct_connection
  File "aiohttp/connector.py", line 880, in _resolve_host
  File "aiohttp/resolver.py", line 33, in resolve
  File "asyncio/base_events.py", line 860, in getaddrinfo
  File "concurrent/futures/thread.py", line 58, in run
  File "socket.py", line 955, in getaddrinfo
socket.gaierror: [Errno -3] Temporary failure in name resolution

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/deck/homebrew/plugins/SDH-AnimationChanger/main.py", line 47, in get_steamdeckrepo
    async with web.request(
  File "aiohttp/client.py", line 1138, in __aenter__
  File "aiohttp/client.py", line 535, in _request
  File "aiohttp/connector.py", line 542, in connect
  File "aiohttp/connector.py", line 907, in _create_connection
  File "aiohttp/connector.py", line 1166, in _create_direct_connection
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host steamdeckrepo.com:443 ssl:<ssl.SSLContext object at 0x7fc7a271dc40> [Temporary failure in name resolution]
[Animation Changer] 2022-10-16 15:13:40,611 INFO Initialized
TheLogicMaster commented 2 years ago

It's quite strange. Are you using any special connection settings like proxies? I doubt it would help, but have you tried using the refresh button in the browser?

hummelm10 commented 2 years ago

I only see the spinning dial in the "Browse Animations" section. I'm wondering if this is an issue with aiohttp. Can you list what version is on your deck (or really all the python modules being used)? I just made a test file with the get steamdeckrepo function and it ran fine on my Linux desktop there so I'm not sure what's causing the failure on the deck.

Side note, also noticed a bug when switching from desktop to game mode or randomly in game mode where the plugin seems to drop the config and shows no installed animations but no errors in the log. Do you want a separate issue for that?

TheLogicMaster commented 2 years ago

Hi, the plugin loader embeds the following versions: aiohttp==3.8.1 aiohttp-jinja2==1.5.0 aiohttp_cors==0.7.0 certifi==2022.6.15

Doesn't need to be a separate issue. So, in the quick access menu the drop-downs are empty? I assume that pressing the reload config button fixes it? There was a bug where the first time you open the quick access menu screen, they would potentially be empty, but we thought it was fixed.

hummelm10 commented 2 years ago

Nope, reload config doesn't seem to work either. It might be a UI issue because I still seem to get the random screens. I'm going to try something drastic and reinstall SteamOS from USB, if that doesn't work I might go nuclear and see if factory reset works. I'm wondering if another plugin might be conflicting somewhere and causing issues.

TheLogicMaster commented 2 years ago

https://docs.aiohttp.org/en/stable/client_advanced.html Not sure if this could help, but it specifies using a custom connector to change DNS settings. I don't know why disabling the DNS caching would help, but I don't know what the issue is in the first place. Also allows specifying nameservers with the DNS module, so maybe forcing Google DNS or something might change the results?

hummelm10 commented 2 years ago

I found the issue! Good news, it's not you. Bad news, it's not you and it's aiohttp and it's a weird one so I'll have to open a bug there. All the networks I've been testing have IPv6 internally but FiOS in this area doesn't have IPv6 support publicly. aiohttp appears to default to only attempting IPv6 and not attempt IPv4.

I was able to force IPv4 by following the code here https://github.com/aio-libs/aiohttp/issues/559#issuecomment-257674345

While it works, I don't like it because if I go to a network that is fully IPv6 then I'd like to use that. aiohttp should be smart enough to reattempt on IPv4.

TheLogicMaster commented 2 years ago

Wow. That's one I wasn't expecting. Though it's a aiohttp bug, the plugin could mitigate the issue by attempting to force IPv4(autocorrect) if it fails normally.

hummelm10 commented 2 years ago

I think force IPv4 after failure since it appears to be trying IPv6 since I have both addresses assigned to the deck and then failing since the ISP doesn't support it.

I'm also going to try commenting out my local changes and testing on another network fully IPv4 network tomorrow. Unfortunately I don't have a fully supported IPv6 network to check if that actually works correctly so there's just a bit of assumption in that's what's failing.

Weirder issue, the download of an animation seemed to work even without forcing it to IPv4 using socket but it was very very slow like it was retrying a bunch. Forcing the download as well to use IPv4 makes the downloads almost instantaneous now. Not sure why it was eventually working (the actual downloads) and the page api wasn't. Still can't get the preview videos to load though.

TheLogicMaster commented 2 years ago

If forcing IPv4(got autocorrected last time) works, whatever the reason, it could be something the plugin could fall back to. I think this is affecting at least one other person, who was seeing the same behavior.

hummelm10 commented 2 years ago

If it works that's awesome, but I still would like to see aiohttp respond because this is what I believe is also affecting a couple other plugins so I'll keep an eye on the other issue I opened there.

TheLogicMaster commented 2 years ago

The loader uses aiohttp for making requests bypassing CORS, so presumably it would affect a lot.

dmitrif commented 2 years ago

Getting same issue here on latest stable release. ipv4 network here.

hummelm10 commented 2 years ago

Getting same issue here on latest stable release. ipv4 network here.

Do you know if you have IPv6 anywhere in the path? ISP or maybe your router is still using IPv6 along side internally? Or is it all strictly IPv4 because then I'm stumped on the cause again.

dmitrif commented 2 years ago

My issue went away by going to a different tab and then back to browse. So different issue.

TheLogicMaster commented 2 years ago

Did your log messages look the same? Could it just have been a connection issue?

TheLogicMaster commented 2 years ago

I was working on a proof of concept to fall back on just IPv4, but a config option for forcing IPv4 might be a more reasonable option then always falling back to IPv4 for every connection issue, if a workaround is needed. Would just require manually editing the global config in ~/.config/AnimationChanger main.py

hummelm10 commented 2 years ago

I'm in the office today but I'll try swapping my python file for this one and adding the line to my config. It should just be force_ipv4:True right?

I'm also going to try the original file in the office today since the guest WiFi is strictly IPv4.

Edit: looking at the python file you should also update the other ClientSession in downloadAnimation

TheLogicMaster commented 2 years ago

It's JSON, of course, so 'force_ipv4: true, but yeah You're right. Just a matter of pasting the connector=... into the other one, as well.

TheLogicMaster commented 2 years ago

Just added the force_ipv4 option in the latest update, with UI support, whenever it gets published

ponchorivas commented 1 year ago

I’m still having this issue. I have reinstalled the plugin, reloaded it, forced IPv4 in the settings without any luck. Hope it’s solved soon :)

Version 1.2.0

andrewkhunn commented 1 year ago

I too am having no luck loading the Browse screen running 1.2.0. Any word on whether this is (or is getting) fixed?

TheLogicMaster commented 1 year ago

Are you running Decky Stable? Due to the recent breaking changes, using the Pre-release may be necessary for now.

andrewkhunn commented 1 year ago

Switching to Decky Pre-release did indeed fix the browse issue for me. Thanks!

Nsbx commented 1 year ago

Same problem here, and switching to decky pre-release fix the issue. Thank You should add a note in the readme.

TheLogicMaster commented 1 year ago

The force_ipv4 option is available in the latest version Quick Access Menu and has been confirmed to fix some connection issues, so I think this is resolved.