Bug 682655 - task submitted shown correctly in command line, but haven't run in beaker acturally
Summary: task submitted shown correctly in command line, but haven't run in beaker act...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: scheduler
Version: 0.5
Hardware: All
OS: Linux
medium
low vote
Target Milestone: ---
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-07 06:43 UTC by yanfu,wang
Modified: 2019-05-22 13:39 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-29 07:13:27 UTC


Attachments (Terms of Use)
pynfs log on i386 (45.02 KB, application/octet-stream)
2011-04-01 09:07 UTC, yanfu,wang
no flags Details

Description yanfu,wang 2011-03-07 06:43:18 UTC
Description of problem:
I submitted job using below way, but task "/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" disappeared in beaker:
# bkr workflow-simple --arch=x86_64 --distro=RHEL6.1-20110224.2 --variant=server --whiteboard="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" --task=/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs --prettyxml --debug
<job>
	<whiteboard>
		/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs
	</whiteboard>
	<recipeSet priority="Normal" retention_tag="Scratch">
		<recipe ks_meta="method=nfs" whiteboard="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs">
			<distroRequires>
				<and>
					<distro_name op="=" value="RHEL6.1-20110224.2"/>
					<distro_variant op="=" value="server"/>
					<distro_arch op="=" value="x86_64"/>
				</and>
			</distroRequires>
			<hostRequires>
				<and/>
			</hostRequires>
			<repos/>
			<task name="/distribution/install" role="STANDALONE">
				<params/>
			</task>
			<task name="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" role="STANDALONE">
				<params/>
			</task>
		</recipe>
	</recipeSet>
</job>

Submitted: ['j:59413']


The task "/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" shown correct in command line, but disappeared in xml by checking web ui:
https://beaker.engineering.redhat.com/jobs/clone?job_id=59413


How reproducible:
always


Actual results:
/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs task lost, just do distribution install.

Expected results:
/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs task should be done in beaker.

Comment 1 Raymond Mancy 2011-03-07 06:47:28 UTC
RedHatEnterpriseLinux6 is an excluded arch for that task. Possibly the real error here is that it's showing no error...

Comment 2 Raymond Mancy 2011-03-07 06:55:26 UTC
Did I say arch? I meant Distro...

Comment 3 yanfu,wang 2011-03-07 07:05:16 UTC
(In reply to comment #2)
> Did I say arch? I meant Distro...

thanks, I've got it. 
So could it have any enhancement for it? e.g. get hint feedback from command line?

Comment 4 Bill Peck 2011-03-21 21:17:37 UTC
Dan,

How come ignore_missing tasks doesn't catch this?

Comment 5 Dan Callaghan 2011-03-22 01:01:41 UTC
(In reply to comment #4)
> How come ignore_missing tasks doesn't catch this?

You're thinking of the --ignore-missing-tasks option to bkr job-submit (bug 601174), which allows users to submit a job containing tasks which don't exist (normally this is an error). But this bug is about a task which is excluded from RHEL6 so Beaker is silently dropping it from the job, as it has always done.

We could make this bug an RFE to provide a warning for the excluded task, but that's not totally straightforward. For errors in job submission we return an XML-RPC fault, but right now we don't have any facility for returning warnings along with a successful job submission.

Comment 6 Dan Callaghan 2011-03-22 01:17:05 UTC
(In reply to comment #5)
> right now we don't have any facility for returning warnings
> along with a successful job submission.

What I really meant to say here is that we don't have any nice way of propagating warnings from deep inside _handleRecipe out to the caller to be returned to the user.

Comment 7 yanfu,wang 2011-04-01 09:07:59 UTC
Created attachment 489324 [details]
pynfs log on i386

Comment 8 yanfu,wang 2011-04-01 09:12:55 UTC
(In reply to comment #7)
> Created attachment 489324 [details]
> pynfs log on i386

pls ignore above attachment, wrong upload.

Comment 9 Dan Callaghan 2011-04-14 04:52:42 UTC
With Bill's fix for bug 683913, this situation is now slightly improved: instead of submitting the job and the server silently discarding the excluded task, the client now prints a somewhat confusing error and bails out without submitting the job.

You must specify a package, type or task to run

Maybe we can make the client print a warning for each task that is being discarded because of exclusions. Then the error here should be clearer.

Comment 10 Dan Callaghan 2011-04-14 05:22:34 UTC
How about this?

diff --git a/Client/src/bkr/client/__init__.py b/Client/src/bkr/client/__init__.py
index fef0b18..8e11b68 100644
--- a/Client/src/bkr/client/__init__.py
+++ b/Client/src/bkr/client/__init__.py
@@ -263,6 +263,10 @@ def getTasks(self, *args, **kwargs):
         if kwargs.get("task", None):
             tasks = self.hub.tasks.filter(dict(names=kwargs.get('task'),
                                                osmajor=filter['osmajor']))
+            for dropped_task in set(kwargs['task']).difference(
+                    set(task['name'] for task in tasks)):
+                print >>sys.stderr, 'WARNING: task %s not applicable ' \
+                        'for distro, ignoring' % dropped_task
 
         if self.n_clients or self.n_servers:
             self.multi_host = True

It produces output like this:

WARNING: task /CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs not applicable for distro, ignoring
You must specify a package, type or task to run

Comment 11 yanfu,wang 2011-04-14 09:59:15 UTC
(In reply to comment #10)
> How about this?
> 
> diff --git a/Client/src/bkr/client/__init__.py
> b/Client/src/bkr/client/__init__.py
> index fef0b18..8e11b68 100644
> --- a/Client/src/bkr/client/__init__.py
> +++ b/Client/src/bkr/client/__init__.py
> @@ -263,6 +263,10 @@ def getTasks(self, *args, **kwargs):
>          if kwargs.get("task", None):
>              tasks = self.hub.tasks.filter(dict(names=kwargs.get('task'),
>                                                 osmajor=filter['osmajor']))
> +            for dropped_task in set(kwargs['task']).difference(
> +                    set(task['name'] for task in tasks)):
> +                print >>sys.stderr, 'WARNING: task %s not applicable ' \
> +                        'for distro, ignoring' % dropped_task
> 
>          if self.n_clients or self.n_servers:
>              self.multi_host = True
> 
> It produces output like this:
> 
> WARNING: task /CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs not
> applicable for distro, ignoring
> You must specify a package, type or task to run

I think it's ok for me.

Comment 13 yanfu,wang 2011-04-19 10:30:55 UTC
hi, 
seems I can't get the warning and the job submitted. Is there anything I miss?
# bkr workflow-simple --arch=x86_64 --distro=RHEL6.1-20110413.1 --variant=server --whiteboard="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" --task=/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs --prettyxml --debug
<job retention_tag="Scratch">
	<whiteboard>
		/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs
	</whiteboard>
	<recipeSet priority="Normal">
		<recipe ks_meta="method=nfs" whiteboard="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs">
			<distroRequires>
				<and>
					<distro_name op="=" value="RHEL6.1-20110413.1"/>
					<distro_variant op="=" value="server"/>
					<distro_method op="=" value="nfs"/>
					<distro_arch op="=" value="x86_64"/>
				</and>
			</distroRequires>
			<hostRequires>
				<and/>
			</hostRequires>
			<repos/>
			<task name="/distribution/install" role="STANDALONE">
				<params/>
			</task>
			<task name="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" role="STANDALONE">
				<params/>
			</task>
		</recipe>
	</recipeSet>
</job>

Submitted: ['j:2479']

# cat ~/.beaker_client/config 
#HUB_URL = "https://beaker.engineering.redhat.com"
HUB_URL="https://beaker-stage.app.eng.bos.redhat.com"
AUTH_METHOD = "krbv"
KRB_REALM = "REDHAT.COM"

# rpm -qa|grep beaker
beaker-0.6.7-2.el6.noarch
beaker-redhat-0.1.30-1.el6.noarch
beakerlib-redhat-1-2.el6.noarch
beaker-client-0.6.7-2.el6.noarch
beakerlib-1.3-3.el6.noarch
python-beaker-1.3.1-6.fc12.noarch

Comment 14 Marian Csontos 2011-04-19 11:29:24 UTC
(In reply to comment #13)
> hi, 
> seems I can't get the warning and the job submitted. Is there anything I miss?

Yes, there is: you need to use updated beaker client from beaker-stage and schedule your job against beaker-stage.

Comment 15 Marian Csontos 2011-04-19 11:34:09 UTC
And the culprit is beaker-stage repo, which does not contain the RPMs you need. 

Try the beaker-client from:

  https://brewweb.devel.redhat.com/buildinfo?buildID=162757

Comment 16 Marian Csontos 2011-04-19 12:43:12 UTC
The repo on stage was updated to contain the development beaker-client build.

Comment 17 yanfu,wang 2011-04-20 09:10:03 UTC
verified it work now as expect:
# bkr workflow-simple --arch=x86_64 --distro=RHEL6.1-20110413.1 --variant=server --whiteboard="/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs" --task=/CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs --prettyxml --debug
WARNING: task /CoreOS/samba/Security/CVE-2009-2948-suid-mount-cifs not applicable for distro, ignoring
You must specify a package, type or task to run


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