Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 170
    • Issues 170
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • NetworkManagerNetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !1502

[lr/client-running] libnm/client: don't consider client running if we got no NMManager

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Lubomir Rintel requested to merge lr/client-running into main Jan 16, 2023
  • Overview 5
  • Commits 2
  • Pipelines 3
  • Changes 1

We silently tolerate NetworkManager not responding at all (easily reproduced with e.g. pkill -STOP NetworkManager):

$ LIBNM_CLIENT_DEBUG=trace nmcli c show dummy666 libnm-dbus[23540]: [3316.81989] nmclient[ddafb84b8deebe4a]: new NMClient instance libnm-dbus[23540]: [3316.81998] nmclient[ddafb84b8deebe4a]: starting async initialization... libnm-dbus[23540]: [3316.82461] nmclient[ddafb84b8deebe4a]: name owner changed: (null) -> ":1.2" libnm-dbus[23540]: [3316.82464] nmclient[ddafb84b8deebe4a]: fetch all libnm-dbus[23540]: [3341.85715] nmclient[ddafb84b8deebe4a]: GetManagedObjects() call failed: Timeout was reached libnm-dbus[23540]: [3341.85740] nmclient[ddafb84b8deebe4a]: async init complete with success Error: dummy666 - no such connection profile. libnm-dbus[23540]: [3341.86723] nmclient[ddafb84b8deebe4a]: release all libnm-dbus[23540]: [3341.86798] nmclient[ddafb84b8deebe4a]: disposed $

As a comment in _dbus_get_managed_objects_cb() explains, this is sort of intentional. NetworkManager might just be shutting down and the libnm users will eventually see the objects once a new daemon starts up.

This may make some sense for long-running clients ("nmcli monitor", various desktop environments), but not for one-shot invocations that require the daemon running, such as those of "nmcli c ...".

Let's not consider the client running unless we actually got the manager object. That way the error message will make more sense:

$ LIBNM_CLIENT_DEBUG=trace nmcli c show dummy666 libnm-dbus[24730]: [5360.95480] nmclient[8cb898d3c891e210]: new NMClient instance libnm-dbus[24730]: [5360.95487] nmclient[8cb898d3c891e210]: starting async initialization... libnm-dbus[24730]: [5360.95901] nmclient[8cb898d3c891e210]: name owner changed: (null) -> ":1.2" libnm-dbus[24730]: [5360.95904] nmclient[8cb898d3c891e210]: fetch all libnm-dbus[24730]: [5385.98487] nmclient[8cb898d3c891e210]: GetManagedObjects() call failed: Timeout was reached libnm-dbus[24730]: [5385.98497] nmclient[8cb898d3c891e210]: async init complete with success Error: NetworkManager is not running. libnm-dbus[24730]: [5385.98571] nmclient[8cb898d3c891e210]: release all libnm-dbus[24730]: [5385.98698] nmclient[8cb898d3c891e210]: disposed $

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: lr/client-running