Skip to content

[BUG] binascii.Error: Invalid base64-encoded string: number of data characters (25) cannot be 1 more than a multiple of 4 #400

@m-theredhead

Description

@m-theredhead

New to using icloud-docker and set it up today

In my config.yaml file for photos, I have:

photos:
  destination: "photos"
  # Remove local photos that are not present on server (i.e. photos delete on server)
  remove_obsolete: false
  sync_interval: 500
  all_albums: true # Optional, default false. If true preserve album structure. If same photo is in multiple albums creates duplicates on filesystem
  use_hardlinks: true # Optional, default false. If true and all_albums is true, create hard links for duplicate photos instead of separate copies. Saves storage space.

As the container runs, it downloads the drive files without any issues. But when it starts to process the pictures, I start getting this error and it looks like the container exits and just restarts:

icloud exited with code 1 (restarting)
icloud  | Setting up user 'abc' with UID: 1010, GID: 1010
icloud  | usermod: no changes
icloud  |  Detach
icloud  | ====================================================
icloud  | To support this project, please consider sponsoring.
icloud  | https://github.com/sponsors/mandarons
icloud  | https://www.buymeacoffee.com/mandarons
icloud  |
icloud  | User UID:    1010
icloud  | User GID:    1010
icloud  | ====================================================
icloud  | Starting iCloud Docker application...
icloud  | 2026-01-01 13:44:33,239 :: INFO :: root :: config_logging.py :: 35 :: Syncing drive every 300 seconds.
icloud  | 2026-01-01 13:44:33,239 :: INFO :: root :: config_logging.py :: 35 :: Syncing photos every 500 seconds.
icloud  | 2026-01-01 13:44:33,557 :: INFO :: root :: sync.py :: 190 :: Syncing drive...
icloud  | 2026-01-01 13:44:33,781 :: WARNING :: root :: config_logging.py :: 26 :: drive > remove_obsolete remove_obsolete is not found. Not removing the obsolete files and folders.
icloud  | 2026-01-01 14:01:10,809 :: INFO :: root :: sync.py :: 192 :: Drive synced
icloud  | 2026-01-01 14:01:10,809 :: INFO :: root :: sync.py :: 257 :: Syncing photos...
icloud  | 2026-01-01 14:01:11,599 :: WARNING :: root :: config_logging.py :: 26 :: photos > filters not found. Downloading all libraries and albums with original size ...
icloud  | 2026-01-01 14:01:11,599 :: INFO :: root :: config_logging.py :: 35 :: Syncing all albums.
icloud  | 2026-01-01 14:01:11,599 :: INFO :: root :: config_logging.py :: 35 :: Using hard links for duplicate photos.
icloud  | 2026-01-01 14:01:12,932 :: INFO :: root :: sync_photos.py :: 453 :: Syncing 'All Photos' album first for hard link reference...
icloud  | 2026-01-01 14:01:12,932 :: INFO :: root :: album_sync_orchestrator.py :: 60 :: Syncing All Photos
icloud  | Traceback (most recent call last):
icloud  |   File "/app/./src/main.py", line 8, in <module>
icloud  |     sync.sync()
icloud  |   File "/app/src/sync.py", line 567, in sync
icloud  |     photos_stats = _perform_photos_sync(config, api, sync_state, photos_sync_interval)
icloud  |   File "/app/src/sync.py", line 258, in _perform_photos_sync
icloud  |     sync_photos.sync_photos(config=config, photos=api.photos)
icloud  |   File "/app/src/sync_photos.py", line 400, in sync_photos
icloud  |     _sync_all_photos_first_for_hardlinks(
icloud  |   File "/app/src/sync_photos.py", line 454, in _sync_all_photos_first_for_hardlinks
icloud  |     sync_album_photos(
icloud  |   File "/app/src/album_sync_orchestrator.py", line 63, in sync_album_photos
icloud  |     download_tasks = _collect_album_download_tasks(
icloud  |   File "/app/src/album_sync_orchestrator.py", line 120, in _collect_album_download_tasks
icloud  |     download_info = collect_download_task(
icloud  |   File "/app/src/photo_download_manager.py", line 128, in collect_download_task
icloud  |     if file_size not in photo.versions:
icloud  |   File "/usr/local/lib/python3.10/site-packages/icloudpy/services/photos.py", line 709, in versions
icloud  |     version = {"filename": self.filename}
icloud  |   File "/usr/local/lib/python3.10/site-packages/icloudpy/services/photos.py", line 652, in filename
icloud  |     return base64.b64decode(
icloud  |   File "/usr/local/lib/python3.10/base64.py", line 87, in b64decode
icloud  |     return binascii.a2b_base64(s)
icloud  | binascii.Error: Invalid base64-encoded string: number of data characters (25) cannot be 1 more than a multiple of 4
icloud exited with code 1 (restarting)

and this section of logs just repeats itself as it tries again.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions