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

Sensors failing during setup (again) #390

Closed
julianrinaldi opened this issue Mar 2, 2021 · 24 comments
Closed

Sensors failing during setup (again) #390

julianrinaldi opened this issue Mar 2, 2021 · 24 comments
Assignees
Labels
bug Something isn't working no-issue-activity Stale issue
Milestone

Comments

@julianrinaldi
Copy link

I'm getting this error again on the latest beta:

Logger: custom_components.mail_and_packages
Source: custom_components/mail_and_packages/helpers.py:971
Integration: Mail and Packages (documentation, issues)
First occurred: 3:58:24 PM (1 occurrences)
Last logged: 3:58:24 PM

Unexpected error fetching Mail and Packages (mail.1008n3rd.com) data: unconverted data remains: ,
Traceback (most recent call last):
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 151, in async_refresh
    self.data = await self._async_update_data()
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 139, in _async_update_data
    return await self.update_method()
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/__init__.py", line 78, in async_update_data
    return await hass.async_add_executor_job(process_emails, hass, config)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/helpers.py", line 128, in process_emails
    fetch(hass, config, account, data, sensor)
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/helpers.py", line 229, in fetch
    count[sensor] = get_items(account, const.ATTR_COUNT, amazon_fwds)
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/helpers.py", line 971, in get_items
    dateobj = datetime.datetime.strptime(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/_strptime.py", line 352, in _strptime
    raise ValueError("unconverted data remains: %s" %
ValueError: unconverted data remains: ,

Originally posted by @julianrinaldi in #362 (comment)

@firstof9
Copy link
Collaborator

firstof9 commented Mar 2, 2021

Looks like it's choking on one of your Amazon emails, can you check your mail for an amazon email and post the dates they're showing?

@firstof9 firstof9 added the more-info-needed Further information is requested label Mar 2, 2021
@firstof9 firstof9 self-assigned this Mar 2, 2021
@julianrinaldi
Copy link
Author

The date from the email content or from the header?

From the header: Tue, 02 Mar 2021 14:25:21 -0500

@firstof9
Copy link
Collaborator

firstof9 commented Mar 2, 2021

Sorry the email content.

@julianrinaldi
Copy link
Author

Here are a few different examples:

CleanShot 2021-03-02 at 16 27 07@2x

CleanShot 2021-03-02 at 16 26 43@2x

CleanShot 2021-03-02 at 16 26 16@2x

@firstof9
Copy link
Collaborator

firstof9 commented Mar 2, 2021

That last one is where it's choking.

Give me a few minutes and I'll have a beta available for you to test.

@julianrinaldi
Copy link
Author

Awesome, thanks.

@firstof9
Copy link
Collaborator

firstof9 commented Mar 2, 2021

Just to make sure there's no other that have an odd format?

Usual format is: "DayofWeek, Month #"

@julianrinaldi
Copy link
Author

Only seeing the three formats I posted.

@firstof9
Copy link
Collaborator

firstof9 commented Mar 2, 2021

One last request, could you check email's plain text view and see what the format for the date looks like on that 3rd one you posted?

If you're using Gmail click the 3 dots and hit "Show Original".

image

I want to confirm it looks something like this:

Hi TestUser, your package will arrive:
Friday, September 11,
5 p.m - 10 p.m.

@julianrinaldi
Copy link
Author

Hi xxx, your package will arrive:

Tuesday, March 2, 5 p.m. – 10 p.m.

@firstof9 firstof9 added bug Something isn't working and removed more-info-needed Further information is requested labels Mar 2, 2021
@firstof9
Copy link
Collaborator

firstof9 commented Mar 2, 2021

Give 0.3.2-b1 a shot see if that clears up the error.

@firstof9 firstof9 added the awaiting-feedback Waiting for feedback from the reporter label Mar 2, 2021
@firstof9 firstof9 added this to the 0.3.2 milestone Mar 2, 2021
@julianrinaldi
Copy link
Author

I will let you know. I actually cleared my mailbox completely because I was having issues with something else. With an empty mailbox it's working, but that doesn't mean anything. I am expecting Amazon deliveries each day for the rest of the week, so I'll be able to give you feedback soon. Thanks for your help!

@julianrinaldi
Copy link
Author

Getting this error now:

Logger: homeassistant.setup
Source: custom_components/mail_and_packages/helpers.py:18
First occurred: 10:58:09 AM (1 occurrences)
Last logged: 10:58:09 AM

Setup failed for mail_and_packages: unknown error
Traceback (most recent call last):
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 166, in _async_setup_component
    component = integration.get_component()
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 491, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/__init__.py", line 25, in <module>
    from .helpers import default_image_path, process_emails
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/helpers.py", line 18, in <module>
    import imageio as io
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/imageio/__init__.py", line 22, in <module>
    from .core import FormatManager, RETURN_BYTES
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/imageio/core/__init__.py", line 10, in <module>
    from .util import Image, Array, Dict, asarray, image_as_uint, urlopen
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/imageio/core/util.py", line 19, in <module>
    import numpy as np
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
    raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned

Not sure if it is related to the Amazon issue or not. Also, I got an Amazon email with another format:
CleanShot 2021-03-03 at 10 58 42@2x

@julianrinaldi
Copy link
Author

Nevermind, I restarted and it started working again.

@firstof9
Copy link
Collaborator

firstof9 commented Mar 3, 2021

Sounds like Home Assistant was still downloading a library from pip.

@firstof9 firstof9 removed the awaiting-feedback Waiting for feedback from the reporter label Mar 4, 2021
@julianrinaldi
Copy link
Author

This issue seems to be fixed with beta 0.3.2-b1. However, in HACS, 0.3.2-b0 is showing as the newest version for some reason, so it keeps asking me to update. Not sure if it's just an issue with my HACS install.

CleanShot 2021-03-04 at 15 58 08

@firstof9
Copy link
Collaborator

firstof9 commented Mar 5, 2021

Ya, it's doing the same for me, I am not sure what's going on there. It may not like the fact I started at b0.

@julianrinaldi
Copy link
Author

So while the Amazon issue seems fixed, it fails again anytime Home Assistant is restarted. Then I have to delete the integration, delete it from HACS, restart, reinstall it, restart again, and then install it again to get it to work. It gives the error I previously posted:

Logger: homeassistant.setup
Source: custom_components/mail_and_packages/helpers.py:18
First occurred: 10:39:21 AM (1 occurrences)
Last logged: 10:39:21 AM

Setup failed for mail_and_packages: unknown error
Traceback (most recent call last):
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/setup.py", line 166, in _async_setup_component
    component = integration.get_component()
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 491, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/__init__.py", line 25, in <module>
    from .helpers import default_image_path, process_emails
  File "/Users/homeassistant/.homeassistant/custom_components/mail_and_packages/helpers.py", line 18, in <module>
    import imageio as io
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/imageio/__init__.py", line 22, in <module>
    from .core import FormatManager, RETURN_BYTES
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/imageio/core/__init__.py", line 10, in <module>
    from .util import Image, Array, Dict, asarray, image_as_uint, urlopen
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/imageio/core/util.py", line 19, in <module>
    import numpy as np
  File "/Users/homeassistant/homeassistant/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
    raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned

@firstof9
Copy link
Collaborator

firstof9 commented Mar 6, 2021

I'm going to need the following info:

  • OS: [e.g. HassOS/Raspbian/CentOS]
  • Type of device: [e.g. RPi3/NUC/Synology]
  • Home Assistant version: [e.g. 0.105.5]
  • Hassio/Docker/Core?

@julianrinaldi
Copy link
Author

MacOS 11
Mac Mini
Home Assistant Core 2021.3.1 in virtual environment

@firstof9
Copy link
Collaborator

firstof9 commented Mar 6, 2021

From your vevnv, can you run pip freeze.

We're looking for the version of numpy it's showing as installed.

From the docker container it's numpy==1.19.2

@julianrinaldi
Copy link
Author

It's showing numpy==1.19.2 as well.

@firstof9
Copy link
Collaborator

firstof9 commented Mar 6, 2021

Apparently it's a MacOS problem:

numpy/numpy#15947

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the no-issue-activity Stale issue label Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity Stale issue
Projects
None yet
Development

No branches or pull requests

2 participants