Document preview not working (partially) - "unknown file encoding"

Hello there!

I have a Seafile Pro installation of v9.0.16 and therefore office file preview configured the “docker way”, using Ubuntu LTS.
Unfortunately it only works partially, and I am unable to debug (yet) what the issue is.

→ For some Word (doc/docx) files the preview just works fine

→ Some Word files produce an “unknown file encoding” error, when clicking on the filename to preview it.
(see picture). Even for a simple “Hello world” freshly created and saved into DOCX format, so nothing fancy here.
grafik

I have the impression that it does not even try to convert, in case of files where the error is produced.
Thats because if I e.g. stop only the “preview-container” and click on a file where preview normally works, an “Internal Server Error” is produced - as expected!
Clicking on a preview-does-not-work-file, the same “unknown file encoding” error is produced anyway!

There is nothing in the normal log files that leads me into any direction.

Just to be really sure its not the conversion itself, I did some poking around with “libreoffice --invisible --convert-to”, with preview-working and no-preview-working files → All worked out fine in that matter.

Many thanks in advance,
Sebastian

Update: If I rename a not-working-for-preview .DOCX file to just .DOC, the preview works. WTF?

Is there a configuration option in which one can define WHICH file extensions to put through libreoffice? My before mentioned anser to myself further suggests that it does not even try to put it through libreoffice.

ONLYOFFICE_FILE_EXTENSION in seahub_settings.py ?

Not using onlyoffice here. Tried anyway: Nope.
Method used is the one for 9.x mentioned here: Office Documents Preview - Seafile Admin Manual

Problem solved !

For future “me”, and others:

You may have added ‘docx’, ‘xlsx’, etc. to the TEXT_PREVIEW_EXT configuration item.

You can check your seahub_settings.py configuration file:

If ENABLE_SETTINGS_VIA_WEB is True, you need to check whether text file extensions contains ‘docx’, ‘xlsx’, etc. in the Settings TAB of the administrator interface;

If ENABLE_SETTINGS_VIA_WEB is False , you need to check the TEXT_PREVIEW_EXT configuration item in seahub_settings.py, whether it contains ‘docx’, ‘xlsx’, etc.