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

Zone log file csv Permission Denied error #425

Open
d3nd0 opened this issue Feb 12, 2025 · 7 comments
Open

Zone log file csv Permission Denied error #425

d3nd0 opened this issue Feb 12, 2025 · 7 comments

Comments

@d3nd0
Copy link

d3nd0 commented Feb 12, 2025

A ton of these errors in my log file.
Can't seem to find where the csv file is stored to check the permits.
I am using an Unraid docker image, passes through the /config directory
Are these zone log files perhaps not stored under /config ?

Logger: custom_components.icloud3
Source: util/loop.py:201
integration: iCloud3 v3 ([documentation](https://gcobb321.github.io/icloud3_v3_docs/#/), [issues](https://github.com/gcobb321/icloud3/issues))
First occurred: 11 February 2025 at 18:48:51 (1134 occurrences)
Last logged: 17:41:05

[Errno 13] Permission denied: 'zone-log-2025-person1_work.csv'
[Errno 13] Permission denied: 'zone-log-2025-person2_work.csv'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/support/zone_handler.py", line 416, in log_zone_enter_exit_activity
    Gb.hass.async_add_executor_job(write_log_zone_recd, Device)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/homeassistant/core.py", line 882, in async_add_executor_job
    tracked = asyncio.current_task() in self._tasks
              ~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/icloud3/icloud3_main.py", line 954, in process_updated_location_data
    zone_handler.log_zone_enter_exit_activity(Device)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/config/custom_components/icloud3/support/zone_handler.py", line 418, in log_zone_enter_exit_activity
    write_log_zone_recd(Device)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/config/custom_components/icloud3/support/zone_handler.py", line 436, in write_log_zone_recd
    with open(filename, 'a', encoding='utf8') as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/homeassistant/util/loop.py", line 201, in protected_loop_func
    return func(*args, **kwargs)
PermissionError: [Errno 13] Permission denied: 'zone-log-2025-person1_work.csv'
@gcobb321
Copy link
Owner

The zone log .csv file is in the /config directory, as is the icloud3.log and home-assistant.log files.

@d3nd0
Copy link
Author

d3nd0 commented Feb 12, 2025

Just in the base of the /config directory? Definitely no .csv files there, though I can see the .log files.
Nothing containing "csv" in the filename in the entire /config dir and its subfolders

@gcobb321
Copy link
Owner

Hmm. I am monitoring a zone and that is where the file is. I just reviewed the code and it is not actually defining the path to the file, which in my system, defaults to the /config directory. With your Unraid docker image setup, who knows where the default would be. I’ll add the path and send you some code that defines the path in the same location as the log file.

@gcobb321
Copy link
Owner

I have added the HA config path to the filename and verified the log-csv file operations. Everything appeared to work fine in my test environment. Let me know if everything works for you now.

Unzip the file below into the custom_components/icloyd3 directory and restart HA.

icloud3 v3.1.5.2b1.zip

@d3nd0
Copy link
Author

d3nd0 commented Feb 16, 2025

Will let you know how it goes, thankyou.

@d3nd0
Copy link
Author

d3nd0 commented Feb 26, 2025

@gcobb321 nothing in the log for the last week related to this where it'd happen within an hour of clearing previously, I can actually see the CSVs now too. Looks to be sorted.

@gcobb321
Copy link
Owner

Sounds like you are all set now and adding the path fixed your issue.

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

2 participants