Giter VIP home page Giter VIP logo

Comments (6)

hmattiasl avatar hmattiasl commented on September 25, 2024

I had the same issue. It was resolved when I updated Home Assistant to the latest version of Home Assistant Core 2024.7.3.

from ha_toyota.

mkumot avatar mkumot commented on September 25, 2024

I've the same issue: Raspberry 5, Python3.12 Home assistant Core 2024.7.3
Error recorded on the log is "ERROR (MainThread) [custom_components.toyota.config_flow] An unknown error occurred during login request: [Errno 13] Permission denied: '.cache'"

from ha_toyota.

amaximus avatar amaximus commented on September 25, 2024

I have the same issue in HA Core 2024.8.0, but it was the same in 2024.7.x as well.
In debug mode it says:

2024-08-15 19:23:15.470 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/home/me/.cache/toyota_credentials_cache_contains_secrets', 'r') inside the event loop by custom integration 'toyota' at custom_components/toyota/config_flow.py, line 38: client = MyT( (offender: /home/me/ha_venv3_12/lib/python3.12/site-packages/mytoyota/controller.py, line 56: with open(str(CACHE_FILENAME), "r", encoding="utf-8") as f:), please create a bug report at https://github.com/DurgNomis-drol/ha_toyota/issues

followed by a long stack trace.
Because of this in non-debug mode it says:

: 
  File "/home/atticus/ha_venv3_12/lib/python3.12/site-packages/homeassistant/data_entry_flow.py", line 516, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
  File "/home/atticus/homeassistant_conf/custom_components/toyota/config_flow.py", line 38, in async_step_user
    client = MyT(
2024-08-15 19:23:15.531 ERROR (MainThread) [custom_components.toyota.config_flow] An unknown error occurred during login request: [Errno 13] Permission denied: '.cache'

while the file is readable:

(ha_venv3_12)~/homeassistant_conf $ls -l ../.cache/toyota_credentials_cache_contains_secrets
-rw-r--r-- 1 me me 2831 Jul 24 19:36 ../.cache/toyota_credentials_cache_contains_secrets
(ha_venv3_12) ~/homeassistant_conf $ file ../.cache/toyota_credentials_cache_contains_secrets
../.cache/toyota_credentials_cache_contains_secrets: JSON data
(ha_venv3_12) ~/homeassistant_conf $

According to the dev guides, file i/o operations should not be done inside the event loop, thus initialization of the MyT client should not be done on the event loop.

from ha_toyota.

dentex avatar dentex commented on September 25, 2024

Same with latest V2.0.4

from ha_toyota.

dentex avatar dentex commented on September 25, 2024

I updated python to v3.12.4, HA to latest 2024.8.3 and still same issue...
Then, someone suggested me to delete this integration's cache, so I did

cd /home/homeassistant/.cache/
rm -rf toyota_credentials_cache_contains_secrets

and now it's working... Just for you to know.

from ha_toyota.

amaximus avatar amaximus commented on September 25, 2024

My comment from Aug 15 is still valid even if I remove the $HOME/.cache/toyota_credentials_cache_contains_secrets.

(ha_venv3_12) thin620t:~/homeassistant_conf $tail -1 home-assistant.log
2024-09-01 19:35:46.736 ERROR (MainThread) [custom_components.toyota.config_flow] An unknown error occurred during login request: [Errno 13] Permission denied: '.cache'
(ha_venv3_12) thin620t:~/homeassistant_conf $curl -H @hass_header.txt http://192.168.1.32:8123/api/states/update.toyota_connected_services_europe_update
{"entity_id":"update.toyota_connected_services_europe_update","state":"off","attributes":{"auto_update":false,"installed_version":"v2.0.5","in_progress":false,"latest_version":"v2.0.5","release_summary":null,"release_url":"https://github.com/DurgNomis-drol/ha_toyota/releases/v2.0.5","skipped_version":null,"title":null,"entity_picture":"https://brands.home-assistant.io/_/toyota/icon.png","friendly_name":"Toyota Connected Services Europe update","supported_features":23},"last_changed":"2024-08-31T18:19:11.052714+00:00","last_reported":"2024-08-31T18:19:11.052714+00:00","last_updated":"2024-08-31T18:19:11.052714+00:00","context":{"id":"01J6MTK7ACQA68JW2R9AVNABC3","parent_id":null,"user_id":null}}
(ha_venv3_12) thin620t:~/homeassistant_conf $curl -H @hass_header.txt http://192.168.1.32:8curl -H @hass_header.txt http://192.168.1.32:8123/api/states/sensor.current_version
{"entity_id":"sensor.current_version","state":"2024.8.3","attributes":{"friendly_name":"Current Version"},"last_changed":"2024-08-31T18:19:10.096740+00:00","last_reported":"2024-08-31T18:19:10.096740+00:00","last_updated":"2024-08-31T18:19:10.096740+00:00","context":{"id":"01J6MTK6CG7VXC1H17M771R38E","parent_id":null,"user_id":null}}
(ha_venv3_12) thin620t:~/homeassistant_conf $

from ha_toyota.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.