File corrupted after crash

Hi, today my phpstorm become unresponsive while editing a file and it caused the hole windows to become unresponsive , so i had to restart the windows by force (case restart button).

After booting when i started phpstorm got some errors about corrupted config files.

Cannot load settings from file 'C:\Users\Exlord\.PhpStorm2016.2\config\options\window.manager.xml': Error on line 1: Content is not allowed in prolog.

Cannot load settings from file 'C:\Users\Exlord\.PhpStorm2016.2\config\options\recentProjectDirectories.xml': Error on line 1: Content is not allowed in prolog.

Cannot load settings from file 'C:\Users\Exlord\.PhpStorm2016.2\config\options\feature.usage.statistics.xml': Error on line 1: Content is not allowed in prolog.

Cannot load settings from file 'projectname\.idea\workspace.xml': Error on line 1: Content is not allowed in prolog.
Please correct the file content

then opened the file that i was working on and it was empty :((, well not empty there is one line of unreadable data

�������������������������������������������������

The local history is empty and i don't have any backups of this since it is a new file that i have been working for a week :((
The safe write was not checked too.
I uploaded the file to http://farhadadeli.ir/files/vote.js

Is there a way to restore its content?

2
Avatar
Permanently deleted user

Hello,

Without safe write we work with files directly. System crash could interrupt Java write stream and cause file corruption - as any crash of any system, this situation is unpredictable and circumstances are totally unforeseen.

We already have a ticket related to settings lost (those XML config files) submitted to our tracker here: <https://youtrack.jetbrains.com/issue/IDEA-155955>. Our team is investigating the cause of this. You can vote for it in order to move it up in the queue and receive notifications regarding the progress of the feature. See more information on working with tracker at <https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications>.

However, project files are not affected by this and should be completely safe with "Safe Write" option - it creates a temporary file with changes which is merged into main file afterwards so all read/write operations are performed with temporary file.

Now, unfortunately, nothing can be done about recovering this file. If local history is empty, we cannot track it back.

I would advise to enable "Safe write" and configure a version control system (like Git, Subversion or similar) and integrate PhpStorm with it.
Version control can help you with code base tracking and also works like a granular backup solution for it and can save code from unpredictable crashes in future.

It is also worth to check the hardware and ensure that everything is OK with hard drive, its controller and everything else - this hang might be actually an alarm bell.

0
Avatar
Permanently deleted user

Hi,

Tanks for the response. I had disabled "safe write" because i was getting lots of "file cache conflict" -> https://www.jetbrains.com/help/phpstorm/2016.2/file-cache-conflict.html, and i thought that "safe write" was causing it. but it didn't and i am still getting "file cache conflict" while working on a file.

I have git but since this was a new file in a new module i was waiting to finish it to commit :(

I am working on a SSD and i checked/optimized it with windows build in tools no errors were reported.

Tanks anyway.

0

Do you use a network share/mount as a project directory?

0
Avatar
Permanently deleted user

I have identical problem. After power off I ended up with corrupted local history and file filled up with zeroes. I have "safe write" turned on and it still didn't help. Notepad++ have similar issue, so it may be Windows problem https://notepad-plus-plus.org/community/topic/13302/fix-corrupted-txt-file-null

And one more thread https://github.com/Microsoft/vscode/issues/9589

0
Avatar
Permanently deleted user

For a possible work around, If you have this similar problem see https://stackoverflow.com/questions/54035963/how-do-i-recover-previous-local-histories

 

1

Thanks for sharing

 

0

I deleted the .idea/ folder (a desperate attempt to make Idea "understand" a Gradle project it understood before switching a branch)...

...then I realized with it I also deleted all my Run/Debug configurations. All files under .idea/ provide their Local History, with one exception: workspace.xml.

*bump*

0

请先登录再写评论。