Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hentai-Foundry: Document tree depth limit exceeded #4657

Closed
evazion opened this issue Jan 5, 2021 · 1 comment
Closed

Hentai-Foundry: Document tree depth limit exceeded #4657

evazion opened this issue Jan 5, 2021 · 1 comment

Comments

@evazion
Copy link
Member

evazion commented Jan 5, 2021

Some Hentai-Foundry sources fail to upload. http://www.hentai-foundry.com/pictures/user/LumiNyu/867562/Mona-patreon-winner:

Document tree depth limit exceeded 
/var/www/danbooru/releases/20210101103615/app/logical/danbooru/http/html_adapter.rb:8:in `decode' 
/var/www/danbooru/releases/20210101103615/app/logical/sources/strategies/hentai_foundry.rb:70:in `page' 
/var/www/danbooru/releases/20210101103615/app/logical/sources/strategies/hentai_foundry.rb:41:in `image_urls' 
/var/www/danbooru/releases/20210101103615/app/logical/sources/strategies/base.rb:77:in `image_url' 
/var/www/danbooru/releases/20210101103615/app/logical/sources/strategies/hentai_foundry.rb:86:in `canonical_url' 
/var/www/danbooru/releases/20210101103615/app/logical/upload_service/preprocessor.rb:31:in `canonical_source' 
/var/www/danbooru/releases/20210101103615/app/logical/upload_service/preprocessor.rb:70:in `start!' 
/var/www/danbooru/releases/20210101103615/app/logical/upload_service/preprocessor.rb:61:in `block in delayed_start' 
/var/www/danbooru/releases/20210101103615/app/logical/current_user.rb:10:in `scoped' 
/var/www/danbooru/releases/20210101103615/app/logical/current_user.rb:24:in `as' 
/var/www/danbooru/releases/20210101103615/app/logical/upload_service/preprocessor.rb:60:in `delayed_start' 
/var/www/danbooru/releases/20210101103615/app/jobs/upload_preprocessor_delayed_start_job.rb:6:in `perform'
--

Caused by extremely deeply nested HTML tags in commentaries (see also #4477 (comment)).

@lllusion3469
Copy link
Collaborator

lllusion3469 commented Jan 5, 2021

It's only somewhat related: This seems to only be a problem with Nokogumbo's Nokogiri::HTML5 class. It's also possible to override or disable the limit via the max_tree_depth parameter (-1 disables it; default is 400).

@evazion evazion closed this as completed in 65be2c9 Jan 6, 2021
evazion added a commit that referenced this issue Sep 1, 2021
…ntaries.

Fix a regression in 38c9559 that caused #4657 to fail again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants