Bug 853848 - log-delete doesn't handle 301 redirects
log-delete doesn't handle 301 redirects
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: scheduler (Show other bugs)
0.9
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.9.4
: ---
Assigned To: Dan Callaghan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-03 02:32 EDT by Dan Callaghan
Modified: 2012-10-11 19:49 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-11 19:49:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Callaghan 2012-09-03 02:32:29 EDT
Description of problem:
log-delete doesn't handle 301 redirects properly.

Version-Release number of selected component (if applicable):
0.9.2

How reproducible:
always

Steps to Reproduce:
1. Attempt to delete logs from a location which returns a 301 redirect (e.g. a directory without trailing slash)
  
Actual results:
2012-09-03 16:08:14,272 bkr.server.tools.log_delete ERROR HTTP Error 401: Authorization Required

Expected results:
Should follow the redirect and issue the DELETE for the new location.
Comment 1 Raymond Mancy 2012-09-03 02:34:52 EDT
However this does work with 302 redirects (i.e http->https).
Comment 2 Raymond Mancy 2012-09-04 00:24:25 EDT
Are you sure it's not an actual 401 that is causing the problem?

I was doing some deletes and the logs look like this.

10.64.25.186 - - [03/Sep/2012:22:08:15 +1000] "DELETE /beaker/logs/results/2898 HTTP/1.1" 301 418 "-" "Python-urllib/2.6"
10.64.25.186 - - [03/Sep/2012:22:08:15 +1000] "DELETE /beaker/logs/results/2898/ HTTP/1.1" 204 - "-" "Python-urllib/2.6"
10.64.25.186 - - [03/Sep/2012:22:08:15 +1000] "DELETE /beaker/logs/results/2899 HTTP/1.1" 301 418 "-" "Python-urllib/2.6"
10.64.25.186 - - [03/Sep/2012:22:08:15 +1000] "DELETE /beaker/logs/results/2899/ HTTP/1.1" 204 - "-" "Python-urllib/2.6"
Comment 3 Dan Callaghan 2012-09-04 00:34:03 EDT
No, that doesn't work for me. log-delete authenticates properly for the first request (the one that gives a 301) but it doesn't authenticate properly on the second (redirected) request:

10.64.25.67 - - [04/Sep/2012:14:32:24 +1000] "DELETE /archive/2012/09/0/94/94 HTTP/1.1" 401 525 "-" "Python-urllib/2.6"
10.64.25.67 - HTTP/hostname@REALM [04/Sep/2012:14:32:24 +1000] "DELETE /archive/2012/09/0/94/94 HTTP/1.1" 301 421 "-" "Python-urllib/2.6"
10.64.25.67 - - [04/Sep/2012:14:32:25 +1000] "DELETE /archive/2012/09/0/94/94/ HTTP/1.1" 401 525 "-" "Python-urllib/2.6"
Comment 4 Dan Callaghan 2012-09-04 02:59:12 EDT
On Gerrit: http://gerrit.beaker-project.org/1316
Comment 8 Dan Callaghan 2012-10-11 19:49:49 EDT
Beaker 0.9.4 has been released.

Note You need to log in before you can comment on or make changes to this bug.