NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.6k stars 13.08k forks source link

Kmail "Unable to obtain agent type ''." #319785

Open a3ru opened 1 month ago

a3ru commented 1 month ago

Describe the bug

When starting Kmail I get these errors:

org.kde.pim.akonadicore: Unable to obtain agent type for default resource agent configuration  "/nix/store/09r2b1rhrd6ay2zmdspkk4ysbhivls6m-kdepim-runtime-24.05.0/share/akonadi/firstrun/birthdaycalendar"
org.kde.pim.akonadicore: Unable to obtain agent type for default resource agent configuration  "/nix/store/09r2b1rhrd6ay2zmdspkk4ysbhivls6m-kdepim-runtime-24.05.0/share/akonadi/firstrun/defaultaddressbook"
org.kde.pim.akonadicore: Unable to obtain agent type for default resource agent configuration  "/nix/store/09r2b1rhrd6ay2zmdspkk4ysbhivls6m-kdepim-runtime-24.05.0/share/akonadi/firstrun/defaultcalendar"
org.kde.pim.akonadicore: Unable to obtain agent type for default resource agent configuration  "/nix/store/09r2b1rhrd6ay2zmdspkk4ysbhivls6m-kdepim-runtime-24.05.0/share/akonadi/firstrun/defaultnotebook"
Path override failed for key base::DIR_APP_DICTIONARIES and path '/nix/store/8444gfwrcwgpm50ls2c2vwrjrzfjzh1h-kmail-24.05.0/bin/qtwebengine_dictionaries'
Path override failed for key base::DIR_APP_DICTIONARIES and path '/nix/store/2pjgr8dk8z7m4rrmbiar026g3vyz7m8m-qtwebengine-6.7.1/Path override failed for key base::DIR_APP_DICTIONARIES and path '/nix/store/2pjgr8dk8z7m4rrmbiar026g3vyz7m8m-qtwebengine-6.7.1/libexec/qtwebengine_dictionaries'
libexec/qtwebengine_dictionaries'
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nUnable to obtain agent type ''."
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nUnable to obtain agent type ''."
org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nUnable to obtain agent type ''."
org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nUnable to obtain agent type ''."
org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nUnable to obtain agent type ''."
org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.akonadicore: "Unable to obtain agent type ''."
org.kde.pim.akonadicore: Failed SpecialCollectionsRequestJob::slotResult "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"
org.kde.pim.mailcommon: "The Email program encountered a fatal error and will terminate now.\nThe error was:\nUnable to obtain agent type ''."
org.kde.pim.akonadicore: Failed to request resource "" : "Cannot connect to the Akonadi service. (Unable to obtain agent type ''.)"

It seems it can't connect to akonadi.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install kmail on nixos-unstable with:
    pkgs.kdePackages.kmail
    pkgs.kdePackages.kmail-account-wizard
    pkgs.kdePackages.kmailtransport
    pkgs.kdePackages.akonadi
    pkgs.kdePackages.kdepim-addons
  2. Open Kmail

Screenshots

image

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.32, NixOS, 24.11 (Vicuña), 24.11.20240612.57d6973`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos"`
 - channels(ariel): `"nixos-23.11"`
 - nixpkgs: `/nix/store/dydg48djlykksz8cxq0xjplyxpa9pvf4-source`

Add a :+1: reaction to issues you find important.

stefan-wltr commented 1 week ago

I'm getting the same errors (with only kmail and kmail-account-wizard installed). Using GDB, I could find out that one of the

org.kde.pim.akonadicore: "Unable to obtain agent type ''."

errors originates from this line, which is reached with mDefaultResourceType equal to "akonadi_maildir_resource". This looks up "akonadi_maildir_resource" in a map, doesn't find it there, and returns the default (invalid) AgentType. (The map has 7 elements at the time.)

Don't know what that means, though.

stefan-wltr commented 1 week ago

It turns out that these Akonadi agents are just executables. akonadictl status lists the ones that you have installed. In my case, akonadi_maildir_resource was missing. It is provided by pkgs.kdePackages.kdepim-runtime. After adding it and restarting Akonadi, KMail opened without the error.

Maybe the problem is then that kdepim-runtime is not automatically installed together with kmail.

Shawn8901 commented 1 week ago

possibly you might be interested in this pr https://github.com/NixOS/nixpkgs/pull/299599