Bug 853848 - log-delete doesn't handle 301 redirects
Summary: log-delete doesn't handle 301 redirects
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-03 06:32 UTC by Dan Callaghan
Modified: 2019-05-22 13:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-11 23:49:49 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2012-09-03 06:32:29 UTC
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 06:34:52 UTC
However this does work with 302 redirects (i.e http->https).

Comment 2 Raymond Mancy 2012-09-04 04:24:25 UTC
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 04:34:03 UTC
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 06:59:12 UTC
On Gerrit: http://gerrit.beaker-project.org/1316

Comment 8 Dan Callaghan 2012-10-11 23:49:49 UTC
Beaker 0.9.4 has been released.


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