Issue #2510
closeddjango logs warning when responding with 404
Description
Steps to reproduce:
- sync and publish the repo found here with default settings: https://repos.fedorapeople.org/repos/pulp/pulp/fixtures/rpm/
- curl -k https://localhost/pulp/repos/repos/pulp/pulp/fixtures/rpm/helloworld
And observe in the system log:
Jan 03 20:20:31 dev pulp[3152]: django.request:WARNING: Not Found: /var/www/pub/yum/https/repos/repos/pulp/pulp/fixtures/rpm/helloworld
A warning should not be logged in this case, because there is no indication of a problem or failure within pulp. This only happens when a client requests a file that doesn't exist.
Users have seen this behavior (and been confused by it) when yum tries to access a ".treeinfo" file that doesn't exist. This is normal behavior and does not indicate any kind of failure in pulp.
Updated by mhrivnak over 7 years ago
This appears to be a reasonable fix, but needs more scrutiny to ensure the rest of pulp's logging is working as expected:
diff --git a/server/pulp/server/content/web/settings.py b/server/pulp/server/content/web/settings.py
index 2a1e51a..587cebe 100644
--- a/server/pulp/server/content/web/settings.py
+++ b/server/pulp/server/content/web/settings.py
@@ -40,6 +40,9 @@ LOGGING = {
'django': {
'handlers': ['syslog'],
},
+ 'django.request': {
+ 'level': 'ERROR',
+ },
}
}
Added by mhrivnak over 7 years ago
Added by mhrivnak over 7 years ago
Revision 251bf0a7 | View on GitHub
django.request log level changed to ERROR
django's normal behavior is to log at WARNING when it issues a 404 response to a client. That is not the behavior Pulp wants, because it does not indicate a failure in Pulp.
Updated by mhrivnak over 7 years ago
- Status changed from NEW to POST
- Assignee set to mhrivnak
- Sprint/Milestone set to 31
- Tags Easy Fix added
This was easy, so I'm tossing up a PR.
Updated by mhrivnak over 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|251bf0a71155104b35a5e46f670f68a9a295b46c.
Updated by semyers over 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
django.request log level changed to ERROR
django's normal behavior is to log at WARNING when it issues a 404 response to a client. That is not the behavior Pulp wants, because it does not indicate a failure in Pulp.
https://pulp.plan.io/issues/2510 fixes #2510