NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.34k stars 13.58k forks source link

Network manager on KDE: can't configure network #56410

Closed tobiasBora closed 5 years ago

tobiasBora commented 5 years ago

Issue description

After installing Network manager on KDE, I cannot configure the network/add vpn/...: nothing happens when I click on the button "Configure network".

Steps to reproduce

Install KDE plasma and network manager:

services.xserver.desktopManager.plasma5.enable = true;
networking.hostName = "myhostname"; # Define your hostname.
networking.hostId = "abcdef01";
# Enable network manager
networking.networkmanager.enable = true;
users.extraUsers.myuser.extraGroups = ["wheel" "networkmanager"];

and install it:

sudo nix-channel --update && sudo nixos-rebuild switch

Finally, reboot, check that your user belongs to the networkmanager group:

$ groups
users wheel networkmanager

and click on the network manager icon in the trailbar > button "configure the network" (translated). Nothing happens:

screenshot_20190226_132122

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the results.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.102, NixOS, 19.03pre170287.19eedaf867d (Koi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.2`
 - channels(myuser): `""`
 - channels(root): `"nixos-19.03pre170287.19eedaf867d"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
jtojnar commented 5 years ago

Is there anything in the journal?

tobiasBora commented 5 years ago

So basically, both NetworkManager-wait-online.service and NetworkManager-dispatcher.service are dead:

[leo@colnixos:~]$ sudo systemctl status NetworkManager-dispatcher.service 
● NetworkManager-dispatcher.service - Network Manager Script Dispatcher Service
   Loaded: loaded (/nix/store/b9siz8grm9x8y9p0rbvrrwfaa80hvadb-network-manager-1.14.4/etc/systemd/system/NetworkManager-dispatcher.service; enabled; vendor preset: enabled)
  Drop-In: /nix/store/65c2srz4dn2f40ac07dmcg86pqqabmwf-system-units/NetworkManager-dispatcher.service.d
           └─overrides.conf
   Active: inactive (dead) since Tue 2019-02-26 14:32:48 CET; 8min ago
  Process: 31842 ExecStart=/nix/store/b9siz8grm9x8y9p0rbvrrwfaa80hvadb-network-manager-1.14.4/libexec/nm-dispatcher (code=exited, status=0/SUCCESS)
 Main PID: 31842 (code=exited, status=0/SUCCESS)

févr. 26 14:32:38 colnixos systemd[1]: Starting Network Manager Script Dispatcher Service...
févr. 26 14:32:38 colnixos systemd[1]: Started Network Manager Script Dispatcher Service.
févr. 26 14:32:38 colnixos nm-dispatcher[31842]: req:1 'dhcp4-change' [enp0s31f6]: new request (1 scripts)
févr. 26 14:32:38 colnixos nm-dispatcher[31842]: req:1 'dhcp4-change' [enp0s31f6]: start running ordered scripts...

[leo@colnixos:~]$ sudo systemctl status NetworkManager-wait-online.service 
● NetworkManager-wait-online.service - Network Manager Wait Online
   Loaded: loaded (/nix/store/b9siz8grm9x8y9p0rbvrrwfaa80hvadb-network-manager-1.14.4/etc/systemd/system/NetworkManager-wait-online.service; linked; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:nm-online(1)

and network-manager.service is not really helpful:

-- Reboot --
févr. 26 13:10:36 colnixos systemd[1]: Starting Network Manager...
févr. 26 13:10:44 colnixos systemd[1]: Started Network Manager.
févr. 26 13:10:50 colnixos dhclient[1500]: DHCPREQUEST for XXX.XXX.102.113 on enp0s31f6 to 255.255.255.255 port 67
févr. 26 13:10:53 colnixos dhclient[1500]: DHCPREQUEST for XXX.XXX.102.113 on enp0s31f6 to 255.255.255.255 port 67
févr. 26 13:10:53 colnixos dhclient[1500]: DHCPACK of XXX.XXX.102.113 from XXX.XXX.102.7
févr. 26 13:10:54 colnixos dhclient[1500]: bound to XXX.XXX.102.113 -- renewal in 1744 seconds.
févr. 26 13:39:57 colnixos dhclient[1500]: DHCPREQUEST for XXX.XXX.102.113 on enp0s31f6 to XXX.XXX.102.7 port 67
févr. 26 13:39:57 colnixos dhclient[1500]: DHCPACK of XXX.XXX.102.113 from XXX.XXX.102.7
févr. 26 13:39:58 colnixos dhclient[1500]: bound to XXX.XXX.102.113 -- renewal in 1421 seconds.
févr. 26 14:03:39 colnixos dhclient[1500]: DHCPREQUEST for XXX.XXX.102.113 on enp0s31f6 to XXX.XXX.102.7 port 67
févr. 26 14:03:39 colnixos dhclient[1500]: DHCPACK of XXX.XXX.102.113 from XXX.XXX.102.7
févr. 26 14:03:39 colnixos dhclient[1500]: bound to XXX.XXX.102.113 -- renewal in 1739 seconds.
févr. 26 14:32:38 colnixos dhclient[1500]: DHCPREQUEST for XXX.XXX.102.113 on enp0s31f6 to XXX.XXX.102.7 port 67
févr. 26 14:32:38 colnixos dhclient[1500]: DHCPACK of XXX.XXX.102.113 from XXX.XXX.102.7
févr. 26 14:32:38 colnixos dhclient[1500]: bound to XXX.XXX.102.113 -- renewal in 1747 seconds.
tobiasBora commented 5 years ago

If it is of interest, here is my full configuration:

{ config, pkgs, ... }:
  let python2-with-my-packages = pkgs.python2;
  python3-with-my-packages = pkgs.python3.withPackages my-python-packages;
in
{
  imports = [
    ./hardware-configuration.nix
  ];

  boot.supportedFilesystems = [ "zfs" ];
  boot.zfs.enableUnstable = true;

  # Use the systemd-boot EFI boot loader.
  # boot.loader.systemd-boot.enable = true;
  boot.loader = {
    efi = {
      canTouchEfiVariables = true;
      efiSysMountPoint = "/boot/EFI"; # ← use the same mount point here.
    };
    grub = {
      efiSupport = true;
      device = "nodev";
      useOSProber = true;
    };
  };

  networking.hostName = "myhostname"; # Define your hostname.
  networking.hostId = "abcdef01";
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
  # Enable network manager
  networking.networkmanager.enable = true;

  # Select internationalisation properties.
  i18n = {
    consoleFont = "Lat2-Terminus16";
    consoleKeyMap = "fr";
    defaultLocale = "fr_FR.UTF-8";
  };

  # Set your time zone.
  time.timeZone = "Europe/Paris";
  # journalctl -eu systemd-timesyncd.service
  networking.timeServers = [
    "ntp.myplace.fr"
  ];

  environment.systemPackages = with pkgs; [
    wget nox vim gitAndTools.gitFull firefox numlockx psmisc socat texlive.combined.scheme-full
    libreoffice-fresh
    auctex ntp okular
    qemu OVMF-CSM.fd # https://www.linux-kvm.org/page/Migration
    nix-index tree pastebinit signal-desktop libnotify ark
    python2-with-my-packages
    python3-with-my-packages
    owncloud-client source-code-pro emacs blender spectacle youtube-dl
    sage
    jupyter
    thunderbird unzip gparted zip ispell
    imagemagick
    gwenview
    chromium
    gnumake
    vlc
    htop
    jre8
    gdb
  ];
  nixpkgs.config.allowUnfree = true;
  fonts.fonts = [ pkgs.corefonts ];
  # Emacs
  services.emacs.defaultEditor = true;  
  services.emacs.enable = true;  

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  programs.bash.enableCompletion = true;
  # programs.mtr.enable = true;
  programs.gnupg.agent = { enable = true; enableSSHSupport = true; };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  services.openssh.enable = true;

  # Open ports in the firewall.
  networking.firewall.allowedTCPPorts = [ 22 7777 ];
  networking.firewall.allowedUDPPorts = [ 22 7777 ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # Enable CUPS to print documents.
  services.printing.enable = true;
  services.avahi.enable = true;
  services.avahi.nssmdns = true;

  # Enable sound.
  sound.enable = true;
  hardware.pulseaudio.enable = true;

  # Enable the X11 windowing system.
  services.xserver.enable = true;
  services.xserver.layout = "fr";
  services.xserver.xkbVariant = "oss";
  services.xserver.xkbOptions = "ctrl:swapcaps,terminate:ctrl_alt_bksp";

  # Enable touchpad support.
  # services.xserver.libinput.enable = true;

  # Enable the KDE Desktop Environment.
  services.xserver.displayManager.sddm.enable = true;
  services.xserver.displayManager.sddm.autoNumlock = true;
  services.xserver.desktopManager.plasma5.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.extraUsers.myuser = {
    isNormalUser = true;
    uid = 1000;
    openssh.authorizedKeys.keys = [ "ssh-rsa mykey..." ];
    extraGroups = ["wheel" "networkmanager"];
  };

  # Bashrc-like
  environment.shellAliases = {
    nbt = "sudo nixos-rebuild test";
    nbb = "sudo nixos-rebuild boot";
    nb  = "sudo nixos-rebuild switch";
    ne  = "sudo emacs /etc/nixos/configuration.nix";
    e   = "emacseditor";
  };

  # Power management
  powerManagement.cpuFreqGovernor = "performance";

  # This value determines the NixOS release with which your system is to be
  # compatible, in order to avoid breaking some software such as database
  # servers. You should change this only after NixOS release notes say you
  # should.
  system.stateVersion = "18.03"; # Did you read the comment?

}
tobiasBora commented 5 years ago

After some search I found an explicit error running sudo journalctl -f:

Impossible de trouver le module « kcm_networkmanagement.desktop » Veuillez saisir « kcmshell5 --list » pour obtenir la liste de tous les modules.

which translates into

Could not find the module « kcm_networkmanagement.desktop » Please type « kcmshell5 --list » to get the full list of modules.

After running kbuildsycoca5 (both in root and user), I can see that this appears in the list when I run kcmshell5 --list:

kcm_networkmanagement      - Modifier vos connexions réseau

However, I still have the error even after logout/login...

tobiasBora commented 5 years ago

It also appears that typing

kcmshell5 kcm_networkmanagement

opens the menu! So no idea what is doing the applet... Maybe they call " kcm_networkmanagement.desktop" instead of "kcm_networkmanagement"?

tobiasBora commented 5 years ago

One more update: from a fresh new user, it works...

tobiasBora commented 5 years ago

So I don't know what happened. I copied .local and .config to a backup .local_old and .config_old. Then I moved the folders from the old user: it worked. Then I removed .local/.config, and replaced back .local_old and .config_old to their original names... And it was working, even with the old conf ! Mystery... but my problem is solved. Guess we can close the issue?

aanderse commented 5 years ago

@tobiasBora Yeah, sounds like you can close. Glad to hear your issue is resolved.