Bug 352517 - kbibtex fails to load bibtex files under frameworks 5
Summary: kbibtex fails to load bibtex files under frameworks 5
Status: RESOLVED NOT A BUG
Alias: None
Product: KBibTeX
Classification: Applications
Component: Loading/saving files (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR grave
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-10 12:35 UTC by Gandalf Lechner
Modified: 2017-10-07 20:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Define qCInfo through a #define for Qt 5.4 or earlier (362 bytes, patch)
2015-09-27 20:21 UTC, Thomas Fischer
Details
Printing env variables including QT_PLUGIN_PATH (2.48 KB, patch)
2017-09-23 18:08 UTC, Thomas Fischer
Details
Printing env variables including QT_PLUGIN_PATH (2) (2.22 KB, patch)
2017-09-23 18:18 UTC, Thomas Fischer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gandalf Lechner 2015-09-10 12:35:02 UTC
when trying to load a bibtex file using a fresh checkout of the master branch, I get a window saying "No part available for the file ...", and the file is not loaded.

Reproducible: Always
Comment 1 Thomas Fischer 2015-09-17 06:40:42 UTC
Have you followed the instruction on https://userbase.kde.org/KBibTeX/Development?
You may need to set some environment variables unless you install KBibTeX in /usr (or where KF5 is installed in your case). Also, "kbuildsycoca5" needs to be run.
Comment 2 Thomas Fischer 2015-09-17 17:38:04 UTC
I made some tests myself and tried to remove some obstacles.
Please locate file 'mimeapps.list' somewhere under ~/.local/share (or ~/.kde/share) and remove any lines that make a reference to KBibTeX (should be six lines in total).
Fetch and merge the latest revision from the 'master' branch, compile and install. Does locating the KPart work now?
Comment 3 Gandalf Lechner 2015-09-20 13:37:27 UTC
I removed the mimeapps.list file, but that did not help - I still get the message "No part available for file of mime type 'text/x-bibtex'." when trying to create a new bibtex file, and similar when trying to open an existing file.

The commands I used for installation are

cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=release
make
sudo make install
kbuildsycoca5
Comment 4 Thomas Fischer 2015-09-26 20:36:46 UTC
> cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=release
> make
> sudo make install
> kbuildsycoca5

Hm, can you please tell me where inside /usr the files kbibtexpart.desktop and kbibtexpart.so are located?
Comment 5 Gandalf Lechner 2015-09-26 20:43:57 UTC
locate returns

/usr/lib/kde4/kbibtexpart.so
/usr/lib/x86_64-linux-gnu/plugins/kbibtexpart.so

/usr/share/kde4/services/kbibtexpart.desktop
/usr/share/kservices5/kbibtexpart.desktop
Comment 6 Thomas Fischer 2015-09-26 21:01:29 UTC
(In reply to Gandalf Lechner from comment #5)
> locate returns
> 
> /usr/lib/kde4/kbibtexpart.so
> /usr/lib/x86_64-linux-gnu/plugins/kbibtexpart.so
> 
> /usr/share/kde4/services/kbibtexpart.desktop
> /usr/share/kservices5/kbibtexpart.desktop

Can you please remove all files in /usr that relate to KBibTeX for KDE4? This includes /usr/lib/kde4/kbibtexpart.so and /usr/share/kde4/services/kbibtexpart.desktop but other files as well. If you have the build directory of KBibTeX for KDE 4 available, you can run "sudo make uninstall" there, which should do the trick.

Next, the most recent commits of 'master' should print out additional debugging information in case the part is not found. Please fetch, compile and install this code, and then let KBibTeX run in a terminal. What information is printed right before you get the message box about the missing part?

BTW, which Linux distribution are you using?
Comment 7 Gandalf Lechner 2015-09-26 21:09:32 UTC
Ok, I now removed the kde4 version which I had installed with apt. At least the two kde4 files mentioned above are gone, I hope it is clean now.

I am using kubuntu 15.10 beta2 (the problem discussed here was also present with 15.04).

After a fresh checkout, compilation fails with

...
 84%] Built target kbibtexgui
[ 84%] Automatic moc for target kbibtex
[ 84%] Built target kbibtex_automoc
[ 84%] Determine Git revision
-- Git revision is dad9f16 (master)
[ 84%] Built target GITrevisionProgram
[ 84%] Building CXX object src/program/CMakeFiles/kbibtex.dir/program.cpp.o
/home/gandalf/down/git/kbibtex/src/program/program.cpp: In function ‘int main(int, char**)’:
/home/gandalf/down/git/kbibtex/src/program/program.cpp:92:35: error: ‘qCInfo’ was not declared in this scope
         qCInfo(LOG_KBIBTEX_PROGRAM) << "Located KPart service:" << service->library() << "with description" << service->comment();
                                   ^
src/program/CMakeFiles/kbibtex.dir/build.make:54: recipe for target 'src/program/CMakeFiles/kbibtex.dir/program.cpp.o' failed
Comment 8 Thomas Fischer 2015-09-27 20:21:31 UTC
Created attachment 94750 [details]
Define qCInfo through a #define for Qt 5.4 or earlier
Comment 9 Thomas Fischer 2015-09-27 20:23:23 UTC
> /home/gandalf/down/git/kbibtex/src/program/program.cpp:92:35: error:
> ‘qCInfo’ was not declared in this scope
>          qCInfo(LOG_KBIBTEX_PROGRAM) << "Located KPart service:" <<
> service->library() << "with description" << service->comment();

Most likely due to an Qt version before 5.5; only version 5.5 introduced qCInfo. Please test and confirm if the code compiles if you apply the patch in attachment 94750 [details].
Comment 10 Gandalf Lechner 2015-09-27 20:42:01 UTC
the patch made it compile nicely again :-)

