{"record":{"id":"48e0d2ab172afc0b","repo":"ruby/rubygems","slug":"exceeded-maximum-nesting-depth-max-nesting-dept","errorCode":null,"errorMessage":"exceeded maximum nesting depth (#{MAX_NESTING_DEPTH})","messagePattern":"exceeded maximum nesting depth \\(#(.+?)\\)","errorType":"validation","errorClass":"Psych::SyntaxError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/yaml_serializer.rb","lineNumber":410,"sourceCode":"      def consume_value_anchor(val)\n        return [nil, val] unless val =~ /^&(\\S+)\\s+/\n\n        anchor = $1\n        [anchor, val.sub(/^&#{Regexp.escape(anchor)}\\s+/, \"\")]\n      end\n\n      def register_anchor(name, node)\n        if name\n          @anchors[name] = node\n          node.anchor = name if node.respond_to?(:anchor=)\n        end\n        node\n      end\n\n      def raise_max_nesting!\n        message = \"exceeded maximum nesting depth (#{MAX_NESTING_DEPTH})\"\n        if defined?(Psych::VERSION)\n          raise Psych::SyntaxError.new(nil, 0, 0, 0, message, nil)\n        else\n          raise Psych::SyntaxError, message\n        end\n      end\n\n      def skip_blank_and_comments\n        while @lines.any?\n          line = @lines[0]\n          stripped = line.lstrip\n          break unless stripped.empty? || stripped.start_with?(\"#\")\n          @lines.shift\n        end\n      end\n\n      def strip_comment(val)\n        return val unless val.include?(\"#\")\n        return \"\" if val.lstrip.start_with?(\"#\")\n","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/yaml_serializer.rb#L392-L428","documentation":"Error \"exceeded maximum nesting depth (#{MAX_NESTING_DEPTH})\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/yaml_serializer.rb:410 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce nesting in the YAML metadata; the structure exceeds the maximum allowed depth","If the gem is third-party, report the malformed metadata to its author"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}