Bug 159775 - We cannot use Extension update
Summary: We cannot use Extension update
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-19 12:32 UTC by prrvchr
Modified: 2024-03-04 13:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
SQLiteOOo extension (970.69 KB, application/vnd.openofficeorg.extension)
2024-02-19 12:37 UTC, prrvchr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description prrvchr 2024-02-19 12:32:36 UTC
Description:
If you try to update an extension in the LibreOffice extension manager, the update is detected and then downloaded but is not installed with the following message:

Error while installing extension jdbcDriverOOo. The error message is: Cannot detect media-type: file:///tmp/aEZpfj_/J67d0J_/0188aee2-fbbd-4f36-9701-93e242fda00a at /home/prrvchr/github/libreoffice/desktop/source/deployment/registry/dp_registry.cxx:479
The extension will not be installed.


Steps to Reproduce:
1. Install the SQLiteOOo v 1.1.2 extension which is provided as an attachment (it is not necessary to install Java and jdbcDriverOOo for this test)

2. Go to: Tools -> Extensions manager... -> Check for Updates -> Install

3. After downloading the extension you see error message: Cannot detect media-type - The extension will not be installed.

Actual Results:
The extension will not be installed.

Expected Results:
The extension will be installed.


Reproducible: Always


User Profile Reset: No

Additional Info:
You can try by installing the extension provided in the attachment and try to update it. This should reproduce the error message.
Comment 1 prrvchr 2024-02-19 12:37:21 UTC
Created attachment 192633 [details]
SQLiteOOo extension
Comment 2 m_a_riosv 2024-02-19 16:36:47 UTC
Same error on Win11
Version: 24.2.1.1 (X86_64) / LibreOffice Community
Build ID: 359ef544e625d2ffbfced462ab37bd593ca85fa7
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded

Error while installing extension SQLiteOOo. The error message is: Cannot detect media-type: file:///C:/Users/xxxxx/AppData/Local/Temp/FD32.tmp_/FD42.tmp_/6ed0cacb-0869-4d69-85ad-e5770aa867f1 at C:/cygwin64/home/buildslave/source/libo-core/desktop/source/deployment/registry/dp_registry.cxx:477
The extension will not be installed.

But I'm not sure if it is a LO bug or an extension bug.
Comment 3 prrvchr 2024-02-19 17:56:36 UTC
the problem seems to come from the line: https://github.com/LibreOffice/core/blob/ca935d5a016f5527422058f23c1bf3cb2917fb0f/desktop/source/deployment/registry/dp_registry.cxx#L479

I don't really understand how the media type of the file is retrieved but apparently it is copied into a temporary directory under a name without extension (ie: 0188aee2-fbbd-4f36-9701-93e242fda00a as can be seen in my error message)
Comment 4 m_a_riosv 2024-02-20 20:30:55 UTC
Maybe the error is in the extension.
Report to the authors.
Comment 5 prrvchr 2024-02-25 18:03:42 UTC
@m_a_riosv yes, I am the author... that's why I opened an issue...
Comment 6 prrvchr 2024-02-25 18:21:21 UTC
Well if I look at the code that I referenced above, it appears that the media type is retrieved by the extension of the file downloaded in the temp directory. But if we look at the path of the temporary file in the error message then we see that there is no extension on the file name...

Can someone please confirm, in C I'm not very good...
Comment 7 prrvchr 2024-03-04 13:15:45 UTC
Would it be possible that when downloading the extension update by LibreOffice the name of the extension file is preserved?

I suspect that the fact that LibreOffice renames the extension file with a random name and without .oxt extension is the problem.
In addition, this poses the problem that the extension is installed in a directory which has the same name as the downloaded file which currently is a random name.