LO won't open - claims Default.ott is corrupt

LO 1:4.2-8-0ubuntu on Xubuntu 14.04, up to date

I have used LO (and formerly OO) on Ubuntu for ten years, and there has
rarely been a problem.

Suddenly LO Writer would not open either of two files that I had been
working on. The error message popup said:

  The file 'filename.odt' is corrupt and therefore cannot be
  opened.
  LibreOffice can try to repair the file.
  The corruption could be the result of document manipulation or
  of structural document damage due to data transmission.
  We recommend that you do not trust the content of the repaired
  document.
  Execution of macros is disabled for this document.
  Should LibreOffice repair the file?

Clicking on YES got the popup:

  The file 'filename.odt' could not be repaired and therefore
  cannot be opened.

This popup had only an OK button, and clicking on it got another popup:

  General error.

The files were stored on a hard disk that was at the end of its
warranty and I was considering replacing it, so there is a possibility
that the files really were corrupt. But the disk had 4TB of other data
on it and none of it had appeared corrupted (yet), so I must
conclude that corruption is a possibility, but not necessarily true.

At this point I copied the files from the suspect disk to a different
drive (mSATA), and then tried to open them from there. But at this
point Writer would not open at all. Writer and everything else is on
the mSATA drive; the suspect drive is an external USB drive that is
used strictly for data.

On Thu, 30 Mar 2017 23:05:44 -0700
John Jason Jordan <johnxj@gmx.com> dijo:

OK, I didn't go to bed yet and tried a couple more things.

I have a second computer with the same OS, the same LO, and most of the
same fonts and configs on it. I placed copies of the two 'corrupt'
files on a USB stick and moved it to the other computer, then
double-clicked on each. They both opened without a problem in LO.
Conclusion: There is nothing at all corrupt about the files.

Then I copied the Default.ott file from this computer and moved it to
the config folder on the computer with the problem. (I had already
renamed its Default.ott file by appending -old to it.) Then I launched
Writer and got the same error message that Default.ott was corrupt.

Note that if there is no Default.ott file Writer complains that the
file is missing, but opens normally anyway. If there really is a
Default.ott file (and it is known good), Writer says the Default.ott
file is corrupt, and if you ask it to repair it, it says it cannot be
repaired.

On the problem computer I copied and pasted the 'corrupt' document from
Abiword into a new Writer document, then saved it as a new .odt file.
However, the .odt file was -0- bytes.

I noticed a lot of problems opening files because Writer says the file
is in use (even when it is not in use). After a bit of experimenting I
discovered that LO is not deleting the lock files when a document is
closed.

As I go to bed I am thinking of nuking LO on the problem computer and
installing the version from LO instead of the version from the repos.
But I have a lot of add-ons installed (Zotero, etc.) plus a lot of
optional LO utilities. Is there a guide somewhere for how to nuke all
of it and then put it all back the way it was?

On Fri, 31 Mar 2017 00:11:10 -0700
John Jason Jordan <johnxj@gmx.com> dijo:

On Thu, 30 Mar 2017 23:05:44 -0700
John Jason Jordan <johnxj@gmx.com> dijo:

OK, I didn't go to bed yet and tried a couple more things.

One more thing, and then I'm really going to bed.

With Writer open (ignoring the missing Default.ott file warning on
opening it), I opened the .abw Abiword file and then went to save it as
a normal .odt file. This produced the error message:

  "Error saving the document <filename>: Write Error.
  Error in writing sub-document content.xml.

I hope by tomorrow morning this will all become clear and a solution
will be at hand. :slight_smile:

Before nuking everything, have you tried renaming the entire user profile. It should be a folder called "4". Rename it "4-old". Then restart LO. It will create a new user profile folder. You'll lose any custom settings, but you'll at least know if that's your problem.

Virgil

Hi John:

  Why not open the document in Abiword and select all document, then copy
(to clipboard), and open new document on Libre Office and copy there
all ?

I hope this help,

Hi :slight_smile:
Renaming the user-profile will remove all the add-ons but it's probably a
good idea anyway.

Copying the default.ott from the working computer was brilliant imo, as was
trying to rename the previous one to see what happened. I wonder if
renaming the whole folder that default.ott is in might make LO regenerate
the whole of that sub-folder?

Some sort of reinstall might dislodge something and fix it but generally
reinstalling tends to keep the user-profile (incl Extensions/add-ons)
intact so it might not do anything useful for this.
So unless Brian or Regina or someone like that weighs in then going for
Virgil's idea is likely to be the best 'first' step. You can always rename
the user-profile (or chunks of it) back.

Good luck and regards from
Tom :slight_smile:

PS sleep often magically gives inspiration, much like rebooting a Windows
machine.

On Fri, 31 Mar 2017 14:21:08 +0000
Virgil Arrington <cuyfalls@hotmail.com> dijo:

Before nuking everything, have you tried renaming the entire user
profile. It should be a folder called "4". Rename it "4-old". Then
restart LO. It will create a new user profile folder. You'll lose any
custom settings, but you'll at least know if that's your problem.

That was one of the first things that I did, but I forgot to mention
it in my posts.