now to the output in the terminal.

after starting kbibtex:

kbibtex.program: Starting KBibTeX version Git revision dad9f16 (master)
QCommandLineParser: option not defined: "author"
QCommandLineParser: option not defined: "license"
kbibtex.data: Creating File instance 100000
kbibtex.program: No Okular part for PDF or PostScript document preview available.
kbibtex.program: HTML KPart is available, using it instead of WebEngine or WebKit (neither available) for HTML/Web preview.
kbibtex.program: Located KPart service: "kbibtexpart" with description "KParts-Komponente zum Betrachten und Editieren von Bibliographiedateien"
KSambaShare: Could not find smb.conf!


and after clicking on "open" for a bibtex file:

No file found for ".xml" , even though the file appeared in a directory listing.
Either it was just removed, or the directory doesn't have executable permission...
("/home/gandalf/.local/share/mime", "/usr/share/mime")
kbibtex.program: Using service "BibTeX-Betrachter und -Editor" ( "KParts-Komponente zum Betrachten und Editieren von Bibliographiedateien" ) for mime type "text/x-bibtex"
Error loading plugin "kbibtexpart" "Die dynamische Bibliothek konnte nicht gefunden werden." 
Plugin search paths are ("/usr/lib/x86_64-linux-gnu/qt5/plugins", "/usr/bin") 
The environment variable QT_PLUGIN_PATH might be not correctly set
kbibtex.program: Could not instanciate read-write part for service "BibTeX-Betrachter und -Editor" ( "Die dynamische Bibliothek konnte nicht gefunden werden." )
Error loading plugin "kbibtexpart" "Die dynamische Bibliothek konnte nicht gefunden werden." 
Plugin search paths are ("/usr/lib/x86_64-linux-gnu/qt5/plugins", "/usr/bin") 
The environment variable QT_PLUGIN_PATH might be not correctly set
kbibtex.program: Could not instanciate part for service "BibTeX-Betrachter und -Editor" (mimeType= "text/x-bibtex" , error msg= "Die dynamische Bibliothek konnte nicht gefunden werden." )
Comment 11 Thomas Fischer 2015-10-11 20:12:26 UTC
(In reply to Gandalf Lechner from comment #10)
> the patch made it compile nicely again :-)
Ok, I added it to Git master as of revision 417e748a464d20.

> The environment variable QT_PLUGIN_PATH might be not correctly set
I was able to reproduce your problem and could solve it by setting the environment variable QT_PLUGIN_PATH include the path of where kbibtexpart.so is install to (in my case "/tmp/usr/lib64/plugins/"). AFAIK you can include multiple paths in this variable, separated by single ':'.
Comment 12 Gandalf Lechner 2015-10-13 07:36:34 UTC
yeeha, it works again! 

Many thanks.
Comment 13 tb 2017-09-12 18:36:06 UTC
I am also getting this error ("No part available for file of mime type 'text/x-bibtex'.") even though QT_PLUGINS_PATH is set to the directory that contains my kbibtexpart.so.

I run Arch Linux and use the Git master branch.
Comment 14 Thomas Fischer 2017-09-23 18:08:27 UTC
Created attachment 107972 [details]
Printing env variables including QT_PLUGIN_PATH

tb: please apply and test this patch. I think you can modify the PKGBUILD to apply the patch for you when building a package for KBibTeX.
Then, launch KBibTeX in a terminal and post a copy of the output you get from start until you get the "No part available" error message.
Comment 15 Thomas Fischer 2017-09-23 18:18:37 UTC
Created attachment 107973 [details]
Printing env variables including QT_PLUGIN_PATH (2)

Fixing copy&paste error from previous patch
Comment 16 tb 2017-09-24 08:23:26 UTC
(In reply to Thomas Fischer from comment #15)
> Created attachment 107973 [details]
> Printing env variables including QT_PLUGIN_PATH (2)
> 
> Fixing copy&paste error from previous patch

One of the recent changes to the code must have fixed this. It works now. Lovely, thanks!
Comment 17 Thomas Fischer 2017-10-07 20:46:45 UTC
Git commit 3b47c81b26d4cdbb074ecdd0065c817d7900bad9 by Thomas Fischer.
Committed on 07/10/2017 at 20:44.
Pushed by thomasfischer into branch 'master'.

Printing environment variables if service instanciation fails

In order to trace problems with service/part instanciation,
various relevant environment variables are printed when
instanciation fails.

M  +11   -1    src/program/openfileinfo.cpp

https://commits.kde.org/kbibtex/3b47c81b26d4cdbb074ecdd0065c817d7900bad9