Bug 1155192 - Consumer profile data not showing up on server
Summary: Consumer profile data not showing up on server
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: consumers
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.6.0
Assignee: Andrea Giardini
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-21 14:26 UTC by Andrea Giardini
Modified: 2015-02-28 22:40 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:40:32 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 584 0 None None None Never

Description Andrea Giardini 2014-10-21 14:26:44 UTC
Description of problem:

Right now the pulp consumer updates the server about the packages profile every N minutes, where N is specified in /etc/pulp/consumer/consumer.conf under [profile] minutes.

I think it makes sense to be able to trigger the package profile update via pulp-consumer after a yum/puppet event instead of on a time basis.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jeff Ortel 2014-10-24 14:29:01 UTC
Pulp provides a yum plugin which reports the installed packages profile at the end of every yum install/update/uninstall transaction.  It is packaged in the pulp-rpm-yumplugins RPM.

Comment 2 Jeff Ortel 2014-10-24 15:18:02 UTC
We'll review the docs to be sure this is documented sufficiently.
Do you have the plugin installed?

Comment 3 Andrea Giardini 2014-10-27 09:36:37 UTC
I didn't know about this plugin but I found out that it's already installed in my system (Is it included in the pulp-consumer group?), but I haven't found any documentation for it.

In any case the plugin it's not  working as i expect, as you can see here the reports it sent every 10 minutes:

Oct 27 10:21:52 pulp-consumer2 goferd: [INFO][Actions] pulpplugin:438 - profile (rpm), reported: 201
Oct 27 10:23:50 pulp-consumer2 yum[1201]: Erased: htop
Oct 27 10:31:52 pulp-consumer2 goferd: [INFO][Actions] pulpplugin:438 - profile (rpm), reported: 201

pulp-rpm-yumplugins-2.4.5-1.el6.noarch installed

Do i need to activate it?

Comment 4 Brian Bouterse 2014-10-27 18:03:29 UTC
I believe if yum lists the plugin in its plugin list when you do a yum operation than it is installed. I have the plugin enabled, and when I do a 'yum search asdfasdf' I see the output:

Loaded plugins: langpacks, pulp-profile-update, refresh-packagekit

The presence of the pulp-profile-update tells me that the plugin is loaded. Is yours loaded?

I learned more about this behavior since we originally filed the bug. I think it currently does what this BZ is requesting. If the plugin is loaded then it will report the consumer profile to pulp with every yum operation. This in effect will cause it to update after any yum event. I can't say the same for Puppet, but regarding yum I believe this behavior already does the requested behavior.

Given this new info, do you still feel this is an issue?

I do feel this behavior could be documented a little more clearly in the pulp-rpm guide. I think this BZ should be used for that purpose.

Comment 5 Andrea Giardini 2014-10-28 00:26:43 UTC
I agree with you, the plugin is doing exactly what i was looking for, so it can't be classified as an RFE anymore, but i still have problems with the plugin so maybe we should leave this issue open.

The plugin is loaded in yum, still no reports after yum install.

Maybe conflicting with another plugin?

---------------------------------------------------------

/etc/yum/pluginconf.d/pulp-profile-update.conf:

# Updates package profile information for a registered consumer on pulp server

[main]
enabled=1
verbose=1

---------------------------------------------------------

/var/log/messagges:

Oct 28 01:02:06 pulp-consumer1 goferd: [INFO][Actions] pulpplugin:438 - profile (rpm), reported: 201
Oct 28 01:10:12 pulp-consumer1 yum[16358]: Installed: screen-4.0.3-16.el6.x86_64
Oct 28 01:12:06 pulp-consumer1 goferd: [INFO][Actions] pulpplugin:438 - profile (rpm), reported: 201

---------------------------------------------------------

yum install screen:

[root@pulp-consumer1 pluginconf.d]# yum install screen
Loaded plugins: changelog, kernel-module, priorities, pulp-profile-update, rpm-warm-cache, security, tsflags, versionlock
1766 packages excluded due to repository priority protections
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package screen.x86_64 0:4.0.3-16.el6 will be installed
--> Finished Dependency Resolution
Beginning Kernel Module Plugin
Finished Kernel Module Plugin

Dependencies Resolved

======================================================================
 Package          Arch          Version         Repository      Size
======================================================================
Installing:
 screen           x86_64        4.0.3-16.el6    slc6-os         493 k

Transaction Summary
======================================================================
Install       1 Package(s)

Total download size: 493 k
Installed size: 795 k
Is this ok [y/N]: y
Downloading Packages:
screen-4.0.3-16.el6.x86_64.rpm                                                                                                                     | 493 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : screen-4.0.3-16.el6.x86_64                                                                                                                             1/1 

  Verifying  : screen-4.0.3-16.el6.x86_64                                                                                                                             1/1 

Installed:
  screen.x86_64 0:4.0.3-16.el6                                                                                                                                            

Complete!


___________

