meglio
(Anton)
November 3, 2021, 9:43am
1
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
sam
(Sam Saffron)
November 4, 2021, 12:32am
2
Is this on the site we host for you? We need to see the diff that causes the pathological behavior.
meglio
(Anton)
November 4, 2021, 12:46am
3
It’s self-hosted. What would be the best way to share the diff with you?
sam
(Sam Saffron)
November 4, 2021, 12:52am
4
If there is nothing secret, can you try reproducing here? Just post a reply, then wait 10 minutes and make the problem edit.
meglio
(Anton)
November 4, 2021, 12:57am
5
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 Like
sam
(Sam Saffron)
November 4, 2021, 1:43am
6
I guess divide and conquer? Try making smaller and smaller repros until you find the culprit line?
1 Like
meglio
(Anton)
November 4, 2021, 1:51am
7
Shell I post the content of that particular topic in a PM to you here in Meta?
sam
(Sam Saffron)
November 4, 2021, 1:53am
8
Feel free, especially if you can create a repro.
I’m also experiencing a very similar (or related) issue.
Reproduction steps / cause:
The problem occurs on extremely long posts (around 100,000 characters).
It is triggered specifically by large-scale revisions (when a huge portion of the content is changed).
When trying to save such a massive edit, the backend often hits a timeout (502/504). I suspect the root cause is the Diff calculation between the old and new versions, which becomes extremely expensive under these two conditions combined.
Closing this one as the discussion continues over at
When editing and saving extremely long posts (around 100,000 characters), we encountered a backend timeout issue. The server becomes unresponsive during the save operation, resulting in 502/504 errors. The frontend console shows the following error stack:
ajax-error.js:36:15
l ajax-error.js:36
u ajax-error.js:75
d ajax-error.js:84
Ember 41
update rest.js:72
update rest.js:72
save rest.js:115
editPost composer.js:1147
Ember 6
I performed some comparative tests which suggest the bottleneck is in…