Akonadi searches for file mysql-global.conf at wrong path
ClosedPublic

Authored by ZaWertun on May 26 2020, 6:23 AM.

Details

Summary

Akonadi can't find mysql-global.conf placed at path /etc/xdg/akonadi dir.
It looks for it at /etc/xdg/akonadi/akonadi/ (see extra akonadi/ part appended).

Fix for https://bugs.kde.org/show_bug.cgi?id=422079.

Test Plan

After this patch akonadiselftest and akonadi server should look for the mysql-global.conf file at /etc/xdg/akonadi.
It could be checked with command: strace -e statx akonadiselftest 2>&1 |grep mysql-global.conf.

Diff Detail

Repository
R165 Akonadi
Lint
Lint Skipped
Unit
Unit Tests Skipped
ZaWertun created this revision.May 26 2020, 6:23 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 26 2020, 6:23 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
ZaWertun requested review of this revision.May 26 2020, 6:23 AM
ZaWertun added a comment.EditedMay 26 2020, 7:48 AM

Another approach is to remove prefix akonadi/ from all calls to the StandardDirs::locateResourceFile (second parameter):

src/widgets/selftestdialog.cpp
320:    const QString globalConfig = StandardDirs::locateResourceFile("config", QStringLiteral("akonadi/mysql-global.conf"));
335:    const QString localConfig  = StandardDirs::locateResourceFile("config", QStringLiteral("akonadi/mysql-local.conf"));

src/server/storage/dbconfigmysql.cpp
376:        const QString confFile = StandardDirs::locateResourceFile("config", QStringLiteral("akonadi/mysql-global.conf"));
anthonyfieroni added a subscriber: anthonyfieroni.

Another approach is to remove prefix akonadi/ from all calls to the StandardDirs::locateResourceFile (second parameter):

It looks right solution buildFullRelPath https://phabricator.kde.org/source/akonadi/browse/master/src/private/standarddirs.cpp$38 adds the prefix.

ZaWertun updated this revision to Diff 83155.May 26 2020, 11:14 AM

Unneeded prefix akonadi/ removed.

Just updated the commit.

Thanks for the patch from first glance it looks fine. @dvratil - fine to merge?

dvratil accepted this revision.May 27 2020, 12:33 PM

Thanks for the fix, please land it to the release/20.04 branch.

This revision is now accepted and ready to land.May 27 2020, 12:33 PM
This revision was automatically updated to reflect the committed changes.