Yesterday I renamed the whole .config/libreoffice folder
to .config/libreoffice-old. I did this partly because there was also a
'3' as well as the '4,' and I wanted to be sure that I got everything.
Having renamed it I launched Writer, expecting it to create a new
config file, but instead I got this error message:

  Error loading BASIC of document
  file:///home/jjj/.config/libreoffice/4/user/basic/Standard/script.xlb/:
  General Error. General input/output error.

And Writer would not open. Today, having renamed the
.config/libreoffice folder again I find that Writer and all the other
components now give me the error twice, with only an OK button to click
on, but when I click on the button in both popups the programs open
normally, i.e., without my personalizations and add-ons like Zotero,
etc. And I note that LO did create a new '4' folder as expected.

However, all is not well. When I try to open any Writer document
created in the past I still get the 'corrupt' document error:

  The file '<filename>.odt' is corrupt and therefore cannot be
  opened. LibreOffice can try to repair the file.
  The corruption could be the result of document manipulation or
  of structural document damage due to data transmission.
  We recommend that you do not trust the content of the repaired
  document. Execution of macros is disabled for this document.
  Should LibreOffice repair the file?

If I click on Yes it just says it was unable to repair the file, and
then gives me a General Error popup.

But note that last night I discovered that the documents are not
corrupted at all, as they open flawlessly with no error messages in LO
on my other computer. And the LO on the other computer is exactly the
same version - 4.2.8.2, Build ID: 420m0(Build:2), from the Ubuntu 14.04
repositories, and it has the same add-ons and customizations. In fact,
when I built the other computer I installed Xubuntu 14.04 on it, which
includes LO, but before launching it I replaced its config file with
the config file from the problem computer. I did this as a simple and
quick way to customize it the same way.

Also recall that yesterday I reinstalled everything with 'libreoffice'
that was installed, but it made no difference.

On Fri, 31 Mar 2017 17:17:30 +0100
Tom Davies <tomcecf@gmail.com> dijo:

Renaming the user-profile will remove all the add-ons but it's
probably a good idea anyway.
Copying the default.ott from the working computer was brilliant imo,
as was trying to rename the previous one to see what happened. I
wonder if renaming the whole folder that default.ott is in might make
LO regenerate the whole of that sub-folder?
Some sort of reinstall might dislodge something and fix it but
generally reinstalling tends to keep the user-profile (incl
Extensions/add-ons) intact so it might not do anything useful for this.
So unless Brian or Regina or someone like that weighs in then going for
Virgil's idea is likely to be the best 'first' step. You can always
rename the user-profile (or chunks of it) back.
Good luck and regards from Tom :slight_smile:

Thanks to Tom and everyone else who offered suggestions. I finally bit
the bullet and restarted the computer (I hate that because I have so
many things going on). Afterwards the problem was solved except for the
Default.ott.old file (my renaming). Writer happily opened the 'corrupt'
documents and, after I renamed Default.ott.old back to Default.ott it
opens without bitching about the missing file.

All is right in my world again. And as if it was a sign from the
computer gods, as soon as the problem was resolved the morning clouds
parted and the sun came out. Now I'm going for a walk to celebrate my
victory over evil bugs.

I do wish I knew what happened to cause this. It would be good to let
the devs know, but alas, this will probably remain a mystery.

I had the same error on the last 3.x.x version and once on an early 4.x.x version.

I know that renaming the user profile [Ubuntu 64-bit 12.xx and 14.xx] back then was the only way it removed the error[s]. I still rename the profile when I get errors that I cannot fix. Latest was on Ubuntu MATE 16.04 with 5.2.3 or was it 5.2.4.

Remember, if you reinstall LO, you still will have the same profile, unless you rename it.

Thanks Virgil. People need to be reminded about this simple fix.

For John. . .
I hope you have a backup for your 4TB drive that is almost out of warranty. I have had three internal 2TB drives go bad since 2010. I keep them backed up with USB drives. My desktop has three 2TB internal and three external 2TB USB backup drives. For whatever reason, I do not "trust" 3TB, 4TB or even the new-ish 6TB and 8TB drives - even though a 4TB drive costs not much more than a 2TB one.

Hi :slight_smile:
Congrats !! :))

Really good to hear you caught a few rays too. Kubuntu defaults (i think)
to re-open everything on reboot and somehow i ended up with that happening
in Ubuntu too - probably because i didn't want it to (good ol'Murphy). I'm
not sure if it's a simple setting somewhere but i found there were a lot of
advantages to it.

Rebooting other distros has helped me too.
Congrats, good luck and regards from
Tom :slight_smile:

Phase of the moon? SEU (Single Event Upset) from Cosmic rays? Once in a long while, I must restart my Slackware Linux machine when it doesn't work right after booting. (I shut mine down every night.) So, it does happen with Linux, but not very often. I would say about once or twice a year for me. I chalk it up to a SEU from a Cosmic ray hitting a vital memory cell or two at this 4400-foot altitude.
Glad you solved your problem.
Girvin Herr

Rebooting!!! Of course. I do it so often, that it never occurred to me to think of it as a solution. I'm currently running Mint 18 on my Sony laptop and it often gives me strange behavior when it wakes up from sleep mode so I reboot about every other day. It's just my new normal.

Virgil