When loading the split fields with the diff module, an author will receive 500 error if an endless loop occurs between revisions.
In which we see the following message in Drupal watchdog:
E_ERROR: Maximum execution time of 300 seconds exceeded
Stack trace
…/docroot/modules/contrib/diff/src/Controller/PluginRevisionController.php (253)
…/docroot/modules/contrib/diff/src/Controller/PluginRevisionController.php (154)
…/docroot/modules/contrib/diff/src/Controller/NodeRevisionController.php (49)
Local we see the following message `Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 58724352 bytes) in Unknown on line 0.`
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | diff-500-errors-possible-infinite-loop-3033455-2-d8.patch | 991 bytes | mrossi113 |
Issue fork diff-3033455
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3033455-2.x
changes, plain diff MR !118
- 3033455-500-error-possible
compare
- 8.x-1.x
changes, plain diff MR !60
Comments
Comment #2
mrossi113 commentedComment #3
brentschuddinck commentedI had a similar issue. When comparing 2 revisions, the page keeps loading and results in an error 500.
Drupal version: 8.6.10
Diff module version: 8.x-1.0-rc2
I haven't had the time to check this out in detail, but In my case, the problem was fixed by updating the module dependencies (without applying the patch above)
composer update drupal/diff --with-dependenciesThis removed sunra/php-simple-html-dom-parser and installed kub-at/php-simple-html-dom-parser (v1.8.1) and updates caxy/php-htmldiff (v0.1.7 => v0.1.9).
Comment #4
moshe weitzman commentedComment #5
olli commentedI was able to reproduce this with simplytest.me:
Patch #2 seems to fix it, thank you!
Comment #6
tuuuukka commented#2 fixed it for us, thanks!
Comment #7
acbramley commentedThanks for the work on this one. I've recently taken up maintainership of this project and am looking through the RTBC issues.
I can't reproduce this issue following the steps in #5
To get this in, I'll need the patch on an MR against the latest 8.x-1.x code with tests added if possible.
Thanks!
Comment #10
silvi.addweb commentedHello, I have raised MR for the same.
Comment #11
acbramley commentedComment #12
berdirStumbled over this as well, what happened in our case is that a user used the language switcher while on the diff page, but those revisions had nothing useful in the other language and are more recent than any existing revisions in that language, so it basically looped into infinity and wrote about 1GB of database logs.
Raising priority because this has the possibility to take down a site if a user is confused and tries that a few times. There's also an old I think duplicate issue that was closed incorrectly (#2939631: Infinite loop found in PluginRevisionController) and the somewhat related #3360589: TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count()
Comment #14
berdirI created a new MR with a test for 2.x. As this says, this doesn't produce an error, it's while loop into infinity, so it will hit the max execution time limit at some point, if that's actually set at all.
The result is also a bit weird, the navigation links aren't actually useful, it might be more correct to not show them. but this is certainly better than the current behavior.
Comment #18
heddnThis has tests and multiple folks have manually tested this. LGTM.
Comment #19
heddn