Bug 396999 - Kexi file is not recognized as being supported by Kexi
Summary: Kexi file is not recognized as being supported by Kexi
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: General (show other bugs)
Version: 3.1.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 3.2
Assignee: Jarosław Staniek
URL: https://phabricator.kde.org/D17887
Keywords:
: 402717 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-31 00:13 UTC by Jean-Paul Lambrechts
Modified: 2023-09-03 20:49 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.2.0 Beta


Attachments
kexi startup log file (1.21 MB, text/x-log)
2018-11-13 17:20 UTC, therapon
Details
12/22/18 kexi startup log (717.95 KB, text/x-log)
2018-12-15 23:06 UTC, therapon
Details
My details text (21.11 KB, image/png)
2018-12-31 10:15 UTC, Jarosław Staniek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Paul Lambrechts 2018-07-31 00:13:40 UTC
I use kexi.x86_64 on several computers with fedora LXDE/LXDM.
After upgrading two computers from fedora 27 to 28, the kexi file is not recognized anymore. To double check, I did sftp of that file to a computer still running fedora 27 and kexi opened it fine. Those computers all run the same version of kexi:
Computer running fedora 28
[jplx@jplx-linux ~]$ sudo dnf list kexi
Last metadata expiration check: 5:02:35 ago on Mon 30 Jul 2018 11:46:49 AM PDT.
Installed Packages
kexi.x86_64                         3.1.0-1.fc28                         @fedora
[jplx@jplx-linux ~]$

Computer running fedora 27
[jplx@jplx-mlnx ~]$ sudo dnf list kexi
Last metadata expiration check: 2 days, 4:28:36 ago on Sat 28 Jul 2018 12:21:32 PM PDT.
Installed Packages
kexi.x86_64                        3.1.0-1.fc27                         @updates
[jplx@jplx-mlnx ~]$ 
[jplx@jplx-linux ~]$ 
I looked through /var/log files but did not see anything significant.

The error message is:
The file /home/jplx/Documents/Temp/notes.tmp is not recognized as being supported by Kexi. 

I tried to rename the file to notes.kexi but it does not make a difference. It is not recognized anymore in fedora 28.
Comment 1 Jarosław Staniek 2018-08-14 08:50:31 UTC
Hi Jean-Paul, thanks for the report. Extra questions: 

1. Could you please send me any file? Can be compressed and attached here in the report or to me (staniek@kde.org).
2. Are you able to create new file databases?
3. Are you able to create sqlite3 databases from command line (type "sqlite3 foobar" then type "create table foo").
4. Are you able to create mysql or postgresql databases using KEXI?

If we discover that Fedora did not test sufficiently test software before releasing it's good idea to report to Fedora itself so they extend their release process. Not only aeroplanes need to be checked before they take off...
Comment 2 therapon 2018-11-13 16:39:10 UTC
Kexi 3.1.0-2.1 on openSuse Tumbleweed gives the same error when trying to open a .kexi database from the command line (kexi-3.1 dbname.kexi for example) or clicking the file in dolphin. The database opens and functions normally if kexi is started first.
Comment 3 Jarosław Staniek 2018-11-13 17:00:57 UTC
Thanks therapon. If this is not a problem, may I ask for a log file created this way?

strace kexi-3.1 dbname.kexi > startup.log 2>&1
Comment 4 Jarosław Staniek 2018-11-13 17:02:09 UTC
@Jean the same command from can help us too.
Comment 5 therapon 2018-11-13 17:20:05 UTC
Created attachment 116288 [details]
kexi startup log file

A little further information: If kexi is open, trying to open a database using the file dialog gives the same error. Using the "shortcut" in the recently used list on the Welcome page opens the file with no problem.
Comment 6 Jarosław Staniek 2018-12-15 22:51:05 UTC
Hi @therapon. Thanks for your log.

1. It helped me to realize 3.1.0 has "kexi" binary while it should be "kexi-3.1". Next version will have it fixed (3.2).

2. Also from the log /usr/share/mime/application/vnd.sqlite3.xml is tries  to find type of the .kexi file but I am unsure it matters.

3. If possible could you please run this command which is close equivalent of clicking on the kexi document file:

strace kde-open5 dbname.kexi > startup.log 2>&1 ?

- to see if the kexi document is opened. If not, the startup.log can be interesting to me. 

4. I am also interested if changing line <binary>kexi</binary> to line <binary>kexi-3.1</binary> helps in /usr/share/metainfo/org.kde.kexi-3.1.appdata.xml.

5. Possible manual workaround for you could be that e.g. in Dolphin file manager you right click kexi document, click Properties, click File Type Options, then click Add, and pick kexi-3.1 binary. This can change file association.
Comment 7 therapon 2018-12-15 23:06:58 UTC
Created attachment 116945 [details]
12/22/18 kexi startup log

