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

Facing “IOError” problems #186

Closed
fzxvvc opened this issue Jul 23, 2022 · 8 comments
Closed

Facing “IOError” problems #186

fzxvvc opened this issue Jul 23, 2022 · 8 comments

Comments

@fzxvvc
Copy link

fzxvvc commented Jul 23, 2022

This problem occurred after I set up the icloudpd environment:
The script is automatically indexed and ready to download. Later, I was prompted that I had no space or permission

/iCloud/2015/09/IMG_0003.MOV
/iCloud/1970/01/IMG_0007.JPG
2022-07-23 15:16:57 INFO Check successful
2022-07-23 15:16:57 INFO New files detected: 10239
2022-07-23 15:16:57 INFO Starting download of new files for user: myusername
2022-07-23 15:16:57 INFO Downloading new files using password stored in keyring file...
2022-07-23 15:16:57 INFO iCloudPD launch command: /usr/bin/icloudpd --directory /iCloud --cookie-directory /config --folder-structure {:%Y/%m} --username myicloudid@icloud.com 2>/tmp/icloudpd/icloudpd_download_error
2022-07-23 15:16:58 DEBUG Authenticating...
2022-07-23 15:17:11 DEBUG Looking up all photos and videos from album All Photos...
2022-07-23 15:17:11 INFO Downloading 6316 original photos and videos to /iCloud ...
2022-07-23 15:17:15 INFO Downloading /iCloud/2022/07/IMG_0655.JPG
2022-07-23 15:17:16 ERROR IOError while writing file to /iCloud/2022/07/IMG_0655.JPG! You might have run out of disk space, or the file might be too large for your OS. Skipping this file...
2022-07-23 15:17:16 INFO Downloading /iCloud/2022/07/68019054132__26AA4F3F-384A-45CB-934D-87234F86FC2E.JPG
2022-07-23 15:17:17 ERROR IOError while writing file to /iCloud/2022/07/68019054132__26AA4F3F-384A-45CB-934D-87234F86FC2E.JPG! You might have run out of disk space, or the file might be too large for your OS. Skipping this file...
2022-07-23 15:17:17 INFO Downloading /iCloud/2022/07/68018678416__2A12396A-2BDD-46A6-B18D-19E65CD61827.JPG
2022-07-23 15:17:18 ERROR IOError while writing file to /iCloud/2022/07/68018678416__2A12396A-2BDD-46A6-B18D-19E65CD61827.JPG! You might have run out of disk space, or the file might be too large for your OS. Skipping this file...
2022-07-23 15:17:18 INFO Downloading /iCloud/2022/07/IMG_0105.JPG
2022-07-23 15:17:19 ERROR IOError while writing file to /iCloud/2022/07/IMG_0105.JPG! You might have run out of disk space, or the file might be too large for your OS. Skipping this file...

Every file has this error prompt.
My operating environment is:Truenas under PVE virtual machine,icloudpd is running in Debian's docker environment.Debian mount the NAS file system with SMB.
Looking forward to your reply, thank you!

@boredazfcuk
Copy link
Owner

Hi,

I'm guessing that you haven't run out of space on the drive? If not, then it's likely going to be a permissions issue. If the underlying volume is mounted via SMB, does the SMB share allow writing by the account you are authenticating to the share with? Does that account have permissions to write to the filesystem underneath?

@fzxvvc
Copy link
Author

fzxvvc commented Jul 24, 2022

Hi,

I'm guessing that you haven't run out of space on the drive? If not, then it's likely going to be a permissions issue. If the underlying volume is mounted via SMB, does the SMB share allow writing by the account you are authenticating to the share with? Does that account have permissions to write to the filesystem underneath?

Yes, my space is still left.But if I use the container terminal of icloudpd, I can create new folders and operate files through the command line. That is to say, the container of icloudpd has permission to read and write my SMB share. But using the script will prompt ioerror

@boredazfcuk
Copy link
Owner

The container runs as root, so if you connect to the container command line, you'll be connecting as root, with no restrictions.

The download process runs as user:1000 though (or a different user/id if you've configured it like that)

If you connect to the container as that user, does it still allow you to write to the download path?

I'd connect to the terminal as boredazfcuk like this on my server:

docker exec -it --user boredazfcuk icloudpd /bin/ash

@fzxvvc
Copy link
Author

fzxvvc commented Jul 24, 2022

If I add these environment variables:

--env user=root
--env user_id=0
--env group=root
--env groupid=0 \

Will appear

2022-07-24 21:18:19 ERROR Group name, root, already in use - exiting

If I change these environment variables to

--env user=myusername
--env user_id=1000
--env group=myusername
--env groupid=1000 \

Then use

docker exec -it --user myusername icloudpd /bin/ash

After entering the terminal, I found that I did not have permission to change the directory. How to solve this problem?

@boredazfcuk
Copy link
Owner

2022-07-24 21:18:19 ERROR Group name, root, already in use - exiting

That's correct. This container shouldn't be run as root, or any other account that pre-exists in the Linux OS. It needs to be run as a standard, restricted user.

After entering the terminal, I found that I did not have permission to change the directory. How to solve this problem?

This is an issue on the host machine. You need to assign permissions for the user with id 1000 to the directory that has been mounted. You also need to make sure that the user with id 1000 has read/write access granted to the SMB file share. I'm not familiar with TrueNAS, but on my Debian server the file share information can be found in the file: /etc/samba/smb.conf

@fzxvvc
Copy link
Author

fzxvvc commented Jul 25, 2022

The problem has been solved. I use fstab to mount the SMB share. The root user of Debian can access it normally, but other users cannot. After I change the fstab mount configuration, I can access it normally

@fzxvvc fzxvvc closed this as completed Jul 25, 2022
@fzxvvc
Copy link
Author

fzxvvc commented Jul 25, 2022

Thanks a lot!

@boredazfcuk
Copy link
Owner

Awesome. Thanks for posting the resolution.

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