osxphotos
osxphotos copied to clipboard
Error copying file: "Permission denied"
I'm running two osxphotos commands one after the other as follows:
/usr/local/bin/osxphotos export /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/Originals --load-config /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/Toml/osxphotos-originals.toml >> /tmp/output.txt
/usr/local/bin/osxphotos export /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary --load-config /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/Toml/osxphotos-mobile.toml >> /tmp/output.txt
This is osxphotos-originals.toml:
[export]
cleanup = true
directory = "{created.year}/{created.year}-{created.mm}-{created.dd}"
download_missing = true
export_aae = false
keyword_template = [ "{label}", "{keyword}", "{person}", "{album?album:{folder_album}}", "{favorite?Favorite,}",]
replace_keywords = true
retry = 1
sidecar = [ "xmp",]
skip_edited = true
update = true
use_photokit = true
verbose = 0
And this is osxphotos-mobile.toml:
[export]
cleanup = true
convert_to_jpeg = true
db = "/Volumes/ExternalData/Users/odedia/Pictures/Photo Library.photoslibrary"
directory = "{created.year}/{created.year}-{created.mm}-{created.dd}"
download_missing = true
edited_suffix = ""
keyword_template = [ "{label}", "{keyword}", "{person}",]
replace_keywords = true
retry = 0
sidecar = [ "xmp",]
skip_original_if_edited = true
skip_raw = true
tmpdir = "/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir"
update = true
use_photokit = true
The execution of the originals
script seems to go by fine.
For some reason, I'm failing with permission denied
for a specific folder during the second execution for the mobile
export:
26-Apr-2024 01:25:59 GMT+3 Using osxphotos export database: version 9.1 located at /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/.osxphotos_export.db
26-Apr-2024 01:26:27 GMT+3 Exporting 80317 photos to /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary...
26-Apr-2024 01:27:16 GMT+3 Error exporting photo (981EA08D-C6C1-4C00-AB25-B5A158E3B738: IMG_1179.MOV) as IMG_1179.MOV: Error copying file /Volumes/ExternalData/Users/odedia/Pictures/Photo Library.photoslibrary/originals/9/981EA08D-C6C1-4C00-AB25-B5A158E3B738.mov to /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/2024/2024-04-19/IMG_1179.MOV: Error Domain=NSCocoaErrorDomain Code=513 "“981EA08D-C6C1-4C00-AB25-B5A158E3B738.mov” couldn’t be copied because you don’t have permission to access “2024-04-19”." UserInfo={NSSourceFilePathErrorKey=/Volumes/ExternalData/Users/odedia/Pictures/Photo Library.photoslibrary/originals/9/981EA08D-C6C1-4C00-AB25-B5A158E3B738.mov, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/2024/2024-04-19/IMG_1179.MOV, NSFilePath=/Volumes/ExternalData/Users/odedia/Pictures/Photo Library.photoslibrary/originals/9/981EA08D-C6C1-4C00-AB25-B5A158E3B738.mov, NSUnderlyingError=0x6000019bd980 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} (photoexporter.pyc: 999)
26-Apr-2024 01:30:45 GMT+3 Error exporting photo (A112E927-0BB4-4EC6-94A3-B272F2B06FD1: IMG_1177.HEIC) as IMG_1177.jpeg: Error copying file /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir/osxphotos_export_2yo2808v/A112E927-0BB4-4EC6-94A3-B272F2B06FD1_converted_to_jpeg.jpeg to /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/2024/2024-04-19/IMG_1177.jpeg: Error Domain=NSCocoaErrorDomain Code=513 "“A112E927-0BB4-4EC6-94A3-B272F2B06FD1_converted_to_jpeg.jpeg” couldn’t be copied because you don’t have permission to access “2024-04-19”." UserInfo={NSSourceFilePathErrorKey=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir/osxphotos_export_2yo2808v/A112E927-0BB4-4EC6-94A3-B272F2B06FD1_converted_to_jpeg.jpeg, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/2024/2024-04-19/IMG_1177.jpeg, NSFilePath=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir/osxphotos_export_2yo2808v/A112E927-0BB4-4EC6-94A3-B272F2B06FD1_converted_to_jpeg.jpeg, NSUnderlyingError=0x6000019d1140 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} (photoexporter.pyc: 999)
26-Apr-2024 01:34:33 GMT+3 Error exporting photo (567035A7-EE03-4AC4-BD5C-A5E15A848870: incoming-82BF3431-7C9A-465B-AD9A-AC1F30FA48CB.PNG) as incoming-82BF3431-7C9A-465B-AD9A-AC1F30FA48CB.jpeg: Error copying file /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir/osxphotos_export_zz_9b7le/567035A7-EE03-4AC4-BD5C-A5E15A848870_converted_to_jpeg.jpeg to /Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/2024/2024-04-19/incoming-82BF3431-7C9A-465B-AD9A-AC1F30FA48CB.jpeg: Error Domain=NSCocoaErrorDomain Code=513 "“567035A7-EE03-4AC4-BD5C-A5E15A848870_converted_to_jpeg.jpeg” couldn’t be copied because you don’t have permission to access “2024-04-19”." UserInfo={NSSourceFilePathErrorKey=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir/osxphotos_export_zz_9b7le/567035A7-EE03-4AC4-BD5C-A5E15A848870_converted_to_jpeg.jpeg, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/MobileLibrary/2024/2024-04-19/incoming-82BF3431-7C9A-465B-AD9A-AC1F30FA48CB.jpeg, NSFilePath=/Volumes/ExternalData/Users/odedia/Pictures/OSXPhotos/TempDir/osxphotos_export_zz_9b7le/567035A7-EE03-4AC4-BD5C-A5E15A848870_converted_to_jpeg.jpeg, NSUnderlyingError=0x6000019d2a00 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} (photoexporter.pyc: 999)
26-Apr-2024 01:45:44 GMT+3 Exporting 80317 photos ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
26-Apr-2024 01:45:44 GMT+3
Did you look a the the path in question with Finder? What do the permissions say? This sounds like it's an OS permission issue, not an OSXPhotos issue. If the permissions appear to be correct (maybe try copying the file manually from the command line in Terminal to verify) then I'll see if there's some debugging I can suggest.
Thanks. Seems like it's indeed my mistake.
I thought I checked it already, but I was foolish enough to forget quotations marks which is required due to the space in /Photo Library.photoslibrary
.
The file is there but its permissions is set to userrw
only. Most files are with full permissions, while newer onces are either
user rw only or rw for user+read for all.
Is there a standard recommended permissions for Apple Photos? Does Apple Photos have a "repair permissions" process like the old iPhoto?
-rwxrwxrwx@ 1 odedia staff 1168 Apr 8 15:30 9EE294D4-142B-4569-B6B2-49DAB6E28A12_5.aae
-rwxrwxrwx@ 1 odedia staff 1250 Apr 8 15:30 9C8AFCDF-C2A8-4BBC-985F-60A7A5EEC664_5.aae
-rwxrwxrwx@ 1 odedia staff 848 Apr 8 15:30 9A54BE4A-BB4F-4EBD-86CB-97AAE9C83C95_5.aae
-rwxrwxrwx@ 1 odedia staff 1230 Apr 8 15:30 9FA850C6-829E-47D9-8973-426C1000B9AB_5.aae
-rwxrwxrwx@ 1 odedia staff 2052056 Apr 10 12:29 923935AE-EF37-4527-9A76-D3A7CCB815EF_3.mov
-rwxrwxrwx@ 1 odedia staff 2289094 Apr 10 12:29 923935AE-EF37-4527-9A76-D3A7CCB815EF.heic
-rw-------@ 1 odedia staff 536806 Apr 17 06:40 9F6A88C3-0647-4CB0-A1C3-CBB16E845475.heic
-rw-------@ 1 odedia staff 1344512 Apr 17 07:59 96F502BD-5E3D-4B68-A560-90F096665F52.heic
-rw-------@ 1 odedia staff 547873 Apr 17 08:02 9178F66C-1995-46C1-BE73-F60080C5B833.png
-rw-------@ 1 odedia staff 3388805 Apr 17 08:02 9555E748-00DA-4A49-801F-5CDF649E1E39.png
-rw-------@ 1 odedia staff 1004001 Apr 17 09:44 971BDE8F-6415-44D1-9044-3447981CAAAA.heic
-rw-------@ 1 odedia staff 3307002 Apr 17 11:59 96F502BD-5E3D-4B68-A560-90F096665F52_3.mov
-rw-------@ 1 odedia staff 284060907 Apr 17 12:13 97A0F76E-979F-49EB-AA71-5E43C273ECAD.mp4
-rw-------@ 1 odedia staff 4357027 Apr 17 12:37 971BDE8F-6415-44D1-9044-3447981CAAAA_3.mov
-rw-------@ 1 odedia staff 2769965 Apr 17 18:18 9F6A88C3-0647-4CB0-A1C3-CBB16E845475_3.mov
-rw-------@ 1 odedia staff 40768954 Apr 20 18:34 981EA08D-C6C1-4C00-AB25-B5A158E3B738.mov
-rwx------@ 1 odedia staff 32830464 Apr 22 19:14 931ED0E8-D802-4694-AABE-384B94DCEF27_4.nef
-rw-------@ 1 odedia staff 1810171 Apr 24 01:03 97581838-6098-494E-8240-E2FBFBB8EED1.heic
-rw-------@ 1 odedia staff 3551428 Apr 24 01:03 97581838-6098-494E-8240-E2FBFBB8EED1_3.mov
-rw-------@ 1 odedia staff 4387187 Apr 24 01:09 95F3748E-E0A7-4CDA-814A-471BA371B5C7_3.mov
-rw-------@ 1 odedia staff 2195816 Apr 24 01:09 95F3748E-E0A7-4CDA-814A-471BA371B5C7.heic
-rwx------@ 1 odedia staff 195499341 Apr 24 06:40 93BA8AD4-F611-4128-A0B8-2F308EDB45FB.mov
-rwx------@ 1 odedia staff 454047884 Apr 24 08:44 9B022B2C-3C2C-439A-AD6A-5D35A787FDAF.mov
-rwx------@ 1 odedia staff 1531493171 Apr 24 09:07 9AC7C683-F8A6-4B08-BA46-84757336F49D.mov
-rwx------@ 1 odedia staff 30724096 Apr 24 13:53 9D0D6347-7533-48CF-8738-268404C8A7F4_4.nef
-rwx------@ 1 odedia staff 13718016 Apr 24 14:06 97038C49-AC9A-41FD-8F52-442D66894AF2_4.nef
-rw-r--r--@ 1 odedia staff 19818562 Apr 24 16:58 931ED0E8-D802-4694-AABE-384B94DCEF27.jpeg
-rw-r--r--@ 1 odedia staff 9599 Apr 24 16:59 931ED0E8-D802-4694-AABE-384B94DCEF27_5.xmp
-rw-r--r--@ 1 odedia staff 13236 Apr 24 17:55 9D0D6347-7533-48CF-8738-268404C8A7F4_5.xmp
-rw-r--r--@ 1 odedia staff 13242 Apr 24 17:55 97038C49-AC9A-41FD-8F52-442D66894AF2_5.xmp
-rw-r--r--@ 1 odedia staff 10123800 Apr 24 17:58 9D0D6347-7533-48CF-8738-268404C8A7F4.jpeg
-rw-r--r--@ 1 odedia staff 4267420 Apr 24 17:58 97038C49-AC9A-41FD-8F52-442D66894AF2.jpeg
-rw-------@ 1 odedia staff 16097790 Apr 26 03:25 94FC9D79-2C05-422E-BA6C-20F06FC75CE1.jpeg
-rw-------@ 1 odedia staff 17832134 Apr 26 05:03 94B8BDC2-2E57-4672-8CEE-E2A12244C29E.jpeg
-rw-------@ 1 odedia staff 41121846 Apr 26 05:22 90E53C3F-29BF-499F-8997-749F1B4741AE.jpeg
-rw-------@ 1 odedia staff 21307903 Apr 26 06:03 94175067-EDEA-465D-A4FA-9291C95AA42E.jpeg
-rw-------@ 1 odedia staff 5050421 Apr 26 21:23 9E21C9CE-F0A0-4A75-817C-50396EA01141.jpeg
-rw-------@ 1 odedia staff 1072889869 Apr 26 22:49 98C02A30-7845-42A8-A77F-F93896DD5C21.mov
-rw-------@ 1 odedia staff 12632 Apr 27 13:06 9ED680A7-1C84-46D0-8EA4-7C47930236D8_5.xmp
-rw-------@ 1 odedia staff 24687449 Apr 27 14:57 9ED680A7-1C84-46D0-8EA4-7C47930236D8.jpeg
-rw-------@ 1 odedia staff 1395036731 Apr 27 16:35 9989D071-AC50-4D2E-8457-E2324868A386.mov
-rw-------@ 1 odedia staff 30347776 Apr 27 18:59 9E21C9CE-F0A0-4A75-817C-50396EA01141_4.nef
-rw-------@ 1 odedia staff 15115 Apr 27 19:09 9E21C9CE-F0A0-4A75-817C-50396EA01141_5.xmp
-rw-------@ 1 odedia staff 33073152 Apr 27 19:57 9ED680A7-1C84-46D0-8EA4-7C47930236D8_4.nef
-rw-------@ 1 odedia staff 112813944 Apr 27 20:53 90E53C3F-29BF-499F-8997-749F1B4741AE_4.dng
-rw-------@ 1 odedia staff 109301790 Apr 27 21:15 94175067-EDEA-465D-A4FA-9291C95AA42E_4.dng
-rw-------@ 1 odedia staff 85468112 Apr 27 22:13 94FC9D79-2C05-422E-BA6C-20F06FC75CE1_4.dng
-rw-------@ 1 odedia staff 12542 Apr 27 22:20 94B8BDC2-2E57-4672-8CEE-E2A12244C29E_5.xmp
-rw-------@ 1 odedia staff 31655936 Apr 27 22:24 94B8BDC2-2E57-4672-8CEE-E2A12244C29E_4.nef
I don't know of a specific repair permissions option for Photos outside of the full repair Photos library but I don't think you need to do that. I suspect it's an issue with permissions on the target volume.
My permissions look the same:
.rw------- rhet staff 2.6 MB Mon Oct 30 08:15:34 2023 8FE29AFC-908E-4871-AE3B-8918134603A9.heic
.rw------- rhet staff 417 KB Fri Nov 24 09:59:08 2023 8FF585DB-5044-4CFA-9056-658B2C2F70B2.jpeg
.rw------- rhet staff 1.6 MB Sat Oct 14 15:47:34 2023 8FF74A4D-4B3B-47B2-8FE9-A24AC83C8225.heic
.rw------- rhet staff 1.3 MB Sat Nov 25 12:35:19 2023 8FF74A4D-4B3B-47B2-8FE9-A24AC83C8225_3.mov
.rw------- rhet staff 6.5 MB Sat Nov 25 09:24:09 2023 8FFA5EFA-DB52-4D79-A4B8-2543AAE3EA81.jpeg
.rw------- rhet staff 2.7 MB Mon Nov 6 20:56:04 2023 8FFD2DC0-EE22-4370-8FD1-FE2DD246EA1F.jpeg
As long as user can read you should be able to copy the files. Does the target destination have permissions set correctly?
Some of the files in the target folder 2024-04-19 were set as root:staff
while others were set as odedia:staff
. I ran a chown
and now I'm running the export again.
Did you accidentally run an export under sudo?
Possibly, I’ve been playing with getting a LaunchDaemon to work using several scenarios.