Result of running:

strace kde-open5 dbname.kexi > startup.log 2>&1
Comment 8 therapon 2018-12-15 23:14:03 UTC
Ran the command in #3.

strace kde-open5 dbname.kexi > startup.log 2>&1

The kexi document is not opened. The startup.log is attached. 

Changed the line in #4

line <binary>kexi</binary> to line <binary>kexi-3.1</binary> in /usr/share/metainfo/org.kde.kexi-3.1.appdata.xml

It made no difference.

I checked the association per #5, it was already set to kexi-3.1. And, running kexi-3.1 /database/dbname.kexi in a script does not open the file.

Each of these scenarios gives the same error message.
Comment 9 Jarosław Staniek 2018-12-15 23:51:28 UTC
Thanks for the careful testing. The startup.log unfortunately does not suggest me anything for now...
Comment 10 therapon 2018-12-16 00:34:29 UTC
Let me know if there is something else I can try that would perhaps be of help.
Comment 11 Jarosław Staniek 2018-12-30 22:51:18 UTC
Changed the summary to more general as there are other users reporting the same. Still investigating.
Comment 12 Jarosław Staniek 2018-12-30 22:51:52 UTC
*** Bug 402717 has been marked as a duplicate of this bug. ***
Comment 13 Jarosław Staniek 2018-12-31 10:03:50 UTC
Bug #402717 adds evidence from Archlinux packaged KEXI...
Comment 14 Jarosław Staniek 2018-12-31 10:04:48 UTC
I think we will have 3.2 Beta so users will be able to test against the bug.
Comment 15 Jarosław Staniek 2018-12-31 10:15:26 UTC
Created attachment 117203 [details]
My details text

"Could not find plugin supporting for this file type. 
Detected MIME type is “text/plain” (plain text document)."
Comment 16 Jarosław Staniek 2018-12-31 10:17:55 UTC
Attachment https://bugs.kde.org/attachment.cgi?id=117203 shows what is displayed when I picked obviously unsupported .txt file. @therapon could you please show your "Detected MIME type is..." description for a .kexi file?

Then we might be able to add additional detecting code.
Comment 17 therapon 2018-12-31 13:03:23 UTC
When I try to open a .kexi file, I get the error message but no details. Just the single line "The file... not recognized..." Pushing the details button gives no further information.

Result from "file -i --mime-type dbname.kexi" is:

dbname.kexi: application/x-sqlite3; charset=binary
Comment 18 Jarosław Staniek 2018-12-31 13:34:30 UTC
> Pushing the details button gives no further information.

Thanks. Could you please try resizing the dialog? We've got details added there in 2016...
Comment 19 therapon 2018-12-31 13:38:52 UTC
Got it.
Details are:

Could not find plugin supporting for this file type. 
Detected MIME type is “application/vnd.sqlite3” (SQLite3 database).

Whine: would be nice if the dialog automatically resized! I know, that's a different issue :-)
Comment 20 Jarosław Staniek 2018-12-31 15:09:24 UTC
Thanks @therapon, OK so we know where to proceed - adding the application/vnd.sqlite3 to the supported mimes list.

I wonder if /usr/share/mime/application/x-sqlite3.xml and 
/usr/share/mime/application/x-kexiproject-sqlite3.xml are present on your OS.

The latter is a subclass of x-sqlite3. 

On my OS the shared-mime-info packages both these files are present and not the  /usr/share/mime/application/vnd.sqlite3.xml.

I've found this one:

We can add support for application/vnd.sqlite3 and application/x-vnd.kde.kexi to be sure everything is catch while detecting .kexi file types.
The change is apparently needed after this commit:

https://cgit.freedesktop.org/xdg/shared-mime-info/commit/freedesktop.org.xml.in?id=36a88b01f6ae90da35a2f6a072db159c84cea768

From https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in it's apparent that .kexi mime type still inherits from application/x-sqlite3 which is now only an alias:

<mime-type type="application/x-kexiproject-sqlite3">
    <_comment>Kexi database file-based project</_comment>
    <sub-class-of type="application/x-sqlite3"/>
    <glob pattern="*.kexi"/>
    <alias type="application/x-vnd.kde.kexi"/>
Comment 21 therapon 2018-12-31 15:40:19 UTC
/usr/share/mime/application/x-sqlite2.xml is present, created automatically by update-mime-database. /usr/share/mime/application/x-sqlite3.xml is not present.

Both /usr/share/mime/application/x-kexiproject-sqlite2.xml and /usr/share/mime/application/x-kexiproject-sqlite3.xml are present.

/usr/share/mime/application/vnd.sqlite3.xml is also present.

