Zotero creating duplicate PDFs upon file name change

edited yesterday at 4:54am
Hello,

Whilst researching why my library was as big as it is, to see if I can do anything to reduce its size, I noticed that many PDF files (in the `../storage/*` folders were doubled up.

In each instance the PDF has one copy with a cryptic name, and another with a name that matches the title of the document in question.

I am guessing this occurs when I rename the PDF (in Zotero) to have a more meaningful name. E.g. One instance has a name like "F041-CATest1977.pdf" and then the other instance has a name like "Marino - Biological Effects of Extremelrv Low Frequency Electric and.pdf".

I am not sure at one stage in my interaction with the idem in Zotero this filename change occurs. Obviously, the PDF attachment always just shows "PDF" as its name in Zotero.

[[UPDATE: I gather it's the "Filed Renaming" settings that are behind the renaming of the files.

https://s3.amazonaws.com/zotero.org/images/forums/u375021/2fjmvjvlx0ywineftilz.jpg

Although I see no option to have Z delete or not delete the original file ]]

So I have three questions:

1. What is causing the filename to change? (something I am okay with, but would like to understand the cause of). Is it when I update the library item title? I suspect it is, because the file name ends up reflecting what I put in the title. Although in the above example I see the filename also ended up with a prefix of the author's surname (which is not something I added to the title of the library item).

2. Why does it leave the original copy there? This results in a lot of duplicate PDFs and therefore unnecessarily bloats my library storage.

3. Something else I notice is that if I add a new PDF to a library item, and delete the old one (typically named "PDF"), the old file remains in the storage folder for that library item, and the new one ends up in a new storage folder. As the old PDF is no longer associated with (attached to) a library item, why is it not deleted from the drive?

Regards,

Jonathan
  • 4. I also notice that when I delete an attachment in Zotero, it does not delete the corresponding file in Finder. It is just removed from Zotero library item. Why is that?

    It seems to be Zotero has relatively poor file handling protocols, potentially resulting in a significant amount of excess storage space being used for redundant files. Is this something being actively addressed in the development plan?
  • Can you provide a Report ID to start?
    In each instance the PDF has one copy with a cryptic name, and another with a name that matches the title of the document in question.
    You're saying you see this within a single 'storage' folder? That's not normal behavior, and we've never seen anything like that. Are you using any plugins that affect renaming? Do you have your data directory in the default location? Can you provide exact steps to reproduce this?
    if I add a new PDF to a library item, and delete the old one (typically named "PDF"), the old file remains in the storage folder for that library item, and the new one ends up in a new storage folder
    I also notice that when I delete an attachment in Zotero, it does not delete the corresponding file in Finder. It is just removed from Zotero library item. Why is that?
    New attachments always go in separate storage folders, and storage folders are removed from disk when you empty the trash, so both of these are normal.
    It seems to be Zotero has relatively poor file handling protocols
    When posting here, please just report your problem and avoid comments like this. You're the first to report anything about duplicated files, and the rest is likely a misunderstanding.
  • 1. Report ID: 2029881145

    2.1. Yes, I am seeing this within a single 'storage' folder. My storage folder is not in the default location.

    2.2. It is in: '~/Documents/@Application Datastore/Zotero'

    2.3. I have not yet identified the steps to cause this outcome. But will do some tests to try and see if I can make it happen.

    3. My mistake. I forgot that Zotero has a Trash system.

    4. Sure. No problem. I didn't realise expressing an opinion based on my direct experience (however unique) would be an issue. In retrospect, I can see how some people may take it as a unjustified criticism and feel a reaction to that. I will avoid making such comments in the future.


    Thanks.
  • 2.2. It is in: '~/Documents/@Application Datastore/Zotero'
    Do you have Desktop and Documents syncing to iCloud Drive?
  • 2.2. No, I don't have my general files syncing to iCloud. Some apps use iCloud for syncing, but that's about the extent of my very limited use of iCloud. Everything is stored and backed up locally.
  • edited yesterday at 6:20am
    I'm referring to the specific "Desktop & Documents Folders" setting in System Settings (top Apple Account button → iCloud → Drive). You should confirm that that's not enabled.

    But you also have lots of plugins installed, including multiple that involve moving/renaming files, so that's the most likely cause here.

    If you can reproduce this in Troubleshooting Mode (Help → "Restart in Troubleshooting Mode…”), which disables all plugins, we'd want to see a Debug ID for it occurring, but it's very unlikely that this is caused by Zotero itself.
  • edited today at 2:34am
    I understood what you mean regarding iCloud, and I can again confirm "Desktop & Documents Folders" is not syncing to iCloud. As mentioned, I don't use iCloud for syncing my files and folders, and that includes Desktop and Documents folders. As shown here:

    https://s3.amazonaws.com/zotero.org/images/forums/u375021/kgsti0hsrlp3crq10ppe.jpg

    Yes, there are a number of plugins installed. As far as I can tell, the main one that involves file manipulation is ZotMove. However, it's never been configured, so has been non-operational. I have now disabled it, since I wasn't making use of it.

    I suppose it's possible Zotero Linter plugin might rename files, although I don't see that anywhere in its settings or description online. AFAIK, it only makes changes to metadata and titles etc. within Zotero.

    As the renamed files exactly follow the naming convention in the "File Renaming" settings of Zotero, I am inclined to think that's what did the renaming. Although, obviously that's coded to only rename the existing file, not to first duplicate it. So it seems to me it's not a question of what did the renaming, but what caused a second file (with the original file name) to be created along side the renamed file.

    https://s3.amazonaws.com/zotero.org/images/forums/u375021/jz2kzw3aktd470aw05fx.jpg

    >> UPDATE

    I was able to recreate the issue (with plugins enabled), and not without them enabled. I then found the issue went away when I disabled Zotero PDF Metadata plugin (https://github.com/franzbischoff/zotero-pdf-metadata/). Oddly, when I re-enabled that plugin the issue has not returned.

    So for now it appears the issue has been resolved, although I am not sure why disabling and re-enabling that plug-in did the trick. Thanks for your help in pointing out the various troubleshooting features in Zotero, and other suggestions. This enabled me to figure out what was causing the problem.
  • It's certainly plausible that a plugin that's writing to PDFs when they're being renamed could cause something like this. If you see it again (or perhaps even if you can't), you should report it to the plugin developer on GitHub.
Sign In or Register to comment.