{"record":{"id":"ae7685623ed40b57","repo":"puppetlabs/puppet","slug":"invalid-negative-time-to-live-value-did-you","errorCode":null,"errorMessage":"Invalid negative 'time to live' %{value} - did you mean 'unlimited'?","messagePattern":"Invalid negative 'time to live' %(.+?) - did you mean 'unlimited'\\?","errorType":"validation","errorClass":"Puppet::Settings::ValidationError","httpStatus":null,"severity":"error","filePath":"lib/puppet/settings/ttl_setting.rb","lineNumber":39,"sourceCode":"  def type\n    :ttl\n  end\n\n  # Convert the value to Numeric, parsing numeric string with units if necessary.\n  def munge(value)\n    self.class.munge(value, @name)\n  end\n\n  def print(value)\n    val = munge(value)\n    val == Float::INFINITY ? 'unlimited' : val\n  end\n\n  # Convert the value to Numeric, parsing numeric string with units if necessary.\n  def self.munge(value, param_name)\n    if value.is_a?(Numeric)\n      if value < 0\n        raise Puppet::Settings::ValidationError, _(\"Invalid negative 'time to live' %{value} - did you mean 'unlimited'?\") % { value: value.inspect }\n      end\n\n      value\n\n    elsif value == 'unlimited'\n      Float::INFINITY\n\n    elsif value.is_a?(String) and value =~ FORMAT\n      ::Regexp.last_match(1).to_i * UNITMAP[::Regexp.last_match(2) || 's']\n    else\n      raise Puppet::Settings::ValidationError, _(\"Invalid 'time to live' format '%{value}' for parameter: %{param_name}\") % { value: value.inspect, param_name: param_name }\n    end\n  end\nend\n","sourceCodeStart":21,"sourceCodeEnd":54,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/settings/ttl_setting.rb#L21-L54","documentation":"Error \"Invalid negative 'time to live' %{value} - did you mean 'unlimited'?\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/settings/ttl_setting.rb:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}