잠긴 토픽의 diff를 열려 할 때 ArgumentError(Attributes per element limit exceeded) 발생

ArgumentError (Attributes per element limit exceeded) - when clicking on the “edit” icon to see topic version diffs.

Developer Console

Logs

Message (2 copies reported)

ArgumentError (Attributes per element limit exceeded)
lib/discourse_diff.rb:171:in `tokenize_html_blocks'
lib/discourse_diff.rb:10:in `initialize'
app/serializers/post_revision_serializer.rb:117:in `new'
app/serializers/post_revision_serializer.rb:117:in `body_changes'
(eval):18:in `_fast_attributes'
app/controllers/application_controller.rb:520:in `render_json_dump'
app/controllers/posts_controller.rb:408:in `latest_revision'
app/controllers/application_controller.rb:397:in `block in with_resolved_locale'
app/controllers/application_controller.rb:397:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:356:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:187:in `call'

Backtrace

nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:38:in `fragment'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:38:in `initialize'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:52:in `new'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5/document_fragment.rb:52:in `parse'
nokogiri-1.12.5-x86_64 (linux) lib/nokogiri/html5.rb:242:in `fragment'
lib/discourse_diff.rb:171:in `tokenize_html_blocks'
lib/discourse_diff.rb:10:in `initialize'
app/serializers/post_revision_serializer.rb:117:in `new'
app/serializers/post_revision_serializer.rb:117:in `body_changes'
(eval):18:in `_fast_attributes'

Env

HTTP HOSTS: jai.community

Is this on the site we host for you? We need to see the diff that causes the pathological behavior.

It’s self-hosted. What would be the best way to share the diff with you?

If there is nothing secret, can you try reproducing here? Just post a reply, then wait 10 minutes and make the problem edit.

It’s not a public community, and the material is regarding a beta product that’s not public either. So with all the respect to both the author of the material and the Discourse team, I’d prefer not to share it here. Any other simple way?

1개의 좋아요

I guess divide and conquer? Try making smaller and smaller repros until you find the culprit line?

1개의 좋아요

Shell I post the content of that particular topic in a PM to you here in Meta?

Feel free, especially if you can create a repro.

저도 매우 유사한(또는 관련이 있는) 문제를 경험하고 있습니다.

재현 방법 / 원인:

  • 이 문제는 매우 긴 게시글(약 100,000자)에서 발생합니다.
  • 구체적으로 대규모 수정(콘텐츠의 상당 부분이 변경될 때)에 의해 발생합니다.

이러한 방대한 편집을 저장하려고 하면 백엔드가 종종 타임아웃(502/504)에 도달합니다. 근본 원인은 구버전과 신버전 간의 Diff 계산이라고 추정하는데, 이 두 조건이 결합되면 비용이 극도로 높아지기 때문입니다.

이 이슈는 해당 토론이 다음 링크에서 계속되고 있으므로 닫겠습니다.