I am getting 'Due to existing settings, could not track when a redirect is used, so could not remove unused redirects.' in my log on every cron run. I looked at the comment where this message is logged, but am still not sure why I'm seeing this message. This message was added in #2308717: Add watchdog message when unable to delete redirects.
$conf['page_cache_invoke_hooks'] is not set to FALSE in my settings.php. The Redirect settings are:
ON - Automatically create redirects when URL aliases are changed.
ON - Retain query string through redirect.
Default redirect status - 301 Moved Permanently
OFF - Allow redirects to be saved into the page cache.
Delete redirects that have not been accessed for - 1 month
Are my settings unusual in some way? How can I enable removal of unused redirects?
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 2516740-fix-purge-watchdog-logic.patch | 1.82 KB | dave reid |
| #16 | 2516740-fix-purge-watchdog-logic.patch | 665 bytes | dave reid |
| #12 | redirect-n2516740-12.patch | 1.09 KB | damienmckenna |
| #5 | 2516740-no-warning-if-no-purge-interval.patch | 770 bytes | dave reid |
Comments
Comment #1
dncreative commentedDid this just start happening for you? I've just noticed it filling the logs on a site today.
Comment #2
dave reidCan anyone please screenshot their /admin/config/search/redirect/settings page for me?
Comment #3
agoradesign commentedHere's a screenshot - I'm having the same problem!
Comment #4
dave reidAh, it's due to the 'Do not discard' setting, which is actually the default value. I guess we shouldn't be displaying a watchdog message in that case, since it is pretty common.
Comment #5
dave reidComment #7
philyUnfortunately for comment #4, I use "Discard after 3 months" setting (see attached screen capture) and the message still appears (patch not applied):
PS: auto redirects is disable for dev purposes.
Comment #8
damienmckennaI don't think there's any point in logging the message, it's just noise.
This patch removes the message and appends a note to the option on the settings form indicating that the page_cache_invoke_hooks variable defaults to TRUE.
Comment #9
philySure, there is more relevant things to fix ;-)
Comment #10
agoradesign commentedI agree with Damien, that logging this is just noise. A good description on the settings page should be enough!
Comment #11
dave reidConsidering this was requested by users in the first place, obviously not having a message wasn't enough. Please try out the dev release which should get rid of this message if you have the 'expire redirects' setting disabled (which is the default).
Comment #12
damienmckenna@Dave Reid: Ah, ok, reasonable enough.
This patch just adds an indication on the settings page that the variable is set to TRUE by default.
Comment #13
socialnicheguru commenteddoes 12 remove the watchdog reference?
Comment #14
brad.bulger commentedthis was odd. i applied the patch, but continued to get errors on cron runs (executed from crontab) until i logged in to the site in a browser and hit Save on the Redirect settings page. without changing anything. now it seems to have stopped.
i am not following this part:
doesn't
!variable_get('redirect_page_cache', 0)mean that serving redirects from the page cache is not enabled?Comment #15
brad.bulger commentedthe reason for the odd behavior described in 14 is that redirect_purge_inactive was set to '4838400' which is not zero but also not a currently allowed value. so the settings form defaults to zero, and saving it prevents the cron due to the change in the patch.
i still don't follow the logic of that watchdog warning, nor does the message itself convey any meaning to me particularly, but it looks like it's working correctly on its own terms with that fix.
Comment #16
dave reidAh, I think I know how this needs to be fixed. We should be displaying this message only if: saving redirects to the page cache is enabled and the page_cache_invoke_hooks variable is set to FALSE. This does not match the current logic.
Patch attached for review.
Comment #17
dave reidCombined with improved message in the settings form.
Comment #18
dave reidTested and committed #17 to 7.x-1.x.
Comment #20
damienmckennaWoot! :-)