Problem/Motivation
Hi, thanks for this amazing module. It's really helpful :-)
On a multi-language site, there are errors popping up in watchdog looking for updated translations which are 404ing.
Example (Korean):
http://ftp.drupal.org/files/translations/8.x/twig_tweak/twig_tweak-8.x-1...
This is the only contrib module I have installed that is getting this error, and the others definitely don't have any translations. So, there's something going on with this module that is actively looking to find non-existent translations for all languages active on the site.
Steps to reproduce
Proposed resolution
TBA See #31
Remaining tasks
Issue Summary update to explain the solution chosen
Respond to #19
Add a test
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#25 | locale-localization_update_404-2879998-25.patch | 1.03 KB | ckaotik |
#9 | locale-add_ignore_404_option-2879998-9.patch | 4.13 KB | Ben Buske |
Issue fork drupal-2879998
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:
Comments
Comment #2
Chi CreditAttribution: Chi commentedMaybe it's because the module has no translatable strings.
Comment #3
sgp913 CreditAttribution: sgp913 commentedI understand that. That's why I made this bug report since for some reason it wants to update all the languages and is throwing errors.
Comment #4
Chi CreditAttribution: Chi commentedThis module has nothing to do with language updates.
Moving to Core issue queue.
Comment #6
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedI confirm that this error occurs when there are no translation for a module available. There are (currently) no translations for Twig Tweaks in Korean. This will typically happen with languages that only have a small amount of translations.
Localization Update module has a facility to exclude modules from being translated. Perhaps this should be made available for Drupal 8 too.
Comment #8
ckaotikThe problem we have with this is that it spams up our watchdog for each custom and contrib module without translations, because it prints the error message (notice) on every cron run, regardless of update check frequency.
I found this little gem in the
locale_translation_batch_status_check
function that runs before the update files are downloaded:This causes a LOT of noise and makes monitoring the site's health unnecessarily difficult.
Comment #9
Ben Buske CreditAttribution: Ben Buske at werk21 commentedHere is a patch that adds an option to completly prevent the notice in logs. While it is not the optimal version where the notice is omitted for some period of time, it is a solution to the problem. To know what files couldn't be loaded you can enable the option and run the cron.
Comment #10
Ben Buske CreditAttribution: Ben Buske at werk21 commentedsorry forgot to change status
Comment #12
AnybodyThank you very much, I think this is a good option and the current situation is messing up logs. RTBC +1! Let's please have some more feedback.
Comment #13
AnybodyI'll now RTBC this because it is a working solution and better than the current situation. If someone from the core developers has a different way to go, please reset the status. Otherwise let's get this forward. It's spamming our logs...
Comment #14
Gábor HojtsyThis seems to be a very specific feature for a very specific problem you are having and looks like a random option on the UI. Are other logs of the module not so noisy?
Why is the module checking the nonexistent file on all crons even if the frequency of checking is not set up to happen that often? The solution proposed here sounds like would mask that larger question that may result in other wastes of resources.
Comment #15
Gábor HojtsyAlso retitling for accuracy about the problem.
Comment #16
Ben Buske CreditAttribution: Ben Buske at werk21 commentedOther log messages of this module rarely ever show up. In fact the only other log that is somewhat similar noisy is cron with the message "Cron run completed.". And for X custom modules or untranslated modules, you get X-times more messages. Sscores of pages we host have over 90% of the log messages only this message.
In the module is this comment:
As I understand it, it is not realy seen as an error which makes it even more unnecessary of a flood of logs.
You are right, except I don't think only a few people having this problem. It is managable to ignore this, but the more custom modules are used the noisier the module. Unfortunally I didn't found a better place for this.
Currently it only saves the time of the last check if no error ocurred. As the module says:
I'll look into using the set time limit on 404 errors, also to cut down on request while cron run.
And maybe an option to aggregate the messages into a single message, stating what modules got a 404-error.
Do you think that would be a more fitting solution?
Comment #17
Ben Buske CreditAttribution: Ben Buske at werk21 commentedI think it's worth metioning that, if you have 10 custom modules and the crun runs every 10 minutes (and we have also systems where it runs every 5) this alone produces 1,440 log messages per day.
Comment #18
AnybodyAny progress on this? I'd like to confirm my +1 on RTBC...
Comment #19
Gábor HojtsyLooks like there are various possibilities that themselves would cut down on logging noise without adding a one-off configuration option, eg. don't even try to find translation files for custom modules (if we can identify custom modules vs. contrib modules) or update the checking date even if the file was not found, so it is not checked too often.
Comment #23
jungleTypo in title
Comment #24
jungleAdding tags
Comment #25
ckaotikI've added a patch that addresses the "What to do with when the file is not found (404)?" comment and prevents repeated checking of translations until the update timer expires. I don't think this is really the final solution we're looking for, but it helps reduce the log noise.
I quite like this suggestion by @ben-buske in #16, a single message per cron run would help a lot and keep the information visible. Something listing projects that completely failed with 404 and projects for which only some languages failed, e.g. "Translation file not found for myproject, myotherproject, someproject (de, fr).".
A starting point might be to set
$failure = TRUE;
in case of 404 as well, and somehow collectively handle that inDrupal\locale\Plugin\QueueWorker\LocaleTranslation
.Edit: You should be able to use both #9 (offers configuration to suppress messages) and #25 (prevents requesting files every cron, regardless of TTL) together.
Comment #27
prudloff CreditAttribution: prudloff at Insite commentedBesides log messages, this also makes the cron longer because of the frequent HTTP requests, so caching the 404 helps with that as well.
Comment #30
AnybodyAs logs are still being filled up with this, I'd vote for a commit of #25 by ckaotik to mitigate the problem. I personally like #9, but that's not my choice. So after using #25 and #9 for over two years now, I'll mark #25 RTBC and hope we can proceed to discuss #9 to get this whole issue solved soon.
Thanks a lot, all!
Comment #31
quietone CreditAttribution: quietone at PreviousNext commentedThis needs an Issue Summary update to outline the various solutions discussed, and patches made for (#9), and why #25 what chosen. In #19 @Gábor Hojtsy mentions other changes that could be made - should followups be made to discuss those options?
The 8.9.x patch is being tested every two days - that needs to be changed to 9.4.x
This is also tagged for tests but there are none in the latest patch.
Therefor setting to NW.
Comment #33
smustgrave CreditAttribution: smustgrave at Mobomo commentedMoving to PNMI based on #31
Comment #35
quietone CreditAttribution: quietone at PreviousNext commentedI don't understand why this is postponed based on my comment in #31. In that comment I think I outlined the work that needs to be done here next. I am setting back to needs works.
Comment #37
heddnI like where this is going. But why are we so worried about removing these noisy log messages? I've got a 40+ language website that we have a full install profile test suite setup. For me, the issue is deeper. Because we do a foreach on each module in each language, testing and installing the site from configuration takes a _really_ long time. In addition to logging to drush or watchdog, it would be nice to use async guzzle and call each of the URLs in a shorter time frame. It would speed up downloads. I think we'd need to concern ourselves with some type of poor mans throttle so we don't send off 1000 URL requests, or even 100. That higher volume of traffic might cause performance issues on the localization servers.
Comment #38
AnybodySadly this needs another reroll for Drupal 10.2. Doesn't apply anymore.
Comment #41
sudishth CreditAttribution: sudishth as a volunteer and at Srijan | A Material+ Company for Drupal India Association, Srijan | A Material+ Company commentedCreated MR for 11.x
Comment #42
smustgrave CreditAttribution: smustgrave at Mobomo commented#31 mentions an issue summary update which is still needed.
Also test coverage.