Skip to content
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

Timed out getting crumb. #125

Open
Johnyboy1984 opened this issue Mar 30, 2024 · 13 comments
Open

Timed out getting crumb. #125

Johnyboy1984 opened this issue Mar 30, 2024 · 13 comments

Comments

@Johnyboy1984
Copy link

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.yahoofinance.coordinator
Quelle: custom_components/yahoofinance/coordinator.py:105
Integration: Yahoo Finance (Dokumentation, Probleme)
Erstmals aufgetreten: 22:00:59 (1 Vorkommnisse)
Zuletzt protokolliert: 22:00:59

Timed out getting crumb.

@iprak
Copy link
Owner

iprak commented Mar 30, 2024

Do you see any delay in accessing the Yahoo finance the very time from your location?

@Johnyboy1984
Copy link
Author

What do you mean by "Are you noticing a delay at your location?" ?

I notice that the sensors provide values, but the error is still in the log.

@iprak
Copy link
Owner

iprak commented Mar 30, 2024

The integration retries getting cookie info and that is why sensors have value. This should coincide with the behavior when accessing Yahoo Finance website the very first time. If sensors report value then you will have to just ignore the error. This could be related to your location where GPR authorization has been enforced.

@Johnyboy1984
Copy link
Author

Johnyboy1984 commented Mar 30, 2024

If I understand you correctly then the error is triggered by my location and if I still get values then I can just ignore this error. Correct?

@iprak
Copy link
Owner

iprak commented Apr 3, 2024

The crumb cookie is needed for extracting data. "Timed out getting crumb" is the exception thrown if the request to obtain the cookie did not complete in 15 seconds. Whenever symbol data is refreshed, if the cookie is missing, then an attempt will be made to get it first.

If the error is not logged continuously, then the cookie request eventually succeeded, meaning we recovered and the error can be ignored. The initial failure will still get logged as an error.

For more investigation, you would have to use Networking monitoring tools like in Chrome Dev Tools and see what does the traffic for the very initial request look like.

@wburgers
Copy link

wburgers commented May 21, 2024

I'm experiencing this issue.

My sensors do not provide values.
It keeps failing to get the crumb. Many 1000s of times.

I don't know exactly when it started.
If it was yahoofinance 1.2.9 or HA 2024.5.4 that causes issues.
The last value for some sensors is the 17th of May, so that would indicate HA 2024.5.4.

I have set my home assistant logging config like:

logger:
  default: warn
  logs:
    custom_components.yahoofinance: debug

But that does not provide any additional logs.

I'll test if HA 2024.5.3 is better.

EDIT:
Nope going back to 2024.5.3 does not fix it.
Also going back to 1.2.8 of yahoofinance does not fix it either.

@wburgers
Copy link

And now it magically works again.

After a few days of not working and a few HA restarts.

Let's hope it keeps working 🤞

@iprak
Copy link
Owner

iprak commented May 21, 2024

There has been no change in the integration regarding this. The request waits for 15 seconds before throwing that exception and then retries later.

@ctaggmk
Copy link

ctaggmk commented Sep 30, 2024

Here's the error I get on startup

This error originated from a custom integration.

Logger: homeassistant.setup
Source: custom_components/yahoofinance/coordinator.py:85
Integration: yahoofinance (documentation, issues)
First occurred: 22:21:09 (1 occurrences)
Last logged: 22:21:09

Error during setup of component yahoofinance
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 256, in _async_setup_component
result = await task
File "/config/custom_components/yahoofinance/init.py", line 290, in async_setup
await _setup_coordinator()
File "/config/custom_components/yahoofinance/init.py", line 238, in _setup_coordinator
crumb = await crumb_coordinator.try_get_crumb_cookies() # Get crumb first
File "/config/custom_components/yahoofinance/coordinator.py", line 85, in try_get_crumb_cookies
async with asyncio.timeout(WEBSESSION_TIMEOUT):
AttributeError: module 'asyncio' has no attribute 'timeout'

There are no sensor.yahoofinance entities listed

Looking back at the comments, are we suggesting an HA upgrade will help? I am running "Home Assistant 2023.4.6
Frontend 20230411.1 - latest" so am a little bit behind!

@iprak
Copy link
Owner

iprak commented Sep 30, 2024

Yes the Core is quite old, that is from April 2023. It seems async.timeout is present in Python 3.11 which was adopted in 2023.6. I think updating core would be necessary.

@ctaggmk
Copy link

ctaggmk commented Oct 13, 2024

I've updated and still have this error from UI
This error originated from a custom integration.

Logger: custom_components.yahoofinance
Source: custom_components/yahoofinance/init.py:241
integration: Yahoo Finance (documentation, issues)
First occurred: 19:28:06 (1 occurrences)
Last logged: 19:28:06

Unable to get crumb, re-trying in 15 seconds

and if I look in the logs I see these lines (non-Yahoo lines removed)
2024-10-13 19:27:55.714 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration yahoofinance which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-13 19:28:06.234 WARNING (MainThread) [custom_components.yahoofinance] Unable to get crumb, re-trying in 15 seconds
2024-10-13 19:28:21.604 WARNING (MainThread) [custom_components.yahoofinance.coordinator] No data received for ['EXPN', 'GB00B02LCD75']

@iprak
Copy link
Owner

iprak commented Oct 13, 2024

Was the data successfully obtained in subsequent fetch?

@ctaggmk
Copy link

ctaggmk commented Oct 17, 2024

ah yes, it's better today. It's pulled BP and FTSE but not Experian. Let me check the ticker symbol for Experian as that looks more like my error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants