Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1116060

Summary: Problem while deploy a package with error in %pre
Product: [Retired] Pulp Reporter: Yann Renard <renard.yann>
Component: async/tasksAssignee: Jeff Ortel <jortel>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.3CC: jortel, pthomas, rbarlow, renard.yann
Target Milestone: ---   
Target Release: 2.5.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-24 21:33:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test RPM none

Description Yann Renard 2014-07-03 15:46:38 UTC
Description of problem:
When I try to deploy a package with a exit code in %pre the Pulp server bug


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

How reproducible:
Steps to Reproduce:
1.Create a package with exit 8 in %pre
2.Deploy the package to the client

Actual results:
With yum (client log) : 
Error in PREIN scriptlet in rpm package da.soc.yanntest2-1.0-1.noarch

[script.pre] BEGIN

Oups
error: %pre(da.soc.yanntest2-1.0-1.noarch) scriptlet failed, exit status 8
error:   install: %pre scriptlet failed (2), skipping da.soc.yanntest2-1.0-1

Failed:
  da.soc.yanntest2.noarch 0:1.0-1                                               

Complete!
Not removing old transaction files

With pulp (server log) : 
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
Running Transaction                     [ FAILED ]
       Error: Error in PREIN scriptlet in rpm package

The task never end and I cannot do anything. If I cancel the task and try to deploy another package I have this message :

An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/admin.log.

Admin.log : 
2014-07-03 17:44:38,827 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.6/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.6/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/client/commands/consumer/content.py", line 115, in run
    self.poll([task], kwargs)
  File "/usr/lib/python2.6/site-packages/pulp/client/commands/polling.py", line 146, in poll
    self.failed(task)
  File "/usr/lib/pulp/admin/extensions/rpm_admin_consumer/package.py", line 182, in failed
    details = task.result['details'][TYPE_ID_RPM]['details']
KeyError: 'details'

Expected results:
I would except the running transaction say FAILED one time and that's all

Additional info:
I need to unregister and reboot both client and server to deploy again on this client

Comment 1 Jeff Ortel 2014-07-15 16:55:57 UTC
Fixed in 2.4.0

https://github.com/pulp/pulp_rpm/pull/526

Comment 2 Jeff Ortel 2014-07-15 20:31:10 UTC
Created attachment 918248 [details]
Test RPM

The source RPM for a package that has a scripting error in %pre.

Comment 3 Jeff Ortel 2014-07-15 20:33:02 UTC
[jortel@localhost pulp_rpm]$ pulp-admin rpm consumer package install run --consumer-id=jortel -n jortel
Install task created with id [ 02efab17-bbb9-4b55-b151-05d4ac0b6dc4 ]

This command may be exited via ctrl+c without affecting the request.

Refresh Repository Metadata             [ OK ]
Downloading Packages                    [ OK ]
Check Package Signatures                [ OK ]
Running Test Transaction                [ OK ]
Running Transaction                     [ FAILED ]
   Verifying: jortel-1.0.0-1.fc20.noarch

Install Failed

+----------------------------------------------------------------------+
                                 Failed
+----------------------------------------------------------------------+

Name:    jortel
Version: 1.0.0
Arch:    noarch
Repoid:  test

Comment 4 Jeff Ortel 2014-10-07 16:52:04 UTC
Testing using the included source rpm:

- install the source rpm.
- cd ~/rpmbuild
- rpmbuild -ba SPECS/jortel.spec
- upload RPMS/x86_64/jortel-1.0.0-1.fc20.x86_64.rpm into pulp.
- using pulp, install the rpm.

Comment 5 Jeff Ortel 2014-10-07 16:53:19 UTC
you can use -bb to just build the binary rpm.

Comment 6 Preethi Thomas 2014-10-07 21:14:28 UTC
[root@cloud-qe-15 ~]# rpm -qa pulp-server
pulp-server-2.5.0-0.7.beta.el7.noarch
[root@cloud-qe-15 ~]# 


[root@cloud-qe-15 ~]# pulp-admin rpm consumer package install run --consumer-id f20-pulp -n jortel
Install task created with id [ 80f3c830-746f-4afd-97ca-3d70ef7aa41e ]

This command may be exited via ctrl+c without affecting the request.

Refresh Repository Metadata             [ OK ]
Downloading Packages                    [ OK ]
Check Package Signatures                [ OK ]
Running Test Transaction                [ OK ]
Running Transaction                     [ FAILED ]
   Verifying: jortel-1.0.0-1.el7.noarch

Install Failed

+----------------------------------------------------------------------+
                                 Failed
+----------------------------------------------------------------------+

Name:    jortel
Version: 1.0.0
Arch:    noarch
Repoid:  bz116060



[root@cloud-qe-15 ~]#

Comment 7 Randy Barlow 2014-10-22 20:39:51 UTC
Preethi,

The target release on this bug is 2.4.0, but it looks like it was verified with 2.5.0. Should we change the target release to 2.5.0, or should we re-verify it with 2.4.0?