Bug 865265 - Beaker allows "duplicate" logs with different but equivalent path components
Summary: Beaker allows "duplicate" logs with different but equivalent path components
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.10.0
Assignee: Dan Callaghan
QA Contact: Qixiang Wan
URL:
Whiteboard: LogStorage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-11 05:41 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-22 06:43:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2012-10-11 05:41:07 UTC
It's possible to have two "different" logs which equate to the same filesystem path, such as:

+----------+----------------+------+-------------+---------------------+
| id       | recipe_task_id | path | filename    | start_time          |
+----------+----------------+------+-------------+---------------------+
| 61093855 |        7194525 | /    | TESTOUT.log | 2012-08-01 08:17:34 |
| 61095279 |        7194525 |      | TESTOUT.log | 2012-08-01 08:38:09 |

These are really both pointing at the same log file, and will appear in the web UI as two separate hyperlinks to the same URL. More seriously, it will confuse beaker-transfer which will end up trying to link the same file twice:

2012-10-11 00:05:49 [ERROR   ] {  322} bkr.labcontroller.proxy:346 unable to hardlink /var/www/beaker/logs/tasks/7676703//TESTOUT.log to
/var/www/beaker/logs/tmpMj2bFJ/2012/08/2855/285510/613630/7676703//TESTOUT.log, [Errno 17] File exists

We should probably apply some better normalisation to path and filename on the server side before saving the rows, to avoid such duplicates.

Comment 2 Dan Callaghan 2012-10-31 07:59:53 UTC
On Gerrit: http://gerrit.beaker-project.org/1454

Comment 3 Qixiang Wan 2012-11-14 02:33:54 UTC
Verified with build 0.9.4-2.git.104.1433411.

Reproduced by something like:

s = xmlrpclib.ServerProxy('%s:8000/RPC2' % os.environ['LAB_CONTROLLER'])
s.task_upload_file(task_id, '', 'RHBZ865265', len(task_log), task_log_md5, 0, task_log_enc)
s.task_upload_file(task_id, '/', 'RHBZ865265', len(task_log), task_log_md5, 0, task_log_enc)
s.result_upload_file(result_id, '', 'RHBZ865265RECIPE', len(recipe_log), recipe_log_md5, 0, recipe_log_enc)
s.result_upload_file(result_id, '/', 'RHBZ865265RECIPE', len(recipe_log), recipe_log_md5, 0, recipe_log_enc)

Before the fix, there are duplicate recipe/task logs with different but equivalent path. The patch fixes this issue by normalizing the "" path to "/", so there is no duplicate logs now.

Comment 4 Raymond Mancy 2012-11-22 06:43:53 UTC
This has now been released


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