Skip to content

[Bug]: netdata-updater.sh deletes /dev/null on Almalinux 9.7 #21427

Closed

Description

@z23

Bug description

Hello,

On a fully updated Almalinux 9.7, using a freshly installed native Netdata package via kickstart ( wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh --disable-telemetry ), running /usr/libexec/netdata/netdata-updater.sh after 2246955 deletes the /dev/null special file.

I can reproduce this behavior.

I think perhaps something might be wrong with the new version detection or the new repo URLs and the resulting 404 is triggering rm -f "${dest}" where dest is /dev/null.

This is my system:

# cat /etc/os-release
NAME="AlmaLinux"
VERSION="9.7 (Moss Jungle Cat)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.7"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.7 (Moss Jungle Cat)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.7"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.7"
SUPPORT_END=2032-06-01

Here is the output from the update script:

# ls -l /dev/null
crw-rw-rw-. 1 root root 1, 3 Dec  9 11:37 /dev/null
# /usr/libexec/netdata/netdata-updater.sh
Tue Dec  9 11:40:32 AWST 2025 : INFO: netdata-updater.sh:  Checking if a newer version of the updater script is available.
Netdata                                                                                           1.1 kB/s | 833  B     00:00
Netdata Repository Config                                                                         1.2 kB/s | 833  B     00:00
AlmaLinux 9 - AppStream                                                                           4.7 kB/s | 4.2 kB     00:00
AlmaLinux 9 - BaseOS                                                                              4.4 kB/s | 3.8 kB     00:00
AlmaLinux 9 - CRB                                                                                 5.0 kB/s | 4.2 kB     00:00
AlmaLinux 9 - Extras                                                                              4.4 kB/s | 3.8 kB     00:00
Extra Packages for Enterprise Linux 9 - x86_64                                                     25 kB/s |  41 kB     00:01
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64                              1.1 kB/s | 993  B     00:00
Metadata cache created.
Tue Dec  9 11:40:41 AWST 2025 : INFO: netdata-updater.sh:  Checking if native packages are still being published for this platform.
curl: (22) The requested URL returned error: 404
--2025-12-09 11:40:42--  https://repository.netdata.cloud/repos/edge/centos/9.7/x86_64/.currently.published
Resolving repository.netdata.cloud (repository.netdata.cloud)... 172.66.170.216, 104.20.22.2, 2606:4700:10::ac42:aad8, ...
Connecting to repository.netdata.cloud (repository.netdata.cloud)|172.66.170.216|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2025-12-09 11:40:42 ERROR 404: Not Found.

Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:  NETDATA CANNOT BE UPDATED ON THIS SYSTEM!
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:  Native packages are no longer being published for this platform.
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:  To update to the latest version of Netdata, you will need to switch to a different install type.
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:  For details on how to do so, see https://learn.netdata.cloud/docs/netdata-agent/installation/linux/switch-install-types-and-release-channels
Tue Dec  9 11:40:42 AWST 2025 : ERROR: netdata-updater.sh:
Tue Dec  9 11:40:42 AWST 2025 : FATAL: netdata-updater.sh: FAILED TO UPDATE NETDATA:  Unable to update due to native packages no longer being published for this platform
# ls -l /dev/null
ls: cannot access '/dev/null': No such file or directory

Expected behavior

netdata-updater.sh should not delete /dev/null

Steps to reproduce

  1. Begin with fully updated Almalinux 9.7
  2. Install netdata agent via kickstart ( wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh --disable-telemetry ),
  3. Run /usr/libexec/netdata/netdata-updater.sh

Installation method

kickstart.sh

System info

