core: IQVIA Stopped working 2021.5

The problem

IQVIA stopped working after updating to 2021.5. Upon restart it takes a long time to try and start then fails.

image

I have tried reloading the integration, deleting restarting, adding the integration again with no joy.

image

What is version of Home Assistant Core has the issue?

2021.5

What was the last working version of Home Assistant Core?

2021.4.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

IQVIA

Link to integration documentation on our website

https://www.home-assistant.io/integrations/iqvia/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Not sure if all of these are related

Logger: homeassistant.bootstrap
Source: bootstrap.py:409
First occurred: 9:48:51 AM (2 occurrences)
Last logged: 9:49:52 AM

Waiting on integrations to complete setup: iqvia, vizio

Logger: frontend.js.latest.202105040
Source: components/system_log/__init__.py:190
First occurred: 9:48:41 AM (13 occurrences)
Last logged: 9:59:25 AM

http://homeassistant.local:8123/core_configurator:0:0 Uncaught
http://homeassistant.local:8123/config/integrations:0:0 Uncaught
http://homeassistant.local:8123/lovelace/default_view:0:0 Uncaught
http://homeassistant.local:8123/hacsfiles/lovelace-animated-background/animated-background.js:535:22 Uncaught TypeError: Cannot read property 'background' of null

Logger: homeassistant
Source: runner.py:97
First occurred: 9:50:25 AM (1 occurrences)
Last logged: 9:50:25 AM

Error doing job: Unclosed connection

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 29 (11 by maintainers)

Most upvoted comments

Unfortunately, I think that number 2 above is the likely.

I tested the pyiqvia script 10 additional times. 6 of those times, the same timeout happened. 4 times, I successfully got data back using the same API structure that I’ve been using.

I also browsed to https://pollen.com and, as a “non-programmatic” test, refreshed my browser several times with similar behavior: 50-60% of the time, the website would hang and eventually fail to load the components we care about.

CleanShot 2021-05-06 at 16 20 41

So, there isn’t much we can do about this at the moment. If additional info suggesting we can surfaces, please post here and I’ll see what I can do.

Thanks for the update! Works great now. Yes, some data may take some retries to populate, but that has always been the case. BTW, this sensor is very useful for those of us living in areas with intense tree pollen allergens. Every morning after our house is “awaken” by movement (or the espresso machine turned on 😃, the tree pollen count is broadcasted from kitchen Google assistant device. We then take action depending on the pollen level. Seems trivial, but it really helps with quality of life.

Unfortunately, I think that the integration “working” on 2021.4.6 is a bit of a red herring and likely just a lucky moment when the web API worked.

That’s the thing, though: on 2021.4.6, IQVIA eventually gets lucky and fetches data on a retry. On 2021.5.x it never does and the integration stays in a failed state forever. It’s likely that the API has always been this flaky and it just hasn’t been an issue until now due to whatever changed in how retries are handled.

I also have a notification message go out with allergy report using this if it is above a 4.9 forecast on allergy. Missed it during the outage and working perfectly now! Thanks all!

Working for me since update to 2021.05.04. Missing one sensor but it is properly showing Unavailable and no longer halting executions. At this point it’s an upstream issue far as I am concerned. Thanks for the response and thanks to @balloob and @bachya! 🎉

It can be that the old integration was more aggressive in retrying because it moved forward with set up.

I see now that there are 8 API requests made. The integration will now be set up only if all succeed. Giving the other comments, that seems indeed highly unlikely.

If you revert it @bachya, then make sure you find another way to address #49905

-        init_data_update_tasks.append(coordinator.async_refresh())
+        init_data_update_tasks.append(coordinator.async_config_entry_first_refresh())

I think this is what is causing the problem. With the original line, the API call generally fails during setup but the integration still gets marked as loaded, so eventually one of the later entity refreshes succeeds. But with the new line, the integration doesn’t get marked as loaded and doesn’t seem to retry either (or maybe just retries on a much longer interval?) so the entities never get a chance to refresh.

@Zoriontsu I think it’s a bit early for that. Anecdotally, I would say that if this stretches into the next mainline release, we can start to have that discussion.

@kreene1987 Follow steps 1-5 of the contribution instructions in the repo, then take a look at the examples folder.

Naturally this happens just when allergy season is starting in the US… Thanks @bachya for at least confirming for me that it wasn’t just me!

Same. Posting so I can track progress.

(You can just click the “Subscribe” button to get email updates for the issue.)