LyXCorrupt .lyx file due to improper shutdown

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
jewblah
Posts: 4
Joined: Thu Nov 15, 2012 12:07 am

Corrupt .lyx file due to improper shutdown

Post by jewblah »

Hello LyXers,

Last night I finished some sections of a Lyx document while also running Matlab. I called it quits for the evening and shut down Matlab and Lyx at about the same time, but Matlab froze my system and Lyx never completed its shutdown, and I had to Ctl+Alt+Del restart. In hindsight I should've waited longer I guess.

Anyway, today when I came to work further on the document, after clicking on the file, Lyx opens and gives an error: "[document.lyx] is not a readable LyX document." It appears that the incomplete shutdown somehow corrupted the file.

The file is ~24kb, approximately the same size as other documents of similar content/length, but when I open it in notepad it only contains blanks--no text. Other non-corrupt Lyx documents are readable in Notepad.

I tried accessing the backup .lyx~ document after removing the ~, but the same error appears.

Finally, I tried the conversion to .tex file suggested here, but there is no output file generated.

Do you have any suggestions or know if the file is completely forgone? I have 3-5 hours in the document as-is, so a very involved data recovery isn't worth it.

I'm uploading the file here if anyone wants to give it a shot. I'm guessing it's a lost cause but who knows. Also, my apologies if this is the wrong forum or a repost--I used the search feature :geek:

Windows 7, LyX version 2.0.3.

Thanks for any help!
Attachments
damaged_file.lyx
(23.95 KiB) Downloaded 544 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Corrupt .lyx file due to improper shutdown

Post by CrazyHorse »

jewblah wrote:Anyway, today when I came to work further on the document, after clicking on the file, Lyx opens and gives an error: "[document.lyx] is not a readable LyX document." It appears that the incomplete shutdown somehow corrupted the file.

The file is ~24kb, approximately the same size as other documents of similar content/length, but when I open it in notepad it only contains blanks--no text. Other non-corrupt Lyx documents are readable in Notepad.
LyX itself backups all files with a tilde as suffix: file.lyx -> backup is file.lyx~

You can try to find that file which should be in the same directory. Rename that file to whatever.lyx and load into LyX
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Corrupt .lyx file due to improper shutdown

Post by scottkosty »

jewblah wrote:Anyway, today when I came to work further on the document, after clicking on the file, Lyx opens and gives an error: "[document.lyx] is not a readable LyX document." It appears that the incomplete shutdown somehow corrupted the file.

The file is ~24kb, approximately the same size as other documents of similar content/length, but when I open it in notepad it only contains blanks--no text. Other non-corrupt Lyx documents are readable in Notepad.
Your .lyx file is indeed worthless. Please try what CrazyHorse suggested and report back whether it worked.
CrazyHorse wrote: LyX itself backups all files with a tilde as suffix: file.lyx -> backup is file.lyx~

You can try to find that file which should be in the same directory. Rename that file to whatever.lyx and load into LyX
+1
jewblah
Posts: 4
Joined: Thu Nov 15, 2012 12:07 am

Corrupt .lyx file due to improper shutdown

Post by jewblah »

jewblah wrote: I tried accessing the backup .lyx~ document after removing the ~, but the same error appears.
The backup file acts exactly the same as the main one--shows 24kb but all blank in Notepad.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Corrupt .lyx file due to improper shutdown

Post by scottkosty »

jewblah wrote: The backup file acts exactly the same as the main one--shows 24kb but all blank in Notepad.
I don't have any other ideas. You could email lyx-users@lists.lyx.org explaining the problem (and that you tried to access the backup file).

Scott
jewblah
Posts: 4
Joined: Thu Nov 15, 2012 12:07 am

Re: Corrupt .lyx file due to improper shutdown

Post by jewblah »

Thanks anyway, I went ahead and rebuilt the document.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Corrupt .lyx file due to improper shutdown

Post by scottkosty »

jewblah wrote:Thanks anyway, I went ahead and rebuilt the document.
I hope that means you were able to recover everything. That's good news.
jewblah
Posts: 4
Joined: Thu Nov 15, 2012 12:07 am

Corrupt .lyx file due to improper shutdown

Post by jewblah »

scottkosty wrote:
jewblah wrote:Thanks anyway, I went ahead and rebuilt the document.
I hope that means you were able to recover everything. That's good news.
Oh sorry, I meant I rewrote the document. Poor word choice. There were lots of tables, graphs, etc. so I felt like it was more than just writing.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Corrupt .lyx file due to improper shutdown

Post by scottkosty »

jewblah wrote:
scottkosty wrote:
jewblah wrote:Thanks anyway, I went ahead and rebuilt the document.
I hope that means you were able to recover everything. That's good news.
Oh sorry, I meant I rewrote the document. Poor word choice. There were lots of tables, graphs, etc. so I felt like it was more than just writing.
Ah, never mind then. It's a horrible feeling doing something that you already did. But sometimes you have to bite the bullet.
Prav
Posts: 1
Joined: Fri Sep 04, 2015 8:28 am

Re: Corrupt .lyx file due to improper shutdown

Post by Prav »

I know the post is closed. But I wanted to add my experience. I could recover my data from the corrupted .lyx by opening the file with miktex and then comparing the code with any other working lyx code(again opened in miktex).
Post Reply