# uname -a; grep -HvE "^#|URL" /etc/*release
Linux xxxxxxx 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64 x86_64 x86_64 GNU/Linux
/etc/almalinux-release:AlmaLinux release 9.7 (Moss Jungle Cat)
/etc/os-release:NAME="AlmaLinux"
/etc/os-release:VERSION="9.7 (Moss Jungle Cat)"
/etc/os-release:ID="almalinux"
/etc/os-release:ID_LIKE="rhel centos fedora"
/etc/os-release:VERSION_ID="9.7"
/etc/os-release:PLATFORM_ID="platform:el9"
/etc/os-release:PRETTY_NAME="AlmaLinux 9.7 (Moss Jungle Cat)"
/etc/os-release:ANSI_COLOR="0;34"
/etc/os-release:LOGO="fedora-logo-icon"
/etc/os-release:CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
/etc/os-release:
/etc/os-release:ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
/etc/os-release:ALMALINUX_MANTISBT_PROJECT_VERSION="9.7"
/etc/os-release:REDHAT_SUPPORT_PRODUCT="AlmaLinux"
/etc/os-release:REDHAT_SUPPORT_PRODUCT_VERSION="9.7"
/etc/os-release:SUPPORT_END=2032-06-01
/etc/redhat-release:AlmaLinux release 9.7 (Moss Jungle Cat)
/etc/system-release:AlmaLinux release 9.7 (Moss Jungle Cat)

Netdata build info

# netdata -W buildinfo
time=2025-12-09T12:16:41.278+08:00 comm=netdata source=daemon level=notice errno="2, No such file or directory" tid=2705  msg="CONFIG: cannot load user config '/etc/netdata/stream.conf'. Will try stock config."
Packaging:
    Netdata Version ____________________________________________ : v2.8.0-93-nightly
    Installation Type __________________________________________ : binpkg-rpm
    Package Architecture _______________________________________ : x86_64
    Package Distro _____________________________________________ :
    Configure Options __________________________________________ : cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_STANDARD=11 -DCMAKE_CXX_STANDARD=14 -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fexceptions -ffunction-sections -fdata-sections -Wno-builtin-macro-redefined -fno-omit-frame-pointer -funwind-tables -fasynchronous-unwind-tables' -DCMAKE_CXX_FLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fexceptions -ffunction-sections -fdata-sections -Wno-builtin-macro-redefined -fno-omit-frame-pointer -funwind-tables -fasynchronous-unwind-tables' -DCMAKE_COMPILE_DEFINITIONS='_GNU_SOURCE' -DCMAKE_EXE_LINKER_FLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fexceptions -ffunction-sections -fdata-sections -Wno-builtin-macro-redefined -rdynamic' -DCMAKE_SHARED_LINKER_FLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1'
Default Directories:
    User Configurations ________________________________________ : /etc/netdata
    Stock Configurations _______________________________________ : /usr/lib/netdata/conf.d
    Ephemeral Databases (metrics data, metadata) _______________ : /var/cache/netdata
    Permanent Databases ________________________________________ : /var/lib/netdata
    Plugins ____________________________________________________ : /usr/libexec/netdata/plugins.d
    Static Web Files ___________________________________________ : /usr/share/netdata/web
    Log Files __________________________________________________ : /var/log/netdata
    Lock Files _________________________________________________ : /var/lib/netdata/lock
    Home _______________________________________________________ : /var/lib/netdata
Operating System:
    Kernel _____________________________________________________ : Linux
    Kernel Version _____________________________________________ : 5.14.0-611.11.1.el9_7.x86_64
    Operating System ___________________________________________ : AlmaLinux
    Operating System ID ________________________________________ : almalinux
    Operating System ID Like ___________________________________ : rhel centos fedora
    Operating System Version ___________________________________ : 9.7 (Moss Jungle Cat)
    Operating System Version ID ________________________________ : none
    Detection __________________________________________________ : /etc/os-release
Hardware:
    CPU Cores __________________________________________________ : 16
    CPU Frequency ______________________________________________ : 2200000000
    RAM Bytes __________________________________________________ : 8042409984
    Disk Capacity ______________________________________________ : 21474836480
    CPU Architecture ___________________________________________ : x86_64
    Virtualization Technology __________________________________ : xen
    Virtualization Detection ___________________________________ : systemd-detect-virt
Container:
    Container __________________________________________________ : none
    Container Detection ________________________________________ : systemd-detect-virt
    Container Orchestrator _____________________________________ : none
    Container Operating System _________________________________ : none
    Container Operating System ID ______________________________ : none
    Container Operating System ID Like _________________________ : none
    Container Operating System Version _________________________ : none
    Container Operating System Version ID ______________________ : none
    Container Operating System Detection _______________________ : none
Features:
    Built For __________________________________________________ : Linux
    Netdata Cloud ______________________________________________ : YES
    Health (trigger alerts and send notifications) _____________ : YES
    Streaming (stream metrics to parent Netdata servers) _______ : YES
    Back-filling (of higher database tiers) ____________________ : YES
    Replication (fill the gaps of parent Netdata servers) ______ : YES
    Streaming and Replication Compression ______________________ : YES (zstd lz4 gzip)
    Contexts (index all active and archived metrics) ___________ : YES
    Tiering (multiple dbs with different metrics resolution) ___ : YES (5)
    Machine Learning ___________________________________________ : YES
    Memory Allocator ___________________________________________ : system
Database Engines:
    dbengine (compression) _____________________________________ : YES (zstd lz4)
    alloc ______________________________________________________ : YES
    ram ________________________________________________________ : YES
    none _______________________________________________________ : YES
Connectivity Capabilities:
    ACLK (Agent-Cloud Link: MQTT over WebSockets over TLS) _____ : YES
    static (Netdata internal web server) _______________________ : YES
    WebRTC (experimental) ______________________________________ : NO
    Native HTTPS (TLS Support) _________________________________ : YES
    TLS Host Verification ______________________________________ : YES
Libraries:
    LZ4 (extremely fast lossless compression algorithm) ________ : YES
    ZSTD (fast, lossless compression algorithm) ________________ : YES
    zlib (lossless data-compression library) ___________________ : YES
    Brotli (generic-purpose lossless compression algorithm) ____ : NO
    protobuf (platform-neutral data serialization protocol) ____ : YES (system)
    OpenSSL (cryptography) _____________________________________ : YES
    libdatachannel (stand-alone WebRTC data channels) __________ : NO
    JSON-C (lightweight JSON manipulation) _____________________ : YES
    libcap (Linux capabilities system operations) ______________ : NO
    libcrypto (cryptographic functions) ________________________ : YES
    libyaml (library for parsing and emitting YAML) ____________ : YES
    libmnl (library for working with netfilter) ________________ : YES
    stacktraces (library for getting stack traces) _____________ : libbacktrace (mmap, threads, data)
Plugins:
    apps (monitor processes) ___________________________________ : YES
    cgroups (monitor containers and VMs) _______________________ : YES
    cgroup-network (associate interfaces to CGROUPS) ___________ : YES
    proc (monitor Linux systems) _______________________________ : YES
    tc (monitor Linux network QoS) _____________________________ : YES
    diskspace (monitor Linux mount points) _____________________ : YES
    freebsd (monitor FreeBSD systems) __________________________ : NO
    macos (monitor MacOS systems) ______________________________ : NO
    windows (monitor Windows systems) __________________________ : NO
    statsd (collect custom application metrics) ________________ : YES
    timex (check system clock synchronization) _________________ : YES
    idlejitter (check system latency and jitter) _______________ : YES
    bash (support shell data collection jobs - charts.d) _______ : YES
    debugfs (kernel debugging metrics) _________________________ : YES
    cups (monitor printers and print jobs) _____________________ : YES
    ebpf (monitor system calls) ________________________________ : YES
    freeipmi (monitor enterprise server H/W) ___________________ : YES
    network-viewer (monitor TCP/UDP IPv4/6 sockets) ____________ : YES
    systemd-journal (monitor journal logs) _____________________ : YES
    windows-events (monitor Windows events) ____________________ : NO
    nfacct (gather netfilter accounting) _______________________ : NO
    perf (collect kernel performance events) ___________________ : YES
    slabinfo (monitor kernel object caching) ___________________ : YES
    Xen ________________________________________________________ : NO
    Xen VBD Error Tracking _____________________________________ : NO
Exporters:
    AWS Kinesis ________________________________________________ : NO
    GCP PubSub _________________________________________________ : NO
    MongoDB ____________________________________________________ : YES
    Prometheus (OpenMetrics) Exporter __________________________ : YES
    Prometheus Remote Write ____________________________________ : YES
    Graphite ___________________________________________________ : YES
    Graphite HTTP / HTTPS ______________________________________ : YES
    JSON _______________________________________________________ : YES
    JSON HTTP / HTTPS __________________________________________ : YES
    OpenTSDB ___________________________________________________ : YES
    OpenTSDB HTTP / HTTPS ______________________________________ : YES
    All Metrics API ____________________________________________ : YES
    Shell (use metrics in shell scripts) _______________________ : YES
Debug/Developer Features:
    Trace All Netdata Allocations (with charts) ________________ : NO
    Developer Mode (more runtime checks, slower) _______________ : NO
Runtime Information:
    Profile ____________________________________________________ : standalone
    Stream Parent (accept data from Children) __________________ : NO
    Stream Child (send data to a Parent) _______________________ : NO
    Total System Memory ________________________________________ : 8042409984
    Available System Memory ____________________________________ : 7537795072

Additional info

No response

Activity

  1. added
    needs triageIssues which need to be manually labelled
    on Dec 9, 2025
  2. added theissue type on Dec 9, 2025
  3. z23 commented on Dec 9, 2025

    @z23
    Author

    Thank you for fixing this quickly :)

  4. ilyam8 commented on Dec 9, 2025

    @ilyam8
    Member

    Big thanks for reporting, @z23 👍

  5. Saruspete commented on Dec 10, 2025

    @Saruspete
    Contributor

    Hello dear team :)
    This had a serious impact on many systems (eg ssh refusing any connection) and it took me some time to pinpoint netdata-updater as the culprit.

    A communication about this issue would be greatly appreciated, with some detail on how to fix, and how to make it not reproduce again :)

    all the best,

  6. z23 commented on Dec 10, 2025

    @z23
    Author

    Indeed, I'm still cleaning up my own systems. To recreate your missing /dev/null, you can either reboot or if you can log in via console, run mknod -m 0666 /dev/null c 1 3.

    Now that #21428 has been merged, I don't think it will happen again.

    But... I've decided that I don't want to run netdata-updater.sh daily (where it auto-pulls the latest copy of its self from the web, runs as root, and can hose your entire fleet with limited oversight).

    To achieve that, I think /usr/libexec/netdata/netdata-updater.sh --disable-auto-updates would do it.

  7. Jamira40 commented on Dec 10, 2025

    @Jamira40

    Hello,

    Thank you for report we had affected two production servers running Netdata causing inability do deliver and filter emails. Anyway...

  8. Saruspete commented on Dec 10, 2025

    @Saruspete
    Contributor

    Maybe I should say it before: netdata team is not responsible of the issues we have had on our systems. We (as responsible of these systems, dev or prod, entertainment or critical) are the ones that chose to install it, let the updater run, and ultimately failed to assess the risk of letting an external script run every day as root.

    We already enjoy freely this great software, we cannot expect the code to be flawless, much less to hold the team responsible for our bad usage. afaik, this is the first time in almost 10 years such an issue arise.

    As possible enhancement to avoid similar situations / security issues, make the script run the version check / download package / file validation as unprivileged user, letting only the installation run as root ?

    And thanks again for all the great work since so many years.

  9. ilyam8 commented on Dec 10, 2025

    @ilyam8
    Member

    I believe the Netdata team is fully responsible for this issue, and there’s no justification for how it happened. The problematic PR was reviewed and merged, yet it introduced a critical /dev/null deletion bug. Additionally, a broken RPM-native package detection makes it clear that even a single manual test on an RPM-based system would have exposed the problem.

    • /dev/null bug:
      In update_binpkg(), _safe_download() is called with /dev/null as the destination to check whether native packages are still being published. When the download fails, _safe_download() attempts to clean up by running rm -f "${dest}". Since dest is /dev/null, the special device file is deleted.

    • RPM detection issue:
      The code constructed an incorrect repository path, causing _safe_download() to fail with 404. This again triggered rm -f /dev/null. This alone indicates that the changes were not tested on any RPM system. Otherwise, the failure would have been immediately obvious.

    This occurred in one of the most sensitive parts: the updater script, which affects both stable and nightly users.

    It should never have happened, and we will do everything necessary to ensure it cannot happen again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds triageIssues which need to be manually labelled

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions