Bug 1232916 - koji download-logs does nothing
Summary: koji download-logs does nothing
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: koji
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-17 19:50 UTC by Martin Sebor
Modified: 2015-12-02 18:09 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-02 13:52:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Sebor 2015-06-17 19:50:45 UTC
Description of problem:
The koji download-logs command does nothing.  It doesn't download any logs and silently exits with a status of zero.

Version-Release number of selected component (if applicable):
1.8-1.fc21, 1.9-1.el7eng 

How reproducible:
Always.

Steps to Reproduce:

1) Verify build exists:
$ koji buildinfo 609974
BUILD: gcc-5.0.0-0.10.fc22 [609974]
State: COMPLETE
Built by: jakub
Volume: DEFAULT
Task: 8873518 build (rawhide, /gcc:c728afb1bb6ec7eff86c12791d8c2f2b7af0f1c0)
Finished: Tue, 10 Feb 2015 08:27:57 EST
Tags: ...

2) Attempt to download logs:
$ (set -x && curl -O -s http://koji.fedoraproject.org/koji/buildinfo?buildID=609974 && koji download-logs -r 609974 && echo $? && ls -la)+ curl -O -s 'http://koji.fedoraproject.org/koji/buildinfo?buildID=609974'
+ koji download-logs -r 609974
+ echo 0
0
+ ls --color=auto -la
total 2804
drwxr-xr-x. 2 msebor devel       53 Jun 17 15:43 .
drwxr-xr-x. 4 msebor msebor    4096 Jun 17 15:39 ..
-rw-r--r--. 1 msebor devel    49060 Jun 17 15:43 buildinfo?buildID=609974
-rw-r--r--. 1 msebor devel  2818048 Jun 17 15:42 build.log

Actual results:
No logs downloaded.

Expected results:
Either all logs should be successfully downloaded or a descriptive error message should printed and the tool should exit with a non-zero status indicating the nature of the failure.

Comment 1 Mike McLean 2015-06-17 20:06:32 UTC
Problem one: download-logs is expecting a task id, not a build id. The *task* 609974 is a createrepo task from 2008 and its logs are long since deleted.

Problem two: download-logs can really only download logs from a task. You can give it an nvr, but it will then look up the associated task and pull the logs that way. This is fine while the task is running and for a while afterwards (depending on how aggressively the koji admin is cleaning the work dir), but at some point the logs will be gone. For /builds/, they are also copied to the build dir, but there is currently not a way in the api to get at those.

So, if you want the logs for a running build or recently completed build, you should be find if you give the command the right options.

If otoh, you want to download logs for an older build, that would be an rfe.

I agree that the command should be clearer in the no-logs case. I'm not convinced that it should exit non-zero if there are no logs to download.

Comment 2 Martin Sebor 2015-06-17 20:26:15 UTC
Thanks for the clarification.  I started out with a task-id for a Brew build and following the instructions in DOC-1001157 (https://mojo.redhat.com/docs/DOC-1001157) but it didn't download anything (see below) so I tried koji.fedoraproject.org if it worked there and used a build-id instead of a task-id.

The task below and the logs are still available via BrewWeb:
https://brewweb.devel.redhat.com/taskinfo?taskID=9379998

$ (t=9379998; /home/remote/msebor/bin/brew taskinfo $t && /home/remote/msebor/bin/brew download-logs $t && ls -la)
Task: 9379998
Type: build
Owner: msebor
State: closed
Created: Wed Jun 17 14:08:56 2015
Started: Wed Jun 17 14:09:03 2015
Finished: Wed Jun 17 15:44:41 2015
Host: x86-025.build.eng.bos.redhat.com
Build: glibc-2.17-93.el7 (442281)

total 4
drwxr-xr-x. 2 msebor devel     6 Jun 17 16:22 .
drwxr-xr-x. 4 msebor msebor 4096 Jun 17 16:22 ..

Comment 3 Mike McLean 2015-06-17 21:11:07 UTC
(In reply to Martin Sebor from comment #2)
> $ (t=9379998; /home/remote/msebor/bin/brew taskinfo $t &&
> /home/remote/msebor/bin/brew download-logs $t && ls -la)

missing -r option. The build task has no logs of its own, so you need to recurse down to the child tasks.

With -r, appears to work for me.

> Task: 9379998
> Type: build
> Owner: msebor
> State: closed
> Created: Wed Jun 17 14:08:56 2015
> Started: Wed Jun 17 14:09:03 2015
> Finished: Wed Jun 17 15:44:41 2015
> Host: x86-025.build.eng.bos.redhat.com
> Build: glibc-2.17-93.el7 (442281)
> 
> total 4
> drwxr-xr-x. 2 msebor devel     6 Jun 17 16:22 .
> drwxr-xr-x. 4 msebor msebor 4096 Jun 17 16:22 ..

Comment 4 Martin Sebor 2015-06-17 21:35:48 UTC
I see. Thanks again for your help!

It sure would be nice if the tool gave some indication that a) the id it was given was a build-id and not a task-id, and b) that no logs have been downloaded because the -r option wasn't specified.

Comment 5 Carlos O'Donell 2015-06-18 13:26:57 UTC
(In reply to Martin Sebor from comment #4)
> I see. Thanks again for your help!
> 
> It sure would be nice if the tool gave some indication that a) the id it was
> given was a build-id and not a task-id, and b) that no logs have been
> downloaded because the -r option wasn't specified.

Agreed, this needs a better error message. I had the same problem, and then simply wrote a script to fetch the logs. We should avoid such duplication of work by making the tool more intelligent.

Comment 6 Fedora End Of Life 2015-11-04 11:24:36 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Fedora End Of Life 2015-12-02 13:52:35 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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