can't write to NAS drive

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
Since upgrading to OSX El Capitan and taking the subsequent Lightroom and Photoshop CC updates, I am now having major problems writing to my NAS drive (Netgear ReadyNAS v2). I can see the NAS in finder and navigate to all the files on the NAS drive, but both Lightroom and Photoshop are having problems writing files to it i.e. Export and Print to File in LR and file save or save as in PS.
Photo of Andrew Crothall

Andrew Crothall

  • 4 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of Steve Sprengel

Steve Sprengel, Champion

  • 2654 Posts
  • 340 Reply Likes
I'd guess El Capitan changed the permissions of the drive to readonly.

Google how to work with permissions on a Mac.
Photo of Andrew Crothall

Andrew Crothall

  • 4 Posts
  • 0 Reply Likes
I have tried writing files to it with other apps like Pages and they work OK. Finder can also write/copy files to the NAS ok. Also, Lightroom and Photoshop will work occasionally if you re-try the export, but will usually fail or will create a file of zero bytes. Exporting one file sometimes works but exporting multiple files definitely fails. Its almost as though the slight latency you get with a NAS drive is now tripping up PS and LR.
Photo of Steve Sprengel

Steve Sprengel, Champion

  • 2654 Posts
  • 340 Reply Likes
It does sound like there is some race-condition where there are multiple operations opening and closing each file on the NAS from LR and one of those gets in the way of the next.

Could it also be some virus-scan or backup operation that is grabbing the file when it is first closed even though LR wants to open and use it, again? You could test this by disabling the virus scanner and backup process temporarily.

I know when LR 6 was first released there were problems with white images during export and Adobe may still be tweaking things for this or just generally efficiency reasons, which is why a new update can act differently.

It also could be that the NAS is having issues sequencing the file-open-write-pixel-data-file-close-file-open-write-metadata-file-close-file-rename (or whatever happens) that the Export or Save operations could be doing and reporting that an operating has finished when it's still working on it, and subsequent operations fail.

There are ways to trace the file i/o operations performed on Windows. I supposed the same sort of utilities might exist for the Mac but I don't know what they are. Maybe a Mac tech can chime in.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 815 Reply Likes
Are you connecting to the NAS drive via SMB? If so, try connecting via AFP or CIFS instead (to avoid known MacOS bugs).
Photo of Andrew Crothall

Andrew Crothall

  • 4 Posts
  • 0 Reply Likes
Thank you very much for your suggestions. I turned off TimeMachine and my Trend Internet Security AV and guess what - it worked! the culprit is the Trend AV. Turning that back on caused the problems in LR and PS immediately. I will now get in touch with Trend.
Thank you so much! Have a great week.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 814 Reply Likes
Ah, that was my next idea for troubleshooting.

Thanks for letting us know what you found!
Photo of Steve Sprengel

Steve Sprengel, Champion

  • 2652 Posts
  • 340 Reply Likes
So the solution would seem to be Adobe writing everything to a file in one file-open-write-close operation instead of multiple open-close operations which gives the AV scanner time to open and hold the file in the middle of the save or export.

On the OP's side, adding the extensions of the files being saved as scan exclusions might also prevent the AV scanner from getting ahold of the files.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 814 Reply Likes
A "solution" depends on exactly what the problem is with that AV scanner and the network volume. Most likely it isn't something that an application can work around.
Photo of Steve Sprengel

Steve Sprengel, Champion

  • 2652 Posts
  • 340 Reply Likes
If the application opens the file exclusively and writes all the data then closes it all in one open-write-close session, then the AV wouldn't have a chance to get ahold of the file and mess things up.

If the NAS doesn't support exclusive file access during creating then yeah, maybe nothing can be done. I don't think we're talking about an AV scanner as part of the NAS OS, just one on the computer that is also running LR and PS.

My main point is that the multiple opens/closes/reopens/closes during a single file save/export is a vulnerability. Are you saying there aren't multiple opens/closes involved or that you're not sure. I remember LR 6.0 have problems with the white exports because of all the opens/closes involved.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 814 Reply Likes
And it could be a bug in an OS routine or on the server (both have happened before). Until the AV engineers debug it, we just don't know.

Photoshop doesn't have multiple passes - we write the temp file, close, then rename it to the final name (or call an OS replace routine that makes it a more atomic operation).
Photo of Andrew Crothall

Andrew Crothall

  • 4 Posts
  • 0 Reply Likes
Thanks for your continued deliberations. I opened a ticket with Trend and after a couple of emails they asked me to call them, which I did this morning. After a frustrating 50 minutes on the phone, their only suggestion was to un-intsall an re-install the AV app. I did that and it didn't make any difference. However, we have determined that it is the real-time scanning feature of the AV that is causing the issue. I also investigated the possibility of telling the scan to ignore certain file extensions (i.e. the .cr2 .tif and .jpg files on the NAS), but this only applies to on-demand scanning an not the real-time scan.
FYI I found several files on my NAS that were either of zero bytes or had the extension .swp, so I guess these are the result of failed write and rename operations.
In the mean time I await further feedback from Trend.