Nixpkgs: netdata: All python plugins broken

Created on 3 Jan 2018  路  6Comments  路  Source: NixOS/nixpkgs

Issue description

In NixOS, netdata fails to start the python script that runs all of its python plugins. This completely breaks all 40+ python plugins netdata provides.

See also: #32059

Steps to reproduce

  • Enable the netdata service and rebuild the NixOS configuration.
  • Check netdata's log for the failure

    grep ERROR /var/log/netdata/error.log

  • Notice a line similar to:

    /nix/store/i0grak2af5vn06x7hmby81n1jjp1mx96-netdata-1.9.0/libexec/netdata/plugins.d/python.d.plugin: line 3: exec: ERROR python IS NOT AVAILABLE IN THIS SYSTEM: not found

  • A visual inspection of the netdata Web UI confirms there are no functioning python plugins.

Note: I have already tried adding python to the netdata buildInputs. This has not seemed to help.

Technical details

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

  • system: "x86_64-linux"
  • host os: Linux 4.14.10, NixOS, 18.03.git.c98eb9e (Impala)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 1.11.16
  • channels(root): "nixos-18.03pre124007.4fe3297686b"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
bug

Most helpful comment

You might want to add it to path attribute of the systemd service. Or even better, patch the plugin loader to use python:

--- a/plugins.d/python.d.plugin
+++ b/plugins.d/python.d.plugin
@@ -1,6 +1,4 @@
-#!/usr/bin/env bash
-'''':; exec "$(command -v python || command -v python3 || command -v python2 ||
-echo "ERROR python IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@" # '''
+#!/usr/bin/env python3

 # -*- coding: utf-8 -*-
 # Description:

All 6 comments

You might want to add it to path attribute of the systemd service. Or even better, patch the plugin loader to use python:

--- a/plugins.d/python.d.plugin
+++ b/plugins.d/python.d.plugin
@@ -1,6 +1,4 @@
-#!/usr/bin/env bash
-'''':; exec "$(command -v python || command -v python3 || command -v python2 ||
-echo "ERROR python IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@" # '''
+#!/usr/bin/env python3

 # -*- coding: utf-8 -*-
 # Description:

@jtojnar Thanks for the advice. I'll give these a shot later today.

I also backported it.

This one makes it finally work: https://github.com/NixOS/nixpkgs/pull/50509

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

ob7 picture ob7  路  3Comments

edolstra picture edolstra  路  3Comments

tomberek picture tomberek  路  3Comments

lverns picture lverns  路  3Comments