Project

Profile

Help

Issue #2510

closed

django logs warning when responding with 404

Added by mhrivnak over 7 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.11.1
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Sprint 13
Quarter:

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.

Actions #1

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

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.

https://pulp.plan.io/issues/2510 fixes #2510

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.

https://pulp.plan.io/issues/2510 fixes #2510

Actions #2

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.

https://github.com/pulp/pulp/pull/2904

Actions #3

Updated by mhrivnak over 7 years ago

  • Status changed from POST to MODIFIED
Actions #4

Updated by semyers over 7 years ago

  • Platform Release set to 2.11.1
Actions #5

Updated by semyers over 7 years ago

  • Status changed from MODIFIED to 5
Actions #6

Updated by semyers over 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #7

Updated by mhrivnak over 7 years ago

This fix is 100% relevant to Pulp 3.

Actions #8

Updated by bmbouter about 6 years ago

  • Sprint set to Sprint 13
Actions #9

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (31)
Actions #10

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF