Lightroom: Instead of saving my preferences, Lightroom is deleting my preferences file.

  • 2
  • Problem
  • Updated 5 years ago
This is the 2nd time it's happened:

* Upon restart, previously populated preferences file has been replaced with a virginal version containing *none* of my previous preferences. - Lightroom acts like it's the first time it's ever run...

I suspect Lr had a problem whilst writing the preferences, and that is the root of it.

Regardless, I recommend Lr always make a copy of the preferences file before overwriting. Then if problem, notify user:

"There must have been a problem... - recovering preferences from previously saved file..."

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes

Posted 6 years ago

  • 2
Photo of jdv

jdv, Champion

  • 728 Posts
  • 56 Reply Likes
Is the preference file actually gone? Is there a similarly named file in its place?

I bet you have real-time anti-virus software running on this machine. If so, check to see if it has quarantined or deleted the prefs file. Sometimes the heuristics used to determine if malware is at play are triggered when an app does a safe atomic write of a file change.

That is, the action of making a copy and committing it can actually trigger RT AV systems to delete files.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
My big one, with all my preferences in it, was replaced by a little one, with no preferences in it (other than factory defaults I mean).

(sorry thread title wasn't clearer)

Not an anti-virus issue.
Photo of Robert Frost

Robert Frost

  • 412 Posts
  • 63 Reply Likes
Maybe just a size issue? Or LR just choked on all the stuff you have probably put in it - it's meant for normal users! ;)

Bob Frost
Photo of jdv

jdv, Champion

  • 728 Posts
  • 56 Reply Likes
How do you know this is not a RTAV issue? This is exactly the sorts of things you see when arbitrary .sys code is inserted in the call stack for file ops.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
It happens without RTAV.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Just happened again 2013-02-12
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Just happened again 2013-04-14
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Just happened again 2013-09-03
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Just happened again 2013-09-17 (Lr5.2/win7-64).
Photo of Pete Green

Pete Green, Customer Advocate

  • 721 Posts
  • 136 Reply Likes
This is weird Rob... Is there something else happening on your system that might be cleaning the preference file?

Anything you can think of that is happening to cause the prefs reset?

How do you notice the reset?
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Hi Pete,

I use Lightroom with right and main panels on one monitor, and the left panel extended across a 2nd monitor, so when I startup and it (UI) is all on one monitor, I know it's happened again. I then look at the preferences file on disk and it's like 16k (small), instead of the previous (1MB) big.

It's not a huge problem since I've come to backup my preferences regularly for ready restoral, but to answer your other question: No - I can't think of anything that would cause it, other than a bug in Lr (i.e. no funny auto-processes running or such...).

I have plugins which rely on preferences for a variety of fairly storage-intensive purposes, which is why my prefs file is so big, and these plugins are updating the preferences via concurrent (background) tasks running in Lightroom. But I've never noticed any errors/problems while Lr running, the problem is occuring upon shutdown I think, probably when the preferences are being saved from ram to disk.

Other than that, nothing unusual I can think of.

Thanks for asking,
Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Just happened again:



Should be about 10MB, not 8KB... - all preferences were lost.

R
Photo of Paul Kleczka

Paul Kleczka, Employee

  • 44 Posts
  • 5 Reply Likes
Hi Rob-

To my knowledge we haven't had anyone else complain about this problem, and Lightroom preferences do not technically behave the way you are describing, so it is likely one your custom plug-ins is the culprit.

Do you have any custom plug-ins that deal with preferences or are likely to affect preferences? Would you be able to disable them and see if the issue still occurs?

Thanks,

-paul
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Hi Paul,

Since I never heard back from you after you requested a test plugin, which I provided, demonstrating problem with method that creates virtual copies, I figured you must have sailed off the edge of the world or something. Good to see you're still alive and well.

All of my plugins use preferences, and all of them follow the rules, as I understand them - no funny business.

That said, I do have several megabytes of preferences and they are being constantly written / read by background tasks, but I don't think that breaks any rules.

That said, I can see where such would be more prone to unveiling weaknesses in Lr's preference handling subsystem.

I use many plugins and the problem only occurs once every few months, so disabling a bunch of them as a test isn't practical.

Thank you for your concern,
Rob
Photo of Paul Kleczka

Paul Kleczka, Employee

  • 44 Posts
  • 5 Reply Likes
Preferences "constantly written/read by background tasks" seems likely to cause a risk for a race condition of some sort causing this issue, whether it is in Lightroom or your plug-ins themselves. Since we have heard no other reports from users on this behavior, it would be prohibitively difficult for us to try to debug this issue on our end without more information.

I would suggest you include detailed logging in your plug-ins that could identify a pattern of behavior when this issue occurs.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Fair enough Paul - my main hope at this point is:
* That the programmers are aware of the problem, and keep it in mind as they work.

(I've got no expectations for a targeted debugging effort..).

Plugin-wise, all background tasks are going through endorsed APIs for reading/writing prefs and everything else, so there shouldn't be any "plugin bug races" (all access is non-preemptive, via LrSDK methods, etc...).

Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 385 Reply Likes
Happened again. I thought I was on to something which turned out to be red herring - thus the deleted reply above (sorry).

That said, I think the main problem (I scrutinized corrupt file against good file), is that the tail end of the file, although approximately the right length (number of bytes), is all zeros.

Let me know if you want a copy of the corrupt file.