Comment 6 Brian Bouterse 2014-10-28 12:28:23 UTC
From everything you've provided it looks like the plugin is working as intended.

You say you are having problems with the plugin, and that no profiles are reported. How are you trying to view the profiles currently? Do you use pulp-admin commands for that? If so, which ones.

Comment 7 Andrea Giardini 2014-10-28 12:37:29 UTC
In the /var/log/messagges that i previousely attached you can see the wrong behaviour: I got one report at 01:02:06, then i installed screen at 01:10:12, but the next update to the server was submitted at 01:12:06.
So the updates are submitted to the server every 10 minutes, not after a yum install (10 is the interval that i set in the /etc/consumer/consumer.conf for periodic update to the server).

I get the packages from the pulp server with this command:

curl -u admin:admin -k https://localhost/pulp/api/v2/consumers/pulp-consumer1/profiles/rpm/

And i see that the list is updated every ten minutes, not after a yum install. The profile is displayed correctly, but it's not updated after yum instal

Comment 8 Andrea Giardini 2014-10-28 12:38:12 UTC
I think there is a little confusion... The profile is shown correctly, but it's not updated in real time.

Comment 9 Brian Bouterse 2014-10-28 12:53:40 UTC
I see the 10 minutes you are referring to in the log. This BZ indicates that the rpm profile is not updated after each run, but it is being updated correctly by goferd in a time-based way. The 10 minute reported profiles are the only ones viewable through the API for that consumer.

We recently fixed an issue with profile reporting [0], but that had a different error message with it. It did prevent the profile reporting from working correctly, so perhaps that regression is what you are running into and you aren't seeing the error message.

If it is related to that other issue, you could try patching your code with the diff from that fix [1], or using a remote debugger in the code path [2] to see if the data is being submitted with each run of yum. That would help identify the root cause.

Given the new information I'm going to send this back to be re-triaged.

[0]: https://bugzilla.redhat.com/show_bug.cgi?id=1152633
[1]: https://github.com/pulp/pulp_rpm/pull/583/files
[2]: https://github.com/bmbouter/pulp_rpm/blob/master/handlers/usr/lib/yum-plugins/pulp-profile-update.py#L54

Comment 10 Andrea Giardini 2014-10-29 10:42:49 UTC
Applied the patch using:

git format-patch -1 7d0bc2697343f9f0987560c29a0133dba584c254
patch -p1 < 0001-Pulp-Yum-plugin-can-now-find-consumer.conf-settings-.patch

The file /usr/lib/yum-plugins/pulp-profile-update.py was correctly updated and the pyc/pyo files were compiled correctly.
Still no reports after yum install.

Oct 29 10:23:15 pulp-consumer1 goferd: [INFO][Actions] pulpplugin:438 - profile (rpm), reported: 201
Oct 29 10:25:36 pulp-consumer1 yum[30783]: Installed: htop-1.0.1-2.el6.x86_64
Oct 29 10:33:16 pulp-consumer1 goferd: [INFO][Actions] pulpplugin:438 - profile (rpm), reported: 201

I'm not able to find any log about the pulp-plugin.

Comment 11 Brian Bouterse 2014-10-29 14:42:02 UTC
After some investigation, it was discovered that the root cause of this bug is that the verify_ssl_ca conf attribute is being evaluated as 'False' and not False which is causing the default of True to always be used. To reproduce, set verify_ssl_ca to false, and watch profile reporting fail.

Note also: verify_ssl_ca was renamed to verify_ssl in 2.5.0

Comment 12 Andrea Giardini 2014-10-29 17:50:01 UTC
https://github.com/pulp/pulp_rpm/pull/588

Should fix the problem

Comment 13 Brian Bouterse 2014-11-03 17:18:53 UTC
Re-opened a new PR with the correct branches:

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

Comment 14 Brian Bouterse 2014-11-03 19:57:58 UTC
merged to 2.5-dev -> master

Comment 15 Brian Bouterse 2014-11-03 20:01:29 UTC
QA, to verify this you should set verify_ssl = False in consumer.conf and have the SSL certificate that Pulp is presenting via the API be a valid cert, but not be signed by a trusted CA. With that setup then:

1) have a consumer machine setup and bound to a repo
2) use yum to install any package on the consumer
3) list the profile details for that consumer, and observe that the change you just made is not in the list.

Note, that we believe periodic reporting is working. The aspect that is not working is the profile posting with each run of yum.

Comment 16 Chris Duryee 2014-12-23 20:52:40 UTC
fixed in pulp 2.6.0-0.2.beta

Comment 17 Preethi Thomas 2015-02-02 21:02:42 UTC
verified
[root@cloud-qe-4 ~]# rpm -qa pulp-server
pulp-server-2.6.0-0.5.beta.el7.noarch

checked in the database to make sure that  consumer_unit_profiles is updated after each install of rpms.

Comment 18 Brian Bouterse 2015-02-28 22:40:32 UTC
Moved to https://pulp.plan.io/issues/584


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