osxphotos: Crash on export, no export database created
Hi. I’ve just finishing running my first export after installing via homebrew. It crashed 😦
Something went wrong and osxphotos encountered an error:
RetryError[<Future at 0x3ff097450 state=finished raised OSError>]
Crash log written to '/Users/geraint/osxphotos_crash.log'
By the looks of it, it’s left .osxphotos_export.db.bak and the export database hasn’t saved. Which I guess means I have to re-export everything?!
osxphotos crash log
Created: 2025-06-21 18:23:43.267066
osxphotos version: 0.72.1
Platform: macOS-15.5-arm64-arm-64bit-Mach-O
Python version: 3.13.5 (main, Jun 11 2025, 15:36:57) [Clang 17.0.0 (clang-1700.0.13.3)]
sys.argv: ['/opt/homebrew/bin/osxphotos', 'export', '/Volumes/photos/Full_Library', '--exiftool', '--ramdb', '--retry', '3', '--export-by-date', '--jpeg-ext', 'jpg', '--download-missing', '--use-photokit', '--update', '--save-config', 'osxphotos.toml']
CRASH_DATA:
locals: {'dest': '/Volumes/photos/Full_Library', 'db': None, 'add_exported_to_album': None, 'add_missing_to_album': None, 'add_skipped_to_album': None, 'added_after': None, 'added_before': None, 'added_in_last': None, 'album': (), 'album_keyword': False, 'alt_db': None, 'alt_copy': False, 'append': False, 'fix_orientation': False, 'beta': False, 'burst': False, 'checkpoint': None, 'cleanup': False, 'cloudasset': False, 'config_only': False, 'convert_to_jpeg': False, 'crash_after': None, 'current_name': False, 'deleted': False, 'deleted_only': False, 'description': (), 'description_template': None, 'directory': None, 'download_missing': True, 'dry_run': False, 'duplicate': False, 'edited': False, 'edited_suffix': None, 'exif': (), 'exiftool': True, 'exiftool_merge_keywords': False, 'exiftool_merge_persons': False, 'exiftool_option': (), 'exiftool_path': None, 'export_as_hardlink': False, 'export_by_date': True, 'exportdb': None, 'external_edit': False, 'favorite': False, 'favorite_rating': False, 'filename_template': None, 'finder_tag_keywords': False, 'finder_tag_template': (), 'folder': (), 'force_update': False, 'from_date': None, 'from_time': None, 'has_comment': False, 'has_likes': False, 'has_raw': False, 'hdr': False, 'hidden': False, 'ignore_case': False, 'ignore_date_modified': False, 'ignore_exportdb': False, 'ignore_signature': False, 'in_album': False, 'incloud': False, 'is_reference': False, 'jpeg_ext': 'jpg', 'jpeg_quality': None, 'keep': (), 'keyword': (), 'keyword_template': (), 'label': (), 'limit': None, 'live': False, 'load_config': None, 'location': False, 'max_size': None, 'min_size': None, 'missing': False, 'name': (), 'no_comment': False, 'no_description': False, 'no_exportdb': False, 'no_keyword': False, 'no_likes': False, 'no_location': False, 'no_place': False, 'no_progress': False, 'no_title': False, 'not_burst': False, 'not_cloudasset': False, 'not_edited': False, 'not_favorite': False, 'not_hdr': False, 'not_hidden': False, 'not_in_album': False, 'not_incloud': False, 'not_live': False, 'not_missing': False, 'not_panorama': False, 'not_portrait': False, 'not_reference': False, 'not_screenshot': False, 'not_screen_recording': False, 'not_selfie': False, 'not_shared': False, 'not_slow_mo': False, 'not_time_lapse': False, 'only_movies': False, 'only_new': False, 'only_photos': False, 'original_suffix': None, 'overwrite': False, 'panorama': False, 'person': (), 'person_keyword': False, 'place': (), 'portrait': False, 'post_command': (), 'post_command_error': None, 'post_function': (), 'preview': False, 'preview_if_missing': False, 'preview_suffix': None, 'print_template': (), 'query_eval': (), 'query_function': (), 'ramdb': True, 'regex': (), 'replace_keywords': False, 'report': None, 'retry': 3, 'save_config': 'osxphotos.toml', 'screenshot': False, 'screen_recording': False, 'selfie': False, 'shared': False, 'export_aae': False, 'sidecar': (), 'sidecar_drop_ext': False, 'sidecar_template': (), 'skip_bursts': False, 'skip_edited': False, 'skip_live': False, 'skip_original_if_edited': False, 'skip_raw': False, 'skip_uuid': (), 'skip_uuid_from_file': None, 'slow_mo': False, 'strip': False, 'theme': None, 'time_lapse': False, 'timestamp': False, 'title': (), 'tmpdir': None, 'to_date': None, 'to_time': None, 'touch_file': False, 'update': True, 'update_errors': False, 'use_photokit': True, 'use_photos_export': False, 'uti': None, 'uuid': (), 'uuid_from_file': None, 'verbose_flag': 0, 'xattr_template': (), 'year': (), 'syndicated': False, 'not_syndicated': False, 'saved_to_library': False, 'not_saved_to_library': False, 'shared_moment': False, 'not_shared_moment': False, 'shared_library': False, 'not_shared_library': False, 'selected': False, 'ctx': <click.core.Context object at 0x10a9b5a90>, 'cli_obj': <osxphotos.cli.cli.CLI_Obj object at 0x10a93ef90>}
osxphotos version: 0.72.1
Error: RetryError[<Future at 0x3ff097450 state=finished raised OSError>]
Traceback (most recent call last):
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/tenacity/__init__.py", line 478, in __call__
result = fn(*args, **kwargs)
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/osxphotos/export_db.py", line 1205, in write_to_disk
sqlite_backup_dbfiles(self._dbfile)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/osxphotos/sqlite_utils.py", line 110, in sqlite_backup_dbfiles
fileutil.copy(src, dst)
~~~~~~~~~~~~~^^^^^^^^^^
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/osxphotos/fileutil.py", line 142, in copy
raise OSError(error[1])
OSError: Error Domain=NSCocoaErrorDomain Code=513 "“.osxphotos_export.db” couldn’t be copied because you don’t have permission to access “Full_Library”." UserInfo={NSSourceFilePathErrorKey=/Volumes/photos/Full_Library/.osxphotos_export.db, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/Volumes/photos/Full_Library/.osxphotos_export.db.bak, NSFilePath=/Volumes/photos/Full_Library/.osxphotos_export.db, NSURL=file:///Volumes/photos/Full_Library/.osxphotos_export.db, NSUnderlyingError=0x600001e53360 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/osxphotos/crash_reporter.py", line 79, in wrapped
return func(*args, **kwargs)
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/osxphotos/cli/export.py", line 1122, in export
return_code = export_cli(**locals())
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/osxphotos/cli/export.py", line 2270, in export_cli
export_db.write_to_disk()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/tenacity/__init__.py", line 336, in wrapped_f
return copy(f, *args, **kw)
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/tenacity/__init__.py", line 475, in __call__
do = self.iter(retry_state=retry_state)
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/tenacity/__init__.py", line 376, in iter
result = action(retry_state)
File "/opt/homebrew/Cellar/osxphotos/0.72.1/libexec/lib/python3.13/site-packages/tenacity/__init__.py", line 419, in exc_check
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x3ff097450 state=finished raised OSError>]
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 16 (9 by maintainers)
@oPromessa the metadata in question is macOS specific metadata like resource forks and extended attributes. These are preserved by the normal copying mechanism (when exporting to an HFS+ or APFS drive but likely not your NAS). “Regular” metadata like file modification dates are preserved.