How to fix missing attachment issue

I am using zotero on two devices.
On my primary device I have pdfs linked from at least two locations. But Zotero is able to find them without issues.

I have setup identical paths on secondary device using symlinks and is syncing the files externally through Koofr.
However attachments from one of these paths is not opening. Instead I see this message.

The attached file could not be found. It may have been moved or deleted outside of Zotero, or a Linked Attachment Base Directory may be set incorrectly on one of your computers.

How can I fix this? Perhaps it would be helpful if this message can print out the path expected by Zotero so that I can see where the problem lies.
  • edited May 5, 2024
    I have never heard of that error message not including the actual path where Zotero expected to find the PDF file. But you have a complex unsupported setup (symlinks etc). I assume from what you say that you are using a linked PDF file setup (ie your symlinks are not for the Zotero database folder or the Zotero\storage folder) ?

    What happens when you right click on the PDF under its item and select Show File on each computer ? That operation should be looking for the file in the same place on both computers. A complication would be if you have a Linked Attachment Base Directory setting on either or both computers (setups are simpler without that) - that can change where Zotero *looks* for linked PDF attachments on different computers (unless it is set the same way on each computer).

  • Yes. My symlinks are not for the Zotero database.

    When I select Show File on the computer where the error message appears nothing happens. On the same computer for a pdf file without this issue the proper path opens up in file explorer.
    The same file on my other computer has no issues and open up correctly.

    Now when I check, this computer (my laptop) which didn't have issues has the linked attachments directory set up but not for the other one. Is this the reason for the error and for the fact that the expected path is not reported in the message?
    So temporary solution would be to set it up the same way in both computers?
  • The simplest multi-computer linked PDF setup is for each linked PDF to be present at the exact same path on all computers. The location of each PDF is saved *individually* in the Zotero database. No Linked Attachment Base Directory setting to tell Zotero where to look for PDFs is necessary in that case - all PDF locations are explicit in the database, eg. G:\ZoteroAttachments\filename.pdf.

    However once you have set a LABD on *any* computer, the database entry for all linked PDF locations is changed. For example if you set LABD on any computer to say G:\ZoteroAttachments, the Zotero database PDF location entry would become attachments:filename.pdf. So that when you try to open that PDF, the 'attachments:' prefix tells Zotero to look for the PDF under the LABD you set. Note that the LABD has no effect on where linked PDFs get *saved* in the first place.

    A LABD setting is really only required if you must have PDFs stored under a *different* path on different computers. For example, if PDFs are under G:\ZoteroAttachments on the original computer, but G: drive is used for something else on the other computer - so you have to use E:\ZoteroAttachments there. Then you would set LABDs on each computer.

    But once a LABD is set on one computer, it has to be set on all computers. So it sounds like your problem is likely simply that you set a LABD on one computer (which means that all linked PDF locations are stored as attachments:filename.pdf), but not the other - so Zotero doesn't know how to interpret the 'attachments:' prefix there. The simplest solution for you should be to set the LABD on all computers (even if the LABD settings are all the same).

    When using complex setups, it's always a good idea to first understand exactly how Zotero implements linked files 'under the hood'. And then write it all down once it's working, in case it breaks later and you have to recreate it. ;)

    Note of course that you don't actually need symlinks/Koofr for a multi-computer linked PDF setup - most people do it with Dropbox, Google Drive etc.
  • Ya I agree that the root of the problems is not understanding properly how Zotero works.

    But what happened was that I found that even when I have path x set as the directory in LABD I could link to files in other locations in my laptop. I was not sure if this was a bug but I used it as a feature or maybe because I wanted to use this new location and didn't know how I would transfer prior attachments to this new location. Now when I read the documentation what I gather is the following. If I just keep everything in a new location and set this location as the LABD then everything works fine. Is that so ?

    It was because of this broken set up on my laptop that I had to use symlinks and recreate these multiple locations in the other PC as well. I was just using Koofr similar to how one would use Dropbox. The only difference was I was using symlinks to mirror the multiple locations from where I had added linked files in my laptop so that it would open similarly in other pc.

    I installed zutilo to see if I can fix these issues but didn't understand how it would be helpful. I am okay to store everything in a single attachments directory now but how should I proceed to get out of this mess?
  • edited May 8, 2024
    You can check the location that Zotero has stored for each (linked) PDF with Zutilo. Under the right-click menu it will show you that with its Show Attachment Path(s). Your linked PDFs' locations on both computers will likely have the 'attachments:' prefix (due to you setting a LABD on the first computer).

    Adding the LABD setting on the second computer should allow Zotero to find linked PDFs there. It sounds like those linked PDFs on the second computer are at the same paths as on the first computer (where Zotero is correctly finding them). Zotero will then insert the LABD in place of the attachments: prefix when it tries to open a linked PDF there.

    It is possible that if PDF locations are more disorganized then you might still have more problems. But with Zutilo you should always be able to see where Zotero is looking for them (eg when the error message does not tell you that).

    Once all your linked PDFs are locate-able on all computers, you could move them to a more consistent/single folder location with Zotfile. Its Manage Attachments\Rename&Move (also in the right click menu) will do that, having set its Custom Location to the folder you want linked PDFs moved to (do that move in small chunks if you have a lot of PDFs). Zotfile's stored location for each PDF will be automatically updated. If your PDF file mirroring across computers is working for all the required folders, all PDFs should also effectively be moved to the new location on the other computer.
  • Thanks for your detailed instructions. I was trying to implement it. The zutilo context menu item had to be enabled in the settings for me to find it. Then I tried to test the instruction of moving it to a desired path using Zotfile as follows.

    I went to zotfile settings. Since I didn't want files to be renamed, I checked some boxes that I guessed would prevent this. After that in the general settings tab under location of files I specified the target directory where I wanted the file moved. After that I used the right click menu item - rename and move but I get an error as follows.

    "Attachments skipped because they are top level items, snapshots, an avoided filetype, or the file doesn't exist"

    This doesn't make sense, I use the menu item by right clicking on file item not the parent. I made sure the file opens in zotero. I checked the path referred by Zutilo and the path exists on my disk.
    So then what might be causing this issue? Does the state of affairs on another computer cause problems?
  • Of the possible reasons stated in that latest error message (presumably from Zotfile), you seem to have excluded most*. The 'avoided filetype' refers to the Zotfile Advanced Preference: 'Only work with the following file types'. If you have that set to ON, and you are trying to move a file type that is NOT in that list, then it won't work.

    *I assume that even though you right clicked on the PDF itself (correctly), it does have a parent item ?

    That error can also apparently be triggered when associated with Send to Tablet ...
  • The files that I am dealing with are indeed PDFs. I have even tried to uncheck the zotfile advanced setting regarding the filetypes. I have not been using the tablet feature in zotfile although I had set it up long time back. So the tablet folder was non-existent. So to make sure that was not causing the issue. I manually copied pdf files to this tablet directory. Tried using the "Get from Tablet" feature. Nothing works. :-(

    I am totally confused.
  • You have a LABD set on at least one computer right ?

    Do you have it set on both ?

    And these are all parent items with PDF attachments right ? Not just PDFs without a parent item ?
  • Yes. I have an LABD set on both my computers to the same path.
    Yes I am talking about PDFs with parent items.
  • When you select one of the problematic linked PDFs and use Zutilo right-click to 'Copy attachment paths', and paste that path into the Explorer address bar, does it then find/open that PDF in an external PDF reader ?
  • I didn't get what you meant by Explorer. Is it any file explorer program that I have on my desktop?
    I can open the pdf within zotero as well in a file explorer by clicking show file.

    This is the path I get from the `copy attachment path` -> /home/linn/Dropbox/publications/Kuminski_2016.pdf
    This is the path that opens up from zotero's show file as well.
    Does that answer your question.

    If I do `Show attchement path` it gives this -> Kuminski_2016.pdf
  • Re Explorer ... yes, whatever file/folder viewer you have on your OS.

    The purpose of that test was to copy the full path (from Zutilo) where Zotero *thinks* a linked file is located, and then try to open the file at that path outside Zotero ... which would test if it is actually at that location.

    But re "I can open the pdf within zotero as well in a file explorer by clicking show file. " ... then what is the remaining problem ? ;)
Sign In or Register to comment.