transferring library and PDFs to a new computer (Mac), PDFs won't load

Hi,
I recently bought a new MacBookAir (Monterey, 2017) and now I can't open PDFs when double-clicking the entry in my library. When I do, the loading screen of the Zotero PDF-reader appears, but the PDF won't load (no error message). I can open the PDF with other PDF viewers when I click 'show File'. Moreover, when I remove the PDF and add it to the entry in my library again, the PDF viewer functions normally.

Is there any way to fix this? Maybe there is a way to automatically create copies of all PDFs while at the same time removing the dysfunctional ones?

Any help would be greatly appreciated!
Thanks

PS: First post, so apologies in case I didn't make myself clear enough.
  • edited September 23, 2022
    Can you provide a Debug ID for trying to open a file that doesn't work?

    How did you transfer your library? Migration Assistant or something else? I'd guess that there's just a permissions problem with the transferred files, which would be easy to fix.
  • Yes, I used the Mac Migration Assistant!

    The Debug ID I got is: D1903729186

    Thanks for your quick reply!
  • edited September 23, 2022
    Yeah, you're getting a strange error:
    [JavaScript Error: "Unix error 1 during operation open on file /Users/[…]/Desktop/[…]/_Zotero Attachments/[…].pdf (Operation not permitted)"]
    So maybe some sort of permissions issue or some extended attribute that got set on the files during the transfer. Try resetting all the permissions in that folder from the Get Info window to make sure your user account has full read/write privileges to all folder and files.

    I'm assuming you don't have any sort of third-party security software on this computer that might be interfering? This isn't a problem in Zotero itself.
  • Hi,
    I doublechecked and my user account had full read/write privileges all along. The PDF still won't open in the reader unfortunately.

    Anything else I could do?
  • I'm afraid you'll need to debug this on your system. It's 100% not a problem in Zotero. Zotero simply can't access the files (and not even with a standard access-denied error — a stranger one).
  • @Eulenkopf: Well, one more thing that might tell us a little more. If you open Terminal from Spotlight, type ls -la (with a space at the end), drag in the parent folder of that PDF so that it adds the path, and then press Return, what's the output? (You can email to support@zotero.org with a link to this thread if you don't want to share publicly, but we'll respond here.)
  • The output I get is:

    87-77-216-90:~ myname$ ls -la /Users/myname/Desktop/Books\ Papers\ etc./_Zotero\ Attachments/Arendt/1958/The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition
    total 60648
    drwx------@ 3 myname staff 96 Nov 24 2021 .
    drwx------ 6 myname staff 192 Jan 26 2022 ..
    -rw-r--r--@ 1 myname staff 31050755 Mar 15 2022 Arendt_1958_The Origins of Totalitarianism, 2nd enlarged edition.pdf
    87-77-216-90:~ myname$
  • drwx------@ 3 […] staff 96 Nov 24 2021 .
    drwx------ 6 […] staff 192 Jan 26 2022 ..
    -rw-r--r--@ 1 […] staff 31050755 Mar 15 2022 A[…].pdf


    Yeah, so there are some extended attributes on the file.

    In Terminal, enter xattr (with a space) and drag the folder and the file to the window, and then let us know the output.

    (This isn't related to Zotero in any way. We might be able to quickly tell you what to do, but really this would be for Apple or a general Mac troubleshooting forum to help with.)
  • Hi, thanks so much for helping me out nonetheless! Here is the output:

    87-77-216-90:~ myname$ xattr /Users/myname/Desktop/Books\ Papers\ etc./_Zotero\ Attachments/Arendt/1958/The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition /Users/myname/Desktop/Books\ Papers\ etc./_Zotero\ Attachments/Arendt/1958/The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition/Arendt_1958_The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition.pdf
    /Users/myname/Desktop/Books Papers etc./_Zotero Attachments/Arendt/1958/The Origins of Totalitarianism, 2nd enlarged edition: com.apple.macl
    /Users/myname/Desktop/Books Papers etc./_Zotero Attachments/Arendt/1958/The Origins of Totalitarianism, 2nd enlarged edition/Arendt_1958_The Origins of Totalitarianism, 2nd enlarged edition.pdf: com.apple.lastuseddate#PS
  • edited September 23, 2022
    Yeah, com.apple.macl is a macOS security-related flag.

    Try xattr -rd com.apple.macl (with a space), drag the top-level Books folder, and press Return. Hopefully that will remove that flag from all folders and files under that folder.
  • Hi, so I did that and then I tried xattr + folder and file name again, but I still get the same output ending on com.apple.lastuseddate#PS.

    Any help is very much appreciated (and thanks for helping me thus far!)

  • edited September 23, 2022
    Do you still see com.apple.macl for the parent folder?
  • Also, if you drag the PDF to, say, Firefox or Chrome, can they read it?
  • The output I get now using xattr folder and file is:
    __
    87-77-216-90:~ myname$ xattr /Users/martinrenz/Desktop/Books\ Papers\ etc./_Zotero\ Attachments/Arendt/1958/The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition /Users/myname/Desktop/Books\ Papers\ etc./_Zotero\ Attachments/Arendt/1958/The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition/Arendt_1958_The\ Origins\ of\ Totalitarianism\,\ 2nd\ enlarged\ edition.pdf
    /Users/myname/Desktop/Books Papers etc./_Zotero Attachments/Arendt/1958/The Origins of Totalitarianism, 2nd enlarged edition/Arendt_1958_The Origins of Totalitarianism, 2nd enlarged edition.pdf: com.apple.lastuseddate#PS
    __
    So actually you're right and I don't see it for the folder anymore (?)


    I can drag the PDF into chrome and it reads it instantly.
  • What about Firefox?
  • It works on Firefox as well!
  • But the same file still doesn’t work in Zotero after dragging to those programs? And that’s after restarting your computer?

    Also, are you saying you can add the same file from the same location as a linked file and it then works? If so, presumably the original attachment (pointing to the same location) also starts to work?
  • Yes, after dragging and restarting, the file doesn't open in the Zotero PDF reader.

    However, if I replace the original attachment, it works, i.e. if I remove the PDF from the folder and then re-insert it by dragging onto the library entry in Zotero.

    This is why I originally thought there might be some way to automatically replace all attachments by a copy or similar. But I would also be happy with a simpler way that removes the mac OS security-related flag of course!
  • However, if I replace the original attachment, it works, i.e. if I remove the PDF from the folder and then re-insert it by dragging onto the library entry in Zotero.
    That wasn’t my question, though — the question is about a very specific process.
Sign In or Register to comment.