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.
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.
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).
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?
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.
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?
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.
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?
*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 ...
https://forums.zotero.org/discussion/comment/278630/#Comment_278630
I am totally confused.
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 am talking about PDFs with parent items.
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
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 ? ;)
- This is only true in one of my devices. Not my other device.
I have now manually fixed the issue by moving the individual pdfs to a single location and re-linking in zotero library.
Thanks for all the help. I really appreciate your patience.