/usr/share/mime/application/x-vnd.kde.kexi.xml is not present.
Comment 22 Jarosław Staniek 2018-12-31 15:55:25 UTC
Git commit 702e637a23963d7256fb83335265d10280504b7e by Jaroslaw Staniek.
Committed on 31/12/2018 at 15:54.
Pushed by staniek into branch '396999-fix-sqlite-mime'.

Fix detection of .kexi file types after recent change of mime database on Linux for SQLite type (2018-06-17)

Details: Add application/vnd.sqlite3 and application/x-vnd.kde.kexi to be sure everything is catch while detecting .kexi file types.
The change is apparently needed after this commit:

https://cgit.freedesktop.org/xdg/shared-mime-info/commit/freedesktop.org.xml.in?id=36a88b01f6ae90da35a2f6a072db159c84cea768

>From https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in:
it's apparent that .kexi mime type still inherits from application/x-sqlite3 which is now only an alias:


<mime-type type="application/x-kexiproject-sqlite3">
    <_comment>Kexi database file-based project</_comment>
    <sub-class-of type="application/x-sqlite3"/>
    <glob pattern="*.kexi"/>
    <alias type="application/x-vnd.kde.kexi"/>

Also update the driver's autotest.
FIXED-IN:3.2.0

Big thanks to therapon@netzero.com for extensive testing!

CCMAIL:therapon@netzero.com
CCMAIL:ville.skytta@iki.fi
CCMAIL:hadess@hadess.net
CCMAIL:teuf@gnome.org

M  +31   -9    autotests/KDbTestUtils.cpp
M  +6    -1    autotests/KDbTestUtils.h
M  +3    -1    src/drivers/sqlite/kdb_sqlitedriver.json

https://commits.kde.org/kdb/702e637a23963d7256fb83335265d10280504b7e
Comment 23 Jarosław Staniek 2018-12-31 16:04:26 UTC
Waiting for patch approval.
Comment 24 Jarosław Staniek 2019-01-04 14:48:41 UTC
*** Bug 402717 has been marked as a duplicate of this bug. ***
Comment 25 Jarosław Staniek 2019-01-15 09:19:27 UTC
Git commit 28aa00b6e4461d36e6fb6f057cc28b492a397118 by Jaroslaw Staniek.
Committed on 15/01/2019 at 09:14.
Pushed by staniek into branch '3.2'.

Fix detection of .kexi file types after recent change of mime database on Linux for SQLite type (2018-06-17)

Details: Add application/vnd.sqlite3 and application/x-vnd.kde.kexi to be sure everything is catch while detecting .kexi file types.
The change is apparently needed after this commit:

https://cgit.freedesktop.org/xdg/shared-mime-info/commit/freedesktop.org.xml.in?id=36a88b01f6ae90da35a2f6a072db159c84cea768

>From https://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in:
it's apparent that .kexi mime type still inherits from application/x-sqlite3 which is now only an alias:


<mime-type type="application/x-kexiproject-sqlite3">
    <_comment>Kexi database file-based project</_comment>
    <sub-class-of type="application/x-sqlite3"/>
    <glob pattern="*.kexi"/>
    <alias type="application/x-vnd.kde.kexi"/>

Also update the driver's autotest.
FIXED-IN:3.2.0

Big thanks to therapon@netzero.com for extensive testing!

CCMAIL:therapon@netzero.com
CCMAIL:ville.skytta@iki.fi
CCMAIL:hadess@hadess.net
CCMAIL:teuf@gnome.org

M  +31   -9    autotests/KDbTestUtils.cpp
M  +6    -1    autotests/KDbTestUtils.h
M  +3    -1    src/drivers/sqlite/kdb_sqlitedriver.json

https://commits.kde.org/kdb/28aa00b6e4461d36e6fb6f057cc28b492a397118
Comment 26 Jarosław Staniek 2019-01-30 11:24:50 UTC
Workaround to make new .kexi files work in Welcome screen: 

1. In any plain text editor create a new .kexis file in the folder
$HOME/.local5/share/kexi/recent_projects/ 
(the kexis files are the recent entries)

Example content:

[Database1]
engine=sqlite
lastOpened=2019-01-10T22:39:19
name=$HOME/Documents/db.kexi
type=database

[File Information]
version=3

2. Change the "name=" line in the copy to actual path of the new file you want to open. You can change the lastOpened= line to more actual date is you want your entry to appear immediately on top of the Welcome screen.

3. Restart KEXI. The entry should appear and should work if it was edited properly.


OPTIONAL more trivial workaround:
1. Keep your original kexi file in a backup folder
2. Create a new empty kexi file project using KEXI, pick location and name that you want as destination
3. Close KEXI
4. Copy or move your backed up file to the file location and name created in step 2, thus replacing the empty file
5. Open KEXI and click the name in the Welcome screen. 
You backed up (and restored) file should open now.