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

Permission denied: /.homeassistant/.storage/icloud3.apple_acct/ #370

Open
buds opened this issue Nov 17, 2024 · 4 comments
Open

Permission denied: /.homeassistant/.storage/icloud3.apple_acct/ #370

buds opened this issue Nov 17, 2024 · 4 comments

Comments

@buds
Copy link

buds commented Nov 17, 2024

Running latest HA core and latest icloud3 via HACS.

The icloud3.apple_acct folder has incorrect permissions when created (d--------x)

Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/icloud3/helpers/file_io.py", line 86, in save_json_file
json_helpers.save_json(filename, data)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/json.py", line 224, in save_json
method(filename, json_data, private, mode=mode)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/file.py", line 66, in write_utf8_file
raise WriteError(error) from error
homeassistant.util.file.WriteError: [Errno 13] Permission denied: >'/home/homeassistant/.homeassistant/.storage/icloud3.apple_acct/tmpbsbvyijk'

Strangely the icloud3 folder DID have correct permission so I was able to log onto apple server fine but no devices were ever found because the icloud3.apple_acct folder had wrong permissions.
I fixed using chmod 755 on icloud3.apple_acct
Once fixed I setup again and this time I was asked to enter apple verification code then devices were listed correctly.
FYI

@gcobb321
Copy link
Owner

When Python creates a directory or file, the permissions are 777. Do you know what it was before you changed it to 755?

@buds
Copy link
Author

buds commented Nov 26, 2024

The perms are shown in my OP.
Basically ONLY execute all users.
(d--------x)

@buds
Copy link
Author

buds commented Jan 9, 2025

Just managed to recreate the directory permission issue. Here's how....

  1. Deleted icloud3 folder from HA custom components folder.
  2. Uploaded cloud3.v3.1.4.2b2 folder and renamed to icloud3
  3. Restarted HA
  4. Then on browser go to http://H.A.I.P/config/integrations/integration/icloud3 and click configure
  5. Click TOOLS then....
  6. DELETE ALL ICLOUD3 CONFIGURATION FILES but do not restart HA
  7. DELETE ALL APPLE/ICLOUD COOKIE FILES and now restart HA

Then tried to add account again using icloud3 configure but when the apple codes pop up on my devices (mac/iphone etc) there is no option to add this code to icloudv3 so checked the ~HA/.storage/icloud3.apple_acct folder and the perms were set to .....

drwxr-xr-x 2 homeassistant homeassistant 4096 Oct 29 01:01 icloud
drwxr-xr-x 2 homeassistant homeassistant 4096 Jan 9 22:05 icloud3
d--------x 2 homeassistant homeassistant 4096 Jan 9 22:04 icloud3.apple_acct

Hope this helps.

@buds
Copy link
Author

buds commented Jan 9, 2025

Same again if I 1st delete icloud3 via HACS then delete HA/.storage/icloud3 and HA/.storage/icloud3.apple_acct
Retstart HA
Then manually add cloud3.v3.1.4.2b2 folder and rename to icloud3 in HA/custom_components and then enable it by manually adding as a regular integration via HA. The new icloud3 and icloud3.apple_acct folders are created in HA/.storage/ but again the same WRONG permissions for icloud3.apple_acct as shown in my last message which means you can't authenticate the apple account with the code.

@buds buds closed this as completed Jan 9, 2025
@buds buds reopened this Jan 9, 2025
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