Project

Profile

Help

Issue #685

closed

pulp-consumer history --event-type unit_profile_changed causes traceback

Added by bmbouter about 9 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.6 Beta
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

1. Register a consumer
2. Bind that consumer to a repo
3. On the consumer run a yum command and install something
4. Try to list the history for the consumer to see the unit profile that yum reported
5. Observe that you get an error saying "An unexpected error has occurred. More information can be found in the client
log file ~/.pulp/consumer.log."
6. Observe that in ~/.pulp/consumer.log it contains this traceback:

2015-02-02 13:56:41,525 - ERROR - Client-side exception occurred
Traceback (most recent call last):
File "/home/bmbouter/Documents/pulp/client_lib/pulp/client/extensions/core.py", line 469, in run
exit_code = Cli.run(self, args)
File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
exit_code = command_or_section.execute(self.prompt, remaining_args)
File "/home/bmbouter/Documents/pulp/client_lib/pulp/client/extensions/extensions.py", line 211, in execute
return self.method(*arg_list, **clean_kwargs)
File "/home/bmbouter/Documents/pulp/client_consumer/pulp/client/consumer/cli.py", line 371, in history
kwargs['start-date'], kwargs['end-date']).response_body
File "/home/bmbouter/Documents/pulp/bindings/pulp/bindings/consumer.py", line 211, in history
return self.server.GET (path, queries)
File "/home/bmbouter/Documents/pulp/bindings/pulp/bindings/server.py", line 92, in GET
return self._request('GET', path, queries)
File "/home/bmbouter/Documents/pulp/bindings/pulp/bindings/server.py", line 150, in _request
self._handle_exceptions(response_code, response_body)
File "/home/bmbouter/Documents/pulp/bindings/pulp/bindings/server.py", line 191, in _handle_exceptions
raise code_class_mappings[response_code](response_body)
File "/home/bmbouter/Documents/pulp/bindings/pulp/bindings/exceptions.py", line 16, in init
self.href = response_body.pop('_href', None)
AttributeError: 'NoneType' object has no attribute 'pop'

I expected it to list a filtered version of the history by event type instead it shows nothing.

+ This bug was cloned from Bugzilla Bug #1188407 +

Actions #1

Updated by bmbouter about 9 years ago

  • Severity changed from High to 3. High
Actions #2

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com
Actions #3

Updated by ipanova@redhat.com about 9 years ago

  • Status changed from ASSIGNED to MODIFIED
  • Platform Release set to master

This issue was fixed during django conversion.
In order to verify this bug check 3 scenario:

a)
1. register consumer
2. Try to list the history for the consumer using --event-type unit_profile_changed.
You should see empty list and no traceback

b)
1. register consumer
2. bind that consumer to a repo
3. on the consumer run a yum command and install something
4. Try to list the history for the consumer using --event-type unit_profile_changed.
You should see normal output and no traceback

c)
1. register consumer
2. bind that consumer to a repo
3. trigger unit installation through consumer.
4. Try to list the history for the consumer using --event-type unit_profile_changed.
You should see normal output and no traceback

We see the failure due to 'unit_profile_chaned' event type not implemented. It will be fixed in https://pulp.plan.io/issues/829
I also noticed that other implemented event types also caused traceback when this type did not happen yet - so instead of empy list it would raise an error - this was fixed during django conversion.

Actions #4

Updated by rbarlow about 9 years ago

  • Platform Release changed from master to 2.7.0
Actions #5

Updated by dkliban@redhat.com almost 9 years ago

  • Status changed from MODIFIED to 5
Actions #7

Updated by pthomas@redhat.com almost 9 years ago

  • Status changed from 5 to 6

verified

[root@lenovo-x3850-02 ~]# pulp-admin rpm consumer bind --repo-id zoo --consumer-id el7
This command may be exited via ctrl+c without affecting the request.

[\]
Running...

Task Succeeded

[root@lenovo-x3850-02 ~]# pulp-consumer history --event-type unit_profile_changed
+----------------------------------------------------------------------+
                         Consumer History [el7]
+----------------------------------------------------------------------+

[root@lenovo-x3850-02 ~]# 
[root@lenovo-x3850-02 ~]# 
[root@lenovo-x3850-02 ~]# yum install cat
Loaded plugins: product-id, pulp-profile-update, subscription-manager
rhel-7-server-extras-rpms                                | 2.9 kB     00:00     
rhel-7-server-rpms                                       | 3.7 kB     00:00     
zoo                                                      | 2.1 kB     00:00     
(1/3): zoo/updateinfo                                      |  572 B   00:00     
(2/3): zoo/primary                                         | 3.6 kB   00:00     
(3/3): zoo/group                                           | 1.9 kB   00:00     
zoo                                                                       32/32
Resolving Dependencies
--> Running transaction check
---> Package cat.noarch 0:1.0-1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package          Arch                Version            Repository        Size
================================================================================
Installing:
 cat              noarch              1.0-1              zoo              2.4 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 2.4 k
Installed size: 42  
Is this ok [y/d/N]: y
Downloading packages:
cat-1.0-1.noarch.rpm                                       | 2.4 kB   00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : cat-1.0-1.noarch                                             1/1 
pulp: profile sent, status=201
  Verifying  : cat-1.0-1.noarch                                             1/1 

Installed:
  cat.noarch 0:1.0-1                                                            

Complete!
[root@lenovo-x3850-02 ~]# pulp-consumer history --event-type unit_profile_changed
+----------------------------------------------------------------------+
                         Consumer History [el7]
+----------------------------------------------------------------------+

Consumer Id:  el7
Type:         unit_profile_changed
Details:      
  Profile Content Type: rpm
Originator:   SYSTEM
Timestamp:    2015-07-10T16:27:29Z

[root@lenovo-x3850-02 ~]# pulp-admin rpm consumer 
Usage: pulp-admin [SUB_SECTION, ..] COMMAND
Description: register, bind, and interact with rpm consumers

Available Sections:
  errata        - errata installation management
  group         - consumer group commands
  package       - package installation management
  package-group - package group installation management

Available Commands:
  bind   - binds a consumer to a repository
  unbind - removes the binding between a consumer and a repository
[root@lenovo-x3850-02 ~]# pulp-admin rpm consumer  package install
Usage: pulp-admin [SUB_SECTION, ..] COMMAND
Description: run or schedule a package installation task

Available Sections:
  schedules - manage consumer package install schedules

Available Commands:
  run - triggers an immediate package install on a consumer
[root@lenovo-x3850-02 ~]# pulp-admin rpm consumer  package install run 
Command: run
Description: triggers an immediate package install on a consumer

Available Arguments:

  --bg          - if specified, the client process will end immediately (the
                  task will continue to run on the server)
  --consumer-id - (required) unique identifier; only alphanumeric, ., -, and _
                  allowed
  --name, -n    - (required) package name; may repeat for multiple packages
  --no-commit   - test the transaction without committing it
  --reboot      - reboot after a successful transaction
  --import-keys - import GPG keys as needed
The following options are required but were not specified:
  --consumer-id
  --name
[root@lenovo-x3850-02 ~]# pulp-admin rpm consumer  package install run  --consumer-id el7 --name dog
Install task created with id [ 435d5511-9c20-4562-84d4-69da0907e0fc ]

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                     [ OK ]

Install Succeeded

+----------------------------------------------------------------------+
                               Installed
+----------------------------------------------------------------------+

Name:    dog
Version: 4.23
Arch:    noarch
Repoid:  zoo

[root@lenovo-x3850-02 ~]# pulp-consumer history --event-type unit_profile_changed
+----------------------------------------------------------------------+
                         Consumer History [el7]
+----------------------------------------------------------------------+

Consumer Id:  el7
Type:         unit_profile_changed
Details:      
  Profile Content Type: rpm
Originator:   SYSTEM
Timestamp:    2015-07-10T16:29:15Z

Consumer Id:  el7
Type:         unit_profile_changed
Details:      
  Profile Content Type: rpm
Originator:   SYSTEM
Timestamp:    2015-07-10T16:27:29Z

[root@lenovo-x3850-02 ~]# 
Actions #8

Updated by amacdona@redhat.com over 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF