puppetlabs/puppet · error · Puppet::ParseError

Numerical variables cannot be deleted: Attempt to delete: $%

Error message

Numerical variables cannot be deleted: Attempt to delete: $%{name}

What it means

Error "Numerical variables cannot be deleted: Attempt to delete: $%{name}" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/parser/scope.rb:159

    def include?(name)
      bound?(name) or super
    end

    def bound?(name)
      # A "match variables" scope reports all numeric variables to be bound if the scope has
      # match_data. Without match data the scope is transparent.
      #
      @match_data && name =~ /^\d+$/
    end

    def []=(name, value)
      # TODO: Bad choice of exception
      raise Puppet::ParseError, _("Numerical variables cannot be changed. Attempt to set $%{name}") % { name: name }
    end

    def delete(name)
      # TODO: Bad choice of exception
      raise Puppet::ParseError, _("Numerical variables cannot be deleted: Attempt to delete: $%{name}") % { name: name }
    end

    def add_entries_to(target = {}, include_undef = false)
      # do not include match data ($0-$n)
      super
    end
  end

  # @api private
  class ParameterScope < Ephemeral
    class Access
      attr_accessor :value

      def assigned?
        instance_variable_defined?(:@value)
      end
    end

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/parser/scope.rb:159 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/937adccd1c392493. Report an issue: GitHub.