Skip to content

profile::elastic::service doesn't actually disable unattended upgrades #247

@akuzminsky

Description

@akuzminsky

Problem

The current Puppet manifest in profile::elastic::service stops unattended-upgrades.service, but this only controls the shutdown hook — not the actual upgrade process. Unattended upgrades continue to run via apt-daily-upgrade.timer and the config in /etc/apt/apt.conf.d/20auto-upgrades.

service { 'unattended-upgrades.service':
  ensure => stopped,
}

Impact

On 2026-02-27, unattended-upgrade upgraded libstdc++6 and libgcc-s1 on production ES nodes, causing Elasticsearch to restart across the cluster. The timeline:

  • 06:11ip-10-2-3-206 went down
  • 06:21ip-10-2-3-217 bounced (removed then re-added to cluster)
  • 06:24:21unattended-upgrade started on ip-10-2-2-111 (gcc-13 packages)
  • 06:24:34-06:24:45 — GC pressure escalating (267ms → 316ms → 348ms per second)
  • 06:24:45unattended-upgrade upgraded libstdc++6, libgcc-s1 (core shared libraries used by ES JVM/ML controller)
  • 06:24:56 — Elasticsearch began stopping

All three ES nodes were affected in sequence, appearing as a rolling restart.

Evidence from apt history.log:

Start-Date: 2026-02-27  06:24:45
Commandline: /usr/bin/unattended-upgrade
Upgrade: libstdc++6:amd64, libgcc-s1:amd64, ...
End-Date: 2026-02-27  06:24:52

The apt-daily-upgrade.timer is active and ran at 06:23:48, and /etc/apt/apt.conf.d/20auto-upgrades has Unattended-Upgrade "1".

Suggested Fix

Replace the ineffective service stop with:

# Disable the actual upgrade timer
service { 'apt-daily-upgrade.timer':
  ensure => stopped,
  enable => false,
}

# Override apt config to disable unattended upgrades
file { '/etc/apt/apt.conf.d/20auto-upgrades':
  ensure  => file,
  content => "APT::Periodic::Update-Package-Lists \"1\";\nAPT::Periodic::Unattended-Upgrade \"0\";\n",
}

This keeps package list updates (so you can see what's available) but prevents automatic installation.

Affected Files

  • modules/profile/manifests/elastic/service.pp
  • environments/development/modules/profile/manifests/elastic/service.pp
  • environments/sandbox/modules/profile/manifests/elastic/service.pp

Affected Nodes

All ES nodes (ip-10-2-2-111, ip-10-2-3-217, ip-10-2-3-206 in production).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions