Read-only files break WebDav syncing

edited November 22, 2017
Hello everyone,

First things first, report ID is 756817971.

There is a "bug" in the way zip files are created for WebDav storage that totally break syncing on multiple computers. (I mean, we could consider this a feature, but it's more of an inconvenience than a benefit in my opinion.)

If you happen to add a file that is read-only on Windows (because a stupid program thought it was a good idea...) to your Zotero library, it creates a zip file in the WebDav storage that preserves that read-only status as a "zip" attribute. (If you look at the zipped file with a Unix OS, it will have "444" permissions upon unzipping.)

However, things are more problematic when "syncing back" the file on another computer; Zotero then triggers the following error :
"Win error 5 during operation open on file C:\Users\Toto\Zotero\storage\8AQ9XXG4\US2016281129A1-1_copy.pdf (Accès refusé.)" {file: "(unknown module)" line: 0}
("Accès refusé" is French for "Access denied").

More astonishing, fixing permissions on the local (C:\...\storage\...) repository is not enough for the syncing to occur. I tricked the system by recreating by hand the zip files on the WebDav repository with "666" permissions and removing any read-only flags on my computer; but it is a pain and unfeasible if many files are "corrupted".

Thus, I wonder if it is a good idea that Zotero preserves that read-only attribute during the "zipping", as it can be at the root of big syncing issues. Is it something intentional?

Thanks in advance for your solutions and/or modifications!

### Steps to reproduce ###
- store an attached file (PDF in my case) with read-only permission on Windows ;
- sync it on a WebDav server ;
- sync it back on another computer (I don't know if a previous version of the file is needed on the second computer to trigger the error).
  • Hi,

    I found a fix that works:
    1) fix the permissions of your files locally (i.e. remove the read-only flags of all the attached files for your library)
    2) in Zotero preferences, Reset File Syncing History
    3) accept local version of files when prompted during syncing.

    This allow to quickly reset the attribute of the files, by re-uploading files that were read-only on the webdav server.

    However, I still think that Zotero should explicitly not take into account this flag when creating the zip file for Webdav storage.
  • Thanks! A lot of people have reported this, but we weren't able to reproduce it until your report. This should now be fixed in the latest 5.0 Beta, and the fix will be included in 5.0.30 in a few days. It'll also now unset the read-only attribute when adding a file to Zotero.
  • 5.0.30 is available now with this fix.
  • I am glad I could be of help! Thanks for the fix :)
Sign In or Register to comment.