Some .odt files will not open in LibreOffice Writer, but will in PDF reader [SOLVED]

Under openSUSE Leap 15 some .odt files, not all, do not fully open in LibreOffice Writer. I get a blank LibreOfice 6.1 (in one instance soffice.bin) window that I cannot close, but no file. The file can be opened by Okular. It can be read by Google Docs, and downloaded as a valid .odt, but any complex formatting or tables will be corrupted.
I have files dating back to 2014 that are affected, and some up to 2018, but only some, there are plenty that will open.
An affected file does open in Windows 10, but if saved as a new file it still won’t open in openSUSE.

PDF reader? IIUC Okular is document viewer, not specific to PDF.

In any case, it might be a LO bug, or GDocs bug (the latter is notorious for producing invalid ODF, although it internally uses LO, but also does different funny processing, often resulting in broken format). Such a problem needs a bug report and a sample attachment, not a question on Ask site.

None of these documents were created with GDocs, I have only used that in an unsuccessful attempt to recover an editable version.

ah, I must have misunderstood the GDocs bits then. However, the idea is the same: please file a bug report and attach a sample document there, to enable developers to see the problem.

Are you sure they are valid .odt files? The extension is meaningful only to make the OS launch the associated application, but contents may be anything. Have a try wit Okteta (the hexadecimal editor) to look at the beginning of the file. If the first two bytes read PK (0x50 0x4B), it is a zip file, hence highly likely an .odt or LO file. Any other bytes mean a corrupted file.

They were definitely .odt files created by me using LibreOffice.
I first noticed the problem after upgrading from openSUSE Leap 42.3, and I now suspect this left me with a corrupted profile.

With Okteta the first two bytes do read PK.
Copying to another directory does not help, but moving does.
The moved file, if moved back, does not open.
The moved file, if opened and saved back into its original spot with the same name, now opens.
Better file a bug report now.

Today I met the same problem. One of my “.odt” format files, surely with the extension “.odt”, when I clicked on it to open it, then it was opened by “Libreoffice Draw” instead of “Libreoffice Writer”.
*(&^$@# why this software Libreoffice Draw can NOT recognize the filename extension? Why the odt file was opened with a Drawing tool?

Don’t you think this is an annoying bug?

My Libreoffice is the latest v7.2 version, running on Windows 10.

If you really met the same problem you should accept the same solution as given below.

I doubt you met the same problem, but try to use save mode or renaming the profile is a first step to rule out this source of problems. If this doesn’t help: Open your own question.

If you are really interested, why the extension is not everything, try to read about mime-types. There are situations, where “do as commanded” is useful, but Office often tries to guess right - also liked by many users.

Edit:
Found out you also opened another thread

While researching to lodge a bug report, I came across the suggestion that resetting the user profile might fix the problem. I chose the less drastic version of the reset, which fixed the problem. I had also previously found that the file moved to another directory opened normally.
My thanks for the help.

Update
While that seemed to fix it, it didn’t really. By chance I found the real problem, which was that I had changed the default template, and opening old documents triggered a “do you want to update?” dialogue that was not on top, and so I didn’t know it was there unless I did an alt/tab through all windows or came on it by chance.
The solution was to go to the Special Window Settings of the dialogue and set Keep Above to Apply Initially and Yes.

The problem has re-emerged. Two .odt files, both created with LibreOffice 5.1.6.2 - one opens, the other gives a blank window called LibreOffice 6.1 that will not delete. A lock file is created, content “,andy,linux-86az.suse,19.04.2019 00:16,file:///home/andy/.config/libreoffice/4;”.
I’ll try Oketa tomorrow, it’s a bit late at night here now.