{"record":{"id":"74247a530c9e3df6","repo":"puppetlabs/puppet","slug":"unable-to-parse-str-using-any-of-the-formats","errorCode":null,"errorMessage":"Unable to parse '%{str}' using any of the formats %{formats}","messagePattern":"Unable to parse '%(.+?)' using any of the formats %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/time/timespan.rb","lineNumber":117,"sourceCode":"        hash[KEY_HOURS] || 0,\n        hash[KEY_MINUTES] || 0,\n        hash[KEY_SECONDS] || 0,\n        hash[KEY_MILLISECONDS] || 0,\n        hash[KEY_MICROSECONDS] || 0,\n        hash[KEY_NANOSECONDS] || 0\n      )\n    end\n\n    def self.parse(str, format = Format::DEFAULTS)\n      if format.is_a?(::Array)\n        format.each do |fmt|\n          fmt = FormatParser.singleton.parse_format(fmt) unless fmt.is_a?(Format)\n          begin\n            return fmt.parse(str)\n          rescue ArgumentError\n          end\n        end\n        raise ArgumentError, _(\"Unable to parse '%{str}' using any of the formats %{formats}\") % { str: str, formats: format.join(', ') }\n      end\n      format = FormatParser.singleton.parse_format(format) unless format.is_a?(Format)\n      format.parse(str)\n    end\n\n    # @return [true] if the stored value is negative\n    def negative?\n      @nsecs < 0\n    end\n\n    def +(o)\n      case o\n      when Timestamp\n        Timestamp.new(@nsecs + o.nsecs)\n      when Timespan\n        Timespan.new(@nsecs + o.nsecs)\n      when Integer, Float\n        # Add seconds","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/time/timespan.rb#L99-L135","documentation":"Error \"Unable to parse '%{str}' using any of the formats %{formats}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/time/timespan.rb:117 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"}