Re: [foreman-users] search host very slow in foreman

2016-09-13 Thread Ohad Levy
On Wed, Sep 14, 2016 at 5:05 AM, sinux shen  wrote:

> Hey guys,
>
> I have been suffered for this for quite a while, we are using katello 3.0
> with foreman 1.11.3, we have around 400+ hosts added in the system, but
> every time when I search a specific host in the search bar, it response me
> very very slow, still work though, just took me like 30 secs or even
> minutes to get the result, I suspect it was something wrong with elastic
> search or something else, is there any way that we can trouble shoot or
> some system tuning we can do to improve this.
>

what was the search query that you used?

Ohad

>
> Thanks
> -Sinux
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-users+unsubscr...@googlegroups.com.
> To post to this group, send email to foreman-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] Metadata not found when syncing RHEL repositories

2016-09-13 Thread Dylan Baars
Hi John,

that looks to have sorted it - in Katello, Content > Redhat Subscriptions > 
Manage Manifest. Clicked "Refresh manifest"

Then Content > Sync Status
Selected one of the RH repos > Synchronise now, and it completed 
successfully. Doing the others and they are all grabbing new files 
successfully - thanks!

Dylan

On Wednesday, September 14, 2016 at 10:02:05 AM UTC+12, John Mitsch wrote:
>
> Dylan,
>
> Looks like you are running into a known issue of pulp saying "not found" 
> when it means "forbidden"
>
> Can you try refreshing your manifest?
>
> Thanks,
>
> John Mitsch
> Red Hat Engineering
> (860)-967-7285
> irc: jomitsch
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] search host very slow in foreman

2016-09-13 Thread sinux shen
Hey guys,

I have been suffered for this for quite a while, we are using katello 3.0 
with foreman 1.11.3, we have around 400+ hosts added in the system, but 
every time when I search a specific host in the search bar, it response me 
very very slow, still work though, just took me like 30 secs or even 
minutes to get the result, I suspect it was something wrong with elastic 
search or something else, is there any way that we can trouble shoot or 
some system tuning we can do to improve this.

Thanks
-Sinux

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] Validation failed: Description has already been taken, Title has already been taken

2016-09-13 Thread David LeVene
Hi Tomer,

Thanks, It works as expected - but what I did notice is that with this
change when I've got the Operating systems defined as noted in a previous
post, a host was moved from CentOS 7.2 -> CentOS 7.2.1511. What happens
when users Patch a host and it goes to the next CentOS version of 7.3.?
I presume it will create a new host with that major/minor version.

If users have something similar configured, this patch may move hosts to a
different OS without their knowledge - This host was the original foreman
host, so I suspect it checked in and configured its self before I manually
created the other OS's, hence it was working and not reporting errors


Results of same host after updating the code:

2016-09-14 11:13:34 [app] [I] Processing by Api::V2::HostsController#facts
as JSON
2016-09-14 11:13:34 [app] [I]   Parameters: {"facts"=>"[FILTERED]",
"name"=>"testing-dlevene", "certname"=>"testing-dlevene", "apiv"=>"v2",
:host=>{"name"=>"testing-dlevene",
 "certname"=>"testing-dlevene"}}
2016-09-14 11:13:34 [app] [I] Import facts for 'testing-dlevene' completed.
Added: 0, Updated: 6, Deleted 0 facts
2016-09-14 11:13:34 [app] [I] Completed 201 Created in 434ms (Views: 5.5ms
| ActiveRecord: 109.2ms)

Let me know if there is any further testing you require on my end.

Regards
David


On 13 September 2016 at 18:32, Tomer Brisker  wrote:

> Hi David,
>
> The fix is ready for testing in https://github.com/
> theforeman/foreman/pull/3836
>
> Thanks
> Tomer
>
> On Tue, Sep 13, 2016 at 3:11 AM, David LeVene 
> wrote:
>
>> Hi Tomer,
>>
>> Great that you've been able to reproduce it.
>>
>> Yep - let me know when I can test it.
>>
>> Regards
>> David
>>
>> On 12 September 2016 at 05:07, Tomer Brisker  wrote:
>>
>>> Thank you for the information David!
>>>
>>> I have managed to reproduce the issue locally and will work to resolve
>>> it.
>>> It would seem that indeed the cause lies with the OS that has a
>>> non-numeric minor version (2.1511).
>>> I will let you know once I have a pull request ready to fix the issue so
>>> you may test it.
>>>
>>> Have a nice week,
>>> Tomer
>>>
>>> On Fri, Sep 9, 2016 at 5:39 AM, David LeVene 
>>> wrote:
>>>
 Hi Tomer,

 I've just reverted to a database backup which has the issue - and here
 is the information you requested

 foreman=# select * from operatingsystems;
  id | major |  name  | minor  | nameindicator |
 created_at | updated_at | release_name |  type
 |  description  | hosts_count | hostgroups_count | password_hash
 | title
 +---+++---+-
 ---++--+
 +---+-+-
 -+---+---
   3 | 7 | CentOS | 2  |   | 2016-01-13
 02:34:09.557672 | 2016-01-13 02:34:09.557672 |  | Redhat
 |   |   1 |0 | SHA256|
 CentOS 7.2
   1 | 7 | CentOS | 1  |   | 2015-12-07
 03:23:39.087921 | 2015-12-16 06:38:11.025759 |  | Redhat |
 CentOS Linux 7.1.1503 |   0 |0 | SHA256|
 CentOS Linux 7.1.1503
   2 | 7 | CentOS | 2.1511 |   | 2015-12-16
 07:40:19.21053  | 2016-01-13 02:21:43.201217 |  | Redhat |
 CentOS Linux 7.2.1511 |   6 |0 | SHA256|
 CentOS Linux 7.2.1511
 (3 rows)


 {"name"=>"CentOS", "family"=>"RedHat", "release"=>{"major"=>"7",
 "minor"=>"2", "full"=>"7.2.1511"}, "lsb"=>{"distcodename"=>"Core",
 "distid"=>"CentOS", "distdescription"=>"CentOS Linux release 7.2.1511
 (Core) ", "release"=>":core-4.1-amd64:core-4.1-noarch",
 "distrelease"=>"7.2.1511", "majdistrelease"=>"7", "minordistrelease"=>"2"}}

 2016-09-09 12:05:52 [app] [I] Import facts for 'testing completed.
 Added: 0, Updated: 9, Deleted 0 facts
 2016-09-09 12:05:53 [app] [W] Action failed
  | ActiveRecord::RecordInvalid: Validation failed: Description has
 already been taken, Title has already been taken
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
 .5.1/lib/active_record/validations.rb:79:in `raise_record_invalid'
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
 .5.1/lib/active_record/validations.rb:43:in `save!'
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
 .5.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
 .5.1/lib/active_record/transactions.rb:291:in `block in save!'

 I suspect based on what I've seen so far, its trying to add and update
 the description in id=3, but it can't as 

Re: [foreman-users] Metadata not found when syncing RHEL repositories

2016-09-13 Thread John Mitsch
Dylan,

Looks like you are running into a known issue of pulp saying "not found"
when it means "forbidden"

Can you try refreshing your manifest?

Thanks,

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Mon, Sep 12, 2016 at 10:38 PM, Dylan Baars  wrote:

> Hi all,
>
> we have been syncing RHEL repos from cdn.redhat.com without issue for a
> while, but now when I attempt to sync any I get
>
> RPM1004: Error retrieving metadata: Not found
>
> in the GUI. If I try a sync and monitor /var/log/messages I see
>
> Sep 13 14:30:58 wellkatello.niwa.local pulp: kombu.transport.qpid:INFO:
> Connected to qpid with SASL mechanism ANONYMOUS
> Sep 13 14:31:00 wellkatello.niwa.local pulp: celery.worker.strategy:INFO:
> Received task: pulp.server.async.tasks._queue_reserved_task[f284f6e7-
> 215a-493e-9bc6-bf3d1a433ec8]
> Sep 13 14:31:00 wellkatello.niwa.local pulp: celery.worker.strategy:INFO:
> Received task: pulp.server.managers.repo.sync.sync[981a01c6-fd95-42d4-
> 8d6f-e60470bf0fe9]
> Sep 13 14:31:00 wellkatello.niwa.local pulp: celery.worker.strategy:INFO:
> Received task: pulp.server.async.tasks._release_resource[9dd3b103-
> 26d7-4c8f-9ced-9dc785ca8f03]
> Sep 13 14:31:00 wellkatello.niwa.local pulp: celery.worker.job:INFO: Task
> pulp.server.async.tasks._queue_reserved_task[f284f6e7-215a-493e-9bc6-bf3d1a433ec8]
> succeeded in 0.125369669s: None
> Sep 13 14:31:01 wellkatello.niwa.local pulp: 
> pulp_rpm.plugins.importers.yum.sync:INFO:
> Downloading metadata from https://cdn.redhat.com/
> content/fastrack/rhel/server/7/x86_64/optional/os/.
> Sep 13 14:31:01 wellkatello.niwa.local pulp: 
> requests.packages.urllib3.connectionpool:INFO:
> Starting new HTTPS connection (1): cdn.redhat.com
> Sep 13 14:31:03 wellkatello.niwa.local pulp: 
> requests.packages.urllib3.connectionpool:INFO:
> Starting new HTTPS connection (1): cdn.redhat.com
> Sep 13 14:31:03 wellkatello.niwa.local pulp: pulp.server.async.tasks:INFO:
> Task failed : [981a01c6-fd95-42d4-8d6f-e60470bf0fe9] : Error retrieving
> metadata: Not found
> Sep 13 14:31:04 wellkatello.niwa.local pulp: celery.worker.job:INFO: Task
> pulp.server.managers.repo.sync.sync[981a01c6-fd95-42d4-8d6f-e60470bf0fe9]
> raised expected: PulpCodedException()
> Sep 13 14:31:04 wellkatello.niwa.local pulp: celery.worker.job:INFO: Task
> pulp.server.async.tasks._release_resource[9dd3b103-26d7-4c8f-9ced-9dc785ca8f03]
> succeeded in 0.0117141319997s: None
>
> in /var/log/foreman/production.log I see
>
> 2016-09-13 14:37:12 [app] [I] Processing by 
> Katello::SyncManagementController#sync
> as JS
> 2016-09-13 14:37:12 [app] [I]   Parameters: {"utf8"=>"✓",
> "sync_status_url"=>"", "repoids"=>["69"], "commit"=>"Synchronize Now"}
> 2016-09-13 14:37:15 [app] [I] Completed 200 OK in 2797ms (Views: 0.8ms |
> ActiveRecord: 1701.8ms)
> 2016-09-13 14:37:16 [app] [I] Started GET "/katello/sync_management/
> sync_status?repoids%5B%5D=69&_=1473732915912" for 192.168.222.132 at
> 2016-09-13 14:37:16 +1200
> 2016-09-13 14:37:16 [app] [I] Processing by Katello::
> SyncManagementController#sync_status as JSON
> 2016-09-13 14:37:16 [app] [I]   Parameters: {"repoids"=>["69"],
> "_"=>"1473732915912"}
> 2016-09-13 14:37:16 [app] [I] Completed 200 OK in 94ms (Views: 0.7ms |
> ActiveRecord: 12.9ms)
> 2016-09-13 14:37:17 [app] [I] Started GET "/katello/sync_management/
> sync_status?repoids%5B%5D=69&_=1473732915913" for 192.168.222.132 at
> 2016-09-13 14:37:17 +1200
> 2016-09-13 14:37:17 [app] [I] Processing by Katello::
> SyncManagementController#sync_status as JSON
> 2016-09-13 14:37:17 [app] [I]   Parameters: {"repoids"=>["69"],
> "_"=>"1473732915913"}
> 2016-09-13 14:37:18 [app] [I] Completed 200 OK in 102ms (Views: 0.4ms |
> ActiveRecord: 12.0ms)
> 2016-09-13 14:37:19 [app] [I] Started GET "/katello/sync_management/
> sync_status?repoids%5B%5D=69&_=1473732915914" for 192.168.222.132 at
> 2016-09-13 14:37:19 +1200
> 2016-09-13 14:37:19 [foreman-tasks/action] [E] RPM1004: Error retrieving
> metadata: Not found (Katello::Errors::PulpError)
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/
> app/lib/actions/pulp/abstract_async_task.rb:121:in `block in
> external_task='
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/
> app/lib/actions/pulp/abstract_async_task.rb:119:in `each'
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/
> app/lib/actions/pulp/abstract_async_task.rb:119:in `external_task='
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.2/
> app/lib/actions/pulp/repository/sync.rb:46:in `external_task='
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.
> 11/lib/dynflow/action/polling.rb:98:in `poll_external_task_with_rescue'
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.
> 11/lib/dynflow/action/polling.rb:21:in `run'
>  | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.
> 11/lib/dynflow/action/cancellable.rb:9:in `run'
>  | 

Re: [foreman-users] extending node.rb to query external CMDB

2016-09-13 Thread Sean O'Keeffe
I would suggest using foreman_hooks for this, have a look at
https://github.com/theforeman/foreman_hooks

I've only ever use foreman_hooks for host create/destroy task but I think
it can be used for what you want.

Sean


On Tuesday, 13 September 2016, Unix SA  wrote:

> Hello,
>
> i have requirement to query my external CMDB, for different teams roles,
> server life-cycle environment, group of servers belongs to some specific
> group of application team, all those information and using those i want to
> setup roles/permissions in katello/satello.
>
> I am planning to populate all information as yaml using node.rb by adding
> some more code to query external CMDB, and by using those values i can
> design where my host belongs to and to which application group and what all
> users have permission to that host.
>
> Does anyone have any suggestion to make it better way? or extending
> node.rb with all those information is the right way?
>
> if anyone has any experience before with similar or matching requirements ?
>
> Regards,
> DJ
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to foreman-users+unsubscr...@googlegroups.com
> 
> .
> To post to this group, send email to foreman-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] 500 Internal Server Error when subscribing hosts

2016-09-13 Thread John Mitsch
Just to avoid any confusion, that tail command is going to be on your main
katello server

Thanks,

John Mitsch
Red Hat Engineering
(860)-967-7285
irc: jomitsch

On Tue, Sep 13, 2016 at 5:46 PM, John Mitsch  wrote:

> James,
>
> Try a couple things first:
>
> foreman-rake katello:reindex
> systemctl restart tomcat
>
> then
>  'tail -f -n 0 /var/log/candlepin/* /var/log/messages/
> /var/log/foreman/production.log' on your machine and retry the activation
> key.
> Share that output with us (if its still erroring). It will be best to pipe
> this to a file and attach it as it makes it easier to parse.
>
> Let me know if you have any questions.
>
> Thanks,
>
> John Mitsch
> Red Hat Engineering
> (860)-967-7285
> irc: jomitsch
>
> On Tue, Sep 13, 2016 at 4:54 PM, James Evans 
> wrote:
>
>> I've been prototyping Foreman for a while now, and everything has been
>> working perfectly in testing. Now I've built out our production deployment
>> and imported content, and started trying to move hosts to the Foreman and
>> Katello server. When ever I run subscription-manager register, from any
>> host, I get 500 Internal Server Error, and the task hangs. I have to go
>> into the dynaflow console and skip the broken step, and resume the task to
>> clear locks.
>>
>> I've never had this happen in any of my tests where I've built a number
>> of test servers to test out processes and configurations. All the test
>> systems were able to register clients with no issues at all. The server and
>> client are both fully updated RHEL 7.2 boxes, the server is
>> running foreman-1.12.2-1.el7.noarch and katello-3.1.0-5.el7.noarch.
>>
>> The only other difference between the production and test is that I never
>> imported RHEL content into the test systems.
>>
>> I've spent a week building out the products, repositories, content views,
>> etc. and would really like to recover this without having to start over,
>> but this is obviously a major problem!
>>
>> I've googled the errors, with out finding any thing. Can anyone help me?
>>
>> On the client I run:
>>
>> # subscription-manager register --org="myOrg"
>> --activationkey="rhel-72-x86_64-production"
>> Task 1ac48d97-a570-4a43-9a09-b5cb0be7cf29: RestClient::InternalServerError:
>> 500 Internal Server Error
>>
>> And the production.log contains (abbreviated):
>>
>> 2016-09-13 15:39:15 [app] [I] Started GET "/rhsm/" for XX.XX.XX.XX at
>> 2016-09-13 15:39:15 -0500
>> 2016-09-13 15:39:15 [app] [I] Processing by 
>> Katello::Api::V2::RootController#rhsm_resource_list
>> as JSON
>> 2016-09-13 15:39:15 [app] [I]   Parameters: {"root"=>{}}
>> 2016-09-13 15:39:15 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/s
>> hare/gems/gems/katello-3.1.0.1/app/views/katello/api/v2/root/resource_list.json.rabl
>> within katello/api/v2/layouts/collection (2.4ms)
>> 2016-09-13 15:39:15 [app] [I] Completed 200 OK in 21ms (Views: 3.8ms |
>> ActiveRecord: 0.0ms)
>> 2016-09-13 15:39:15 [app] [I] Started GET "/rhsm/status" for XX.XX.XX.XX
>> at 2016-09-13 15:39:15 -0500
>> 2016-09-13 15:39:15 [app] [I] Processing by 
>> Katello::Api::Rhsm::CandlepinProxiesController#server_status
>> as JSON
>> 2016-09-13 15:39:15 [app] [I] Completed 200 OK in 308ms (Views: 0.9ms |
>> ActiveRecord: 0.0ms)
>> 2016-09-13 15:39:16 [app] [I] Started POST "/rhsm/consumers?owner=myOrg
>> ctivation_keys=rhel-72-x86_64-production" for XX.XX.XX.XX at 2016-09-13
>> 15:39:16 -0500
>> 2016-09-13 15:39:16 [app] [I] Processing by Katello::Api::Rhsm::CandlepinP
>> roxiesController#consumer_activate as JSON
>> 2016-09-13 15:39:16 [app] [I]   Parameters: {"facts"=>"[FILTERED]",
>> "installedProducts"=>[{"productName"=>"Red Hat Enterprise Linux Server",
>> "arch"=>"x86_64", "version"=>"7.2", "productId"=>"69"}], "type"=>"system",
>> "name"=>"client.com", "contentTags"=>["rhel-7", "rhel-7-server"],
>> "owner"=>"myOrg", "activation_keys"=>"rhel-72-x86_64-production"}
>> 2016-09-13 15:39:18 [app] [I] Import facts for 'client.example.com'
>> completed. Added: 0, Updated: 1, Deleted 21 facts
>> 2016-09-13 15:39:21 [katello/pulp_rest] [E] RestClient.post "
>> https://foreman.example.com/pulp/api/v2/consumers/;,
>> "{\"id\":\"1c796228-efa5-4190-b5de-a0f7605e3074\",\"display_name\":\"
>> client.example.com\"}", "Accept"=>"*/*; q=0.5, application/xml",
>> "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"100",
>> "accept"=>"application/json", "content_type"=>"application/json"
>>  | \n# => 500 InternalServerError | application/json 2551 bytes
>>  |
>> 2016-09-13 15:39:21 [foreman-tasks/action] [E] 500 Internal Server Error
>> (RestClient::InternalServerError)
>>  | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8
>> .0/lib/restclient/abstract_response.rb:74:in `return!'
>>  | 
>> /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.2/lib/runcible/base.rb:79:in
>> `block in get_response'
>>  | /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8
>> 

[foreman-users] 500 Internal Server Error when subscribing hosts

2016-09-13 Thread James Evans
I've been prototyping Foreman for a while now, and everything has been 
working perfectly in testing. Now I've built out our production deployment 
and imported content, and started trying to move hosts to the Foreman and 
Katello server. When ever I run subscription-manager register, from any 
host, I get 500 Internal Server Error, and the task hangs. I have to go 
into the dynaflow console and skip the broken step, and resume the task to 
clear locks.

I've never had this happen in any of my tests where I've built a number of 
test servers to test out processes and configurations. All the test systems 
were able to register clients with no issues at all. The server and client 
are both fully updated RHEL 7.2 boxes, the server is 
running foreman-1.12.2-1.el7.noarch and katello-3.1.0-5.el7.noarch.

The only other difference between the production and test is that I never 
imported RHEL content into the test systems.

I've spent a week building out the products, repositories, content views, 
etc. and would really like to recover this without having to start over, 
but this is obviously a major problem!

I've googled the errors, with out finding any thing. Can anyone help me?

On the client I run:

# subscription-manager register --org="myOrg" 
--activationkey="rhel-72-x86_64-production"
Task 1ac48d97-a570-4a43-9a09-b5cb0be7cf29: RestClient::InternalServerError: 
500 Internal Server Error

And the production.log contains (abbreviated):

2016-09-13 15:39:15 [app] [I] Started GET "/rhsm/" for XX.XX.XX.XX at 
2016-09-13 15:39:15 -0500
2016-09-13 15:39:15 [app] [I] Processing by 
Katello::Api::V2::RootController#rhsm_resource_list as JSON
2016-09-13 15:39:15 [app] [I]   Parameters: {"root"=>{}}
2016-09-13 15:39:15 [app] [I]   Rendered 
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.1.0.1/app/views/katello/api/v2/root/resource_list.json.rabl
 
within katello/api/v2/layouts/collection (2.4ms)
2016-09-13 15:39:15 [app] [I] Completed 200 OK in 21ms (Views: 3.8ms | 
ActiveRecord: 0.0ms)
2016-09-13 15:39:15 [app] [I] Started GET "/rhsm/status" for XX.XX.XX.XX at 
2016-09-13 15:39:15 -0500
2016-09-13 15:39:15 [app] [I] Processing by 
Katello::Api::Rhsm::CandlepinProxiesController#server_status as JSON
2016-09-13 15:39:15 [app] [I] Completed 200 OK in 308ms (Views: 0.9ms | 
ActiveRecord: 0.0ms)
2016-09-13 15:39:16 [app] [I] Started POST 
"/rhsm/consumers?owner=myOrg_keys=rhel-72-x86_64-production" for 
XX.XX.XX.XX at 2016-09-13 15:39:16 -0500
2016-09-13 15:39:16 [app] [I] Processing by 
Katello::Api::Rhsm::CandlepinProxiesController#consumer_activate as JSON
2016-09-13 15:39:16 [app] [I]   Parameters: {"facts"=>"[FILTERED]", 
"installedProducts"=>[{"productName"=>"Red Hat Enterprise Linux Server", 
"arch"=>"x86_64", "version"=>"7.2", "productId"=>"69"}], "type"=>"system", 
"name"=>"client.com", "contentTags"=>["rhel-7", "rhel-7-server"], 
"owner"=>"myOrg", "activation_keys"=>"rhel-72-x86_64-production"}
2016-09-13 15:39:18 [app] [I] Import facts for 'client.example.com' 
completed. Added: 0, Updated: 1, Deleted 21 facts
2016-09-13 15:39:21 [katello/pulp_rest] [E] RestClient.post 
"https://foreman.example.com/pulp/api/v2/consumers/;, 
"{\"id\":\"1c796228-efa5-4190-b5de-a0f7605e3074\",\"display_name\":\"client.example.com\"}",
 
"Accept"=>"*/*; q=0.5, application/xml", "Accept-Encoding"=>"gzip, 
deflate", "Content-Length"=>"100", "accept"=>"application/json", 
"content_type"=>"application/json"
 | \n# => 500 InternalServerError | application/json 2551 bytes
 | 
2016-09-13 15:39:21 [foreman-tasks/action] [E] 500 Internal Server Error 
(RestClient::InternalServerError)
 | 
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in
 
`return!'
 | 
/opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.2/lib/runcible/base.rb:79:in
 
`block in get_response'
 | 
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in
 
`call'



 | 
/opt/rh/sclo-ror42/root/usr/share/gems/gems/concurrent-ruby-1.0.0/lib/concurrent/executor/serialized_execution.rb:77:in
 
`block in call_job'
 | 
/opt/rh/sclo-ror42/root/usr/share/gems/gems/concurrent-ruby-1.0.0/lib/concurrent/executor/ruby_thread_pool_executor.rb:333:in
 
`call'
 | 
/opt/rh/sclo-ror42/root/usr/share/gems/gems/concurrent-ruby-1.0.0/lib/concurrent/executor/ruby_thread_pool_executor.rb:333:in
 
`run_task'
 | 
/opt/rh/sclo-ror42/root/usr/share/gems/gems/concurrent-ruby-1.0.0/lib/concurrent/executor/ruby_thread_pool_executor.rb:322:in
 
`block (3 levels) in create_worker'
 | 
/opt/rh/sclo-ror42/root/usr/share/gems/gems/concurrent-ruby-1.0.0/lib/concurrent/executor/ruby_thread_pool_executor.rb:305:in
 
`loop'
 | 
/opt/rh/sclo-ror42/root/usr/share/gems/gems/concurrent-ruby-1.0.0/lib/concurrent/executor/ruby_thread_pool_executor.rb:305:in
 
`block (2 levels) in create_worker'
 | 

[foreman-users] operating-system org specific

2016-09-13 Thread Tom McKay
I may have mentioned this before, but shouldn't operating systems be
org-specific? The entire install shouldn't share the same RHEL7 OS, should
they? I say this because there can only be one set of templates, and
parameters are shared. This seems bad in that I could go change a template
association and effectively break provisioning for everyone else on that OS.

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] Re: "No root file system is defined" error using preseed atomic partitioning scheme

2016-09-13 Thread Hauke Behrens
Hi,

the problem probably isn't the partitioning schema itself, but the disk
used/defined before.

Check if this part

"d-i partman-auto/disk string /dev/vda"

matches your server.

Maybe some other value is needed for your case, like /dev/sda/ or /dev/xvda.

You can override that in the partition table itself or by adding an
according host.param for install_disk.

The relevant snippet is this one:

<% if @host.params['install-disk'] -%>
d-i partman-auto/disk string <%= @host.params['install-disk'] %>
<% else -%>
d-i partman-auto/disk string /dev/vda
<% end -%>


Hope it helps,

Hauke


On 09/13/2016 06:04 PM, Akash Kaveti wrote:
> Exact error message is, No root file system is defined, Please correct
> this form partitioning menu.
> I have installed foreman with DHCP in a network, where I have disabled
> the existing DHCP in that Network.
> 
> On Tuesday, September 13, 2016 at 4:49:42 PM UTC+2, Akash Kaveti wrote:
> 
> I am using preseed default as partitioning template, but when a host
> is launched using that I got this error "No root file system is defined"
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to foreman-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to foreman-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Re: [foreman-users] Re: [Katello] HandlerNotFound: No handler for: {'type': u'erratum'}

2016-09-13 Thread Joseph Cunningham
Had the similar error message when applying errata:

No handler for: {'type': u'erratum'}


Katello server is Centos 7, client is Centos 7.

(server) Tried yum update / reboot , same error message.
(client) Tried yum install pulp-rpm-handlers / systemctl restart goferd

That worked.   Was able to successfully apply errata.

On Tuesday, September 13, 2016 at 4:34:39 AM UTC-7, Edgars M. wrote:
>
> Unfortunately 2.8.3 is the latest in 
>  rhel-6-server-satellite-tools-6.2-rpms repo.
>
> Edgars
>
> otrdiena, 2016. gada 13. septembris 12:24:54 UTC+2, Pierre-Alain Pulfer 
> rakstīja:
>>
>> On EL6, you have to upgrade pulp-rpm-handlers package too.
>> upgrade from 2.6.4 to 2.8.6 worked for me.
>>
>> Le vendredi 9 septembre 2016 14:50:12 UTC+2, Edgars M. a écrit :
>>>
>>> It does not work for me on RHEL6 even though yum-plugin-security is 
>>> installed. I guess I have to wait until downstream katello-agent is updated.
>>>
>>> Edgars
>>>
>>> piektdiena, 2016. gada 9. septembris 14:34:43 UTC+2, Pierre-Alain Pulfer 
>>> rakstīja:

 Solved :

 CentOS 6 :
 yum-plugin-security was not installed.
 Installing yum-plugin-security solved the problem for el6. Thanks !

 For CentOS 5 i had to install yum-security package.
 These packages are not installed by default on CentOS 5 / 6.

 On el7 (CentOS 7) :
 - updated from pulp-rpm-handlers-2.6.4-1.el7.noarch to 
 pulp-rpm-handlers-2.8.6-1.el7.noarch 
 - restarted goferd

 THANKS !



 Le jeudi 8 septembre 2016 21:51:45 UTC+2, jsherril a écrit :
>
> On 09/06/2016 09:39 AM, Pierre-Alain Pulfer wrote:
>
> Hello, 
>
> Same symptoms for me, after upgrading server from Katello 2.4 to 3.0
> Katello server is CentOS 7
>
>
> Can you ensure that the yum-plugin-security package is installed on 
> the el6 client?
>
> Pulp was updated to require this to improve performance and in 3.1 we 
> started requiring it with katello agent on el6 and el5.  The 'no module 
> named security' error tells me its probably not installed.
>
>
> -Justin
>
>
> On one test server (Centos 7), a "yum update" + reboot solved the 
> problem. 
> But on another server (CentOS 6), the same action did not solve 
> anything.
>
> Client log , slightly different than Edgar's log:
> CentOS 6, latest versions
>
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
>> gofer.messaging.adapter.connect:28 - connecting: proton+amqps://
>> lslkatp01.mydomain.com:5647
>> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
>> gofer.messaging.adapter.proton.connection:87 - open: URL: 
>> amqps://lslkatp01.mydomain.com:5647|SSL: ca: 
>> /etc/rhsm/ca/katello-default-ca.pem|key: None|certificate: 
>> /etc/pki/consumer/bundle.pem|host-validation: None
>> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] root:510 - 
>> connecting to lslkatp01.mydomain.com:5647...
>> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
>> gofer.messaging.adapter.proton.connection:92 - opened: proton+amqps://
>> lslkatp01.mydomain.com:5647
>> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
>> gofer.messaging.adapter.connect:30 - connected: proton+amqps://
>> lslkatp01.mydomain.com:5647
>> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] root:539 - 
>> connected to lslkatp01.mydomain.com:5647
>> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
>> gofer.rmi.dispatcher:603 - call: Content.install() 
>> sn=4815f76e-70d9-4df3-a8fc-d6d76c895353 data={u'task_id': 
>> u'3e23e6be-69f7-4adf-96b6-cef334c1e8b9', u'consumer_id': 
>> u'f33175e5-47c5-406f-9c71-16132eda4bae'}
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 - handler "rpm", import failed
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 - Traceback (most recent call last):
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 -   File 
>> "/usr/lib/python2.6/site-packages/pulp/agent/lib/container.py", line 
>> 284, 
>> in __load
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 - mod = self.__import_module(path)
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 -   File 
>> "/usr/lib/python2.6/site-packages/pulp/agent/lib/container.py", line 
>> 313, 
>> in __import_module
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 - mod = __import__(path[0], globals(), 
>> locals(), [path[-1]])
>> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
>> pulp.agent.lib.container:290 -   File 
>> "/usr/lib/python2.6/site-packages/pulp_rpm/handlers/rpm.py", line 9, in 
>> 
>> Aug 26 11:32:19 lslpput01 

[foreman-users] Re: "No root file system is defined" error using preseed atomic partitioning scheme

2016-09-13 Thread Akash Kaveti
Exact error message is, No root file system is defined, Please correct this 
form partitioning menu. 
I have installed foreman with DHCP in a network, where I have disabled the 
existing DHCP in that Network. 

On Tuesday, September 13, 2016 at 4:49:42 PM UTC+2, Akash Kaveti wrote:
>
> I am using preseed default as partitioning template, but when a host is 
> launched using that I got this error "No root file system is defined"
>

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] extending node.rb to query external CMDB

2016-09-13 Thread Unix SA
Hello,

i have requirement to query my external CMDB, for different teams roles, 
server life-cycle environment, group of servers belongs to some specific 
group of application team, all those information and using those i want to 
setup roles/permissions in katello/satello.

I am planning to populate all information as yaml using node.rb by adding 
some more code to query external CMDB, and by using those values i can 
design where my host belongs to and to which application group and what all 
users have permission to that host.

Does anyone have any suggestion to make it better way? or extending node.rb 
with all those information is the right way? 

if anyone has any experience before with similar or matching requirements ?

Regards,
DJ

-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


[foreman-users] Foreman 1.13.0-RC1 available for testing

2016-09-13 Thread Dominic Cleal
Foreman 1.13.0-RC1 is now available for testing - the first of the
release candidates for the upcoming 1.13 version.

Please help by testing and getting it release-ready, and look out for
new release candidates approximately every two weeks with the latest bug
fixes.

Installation quick start:
https://theforeman.org/manuals/1.13/quickstart_guide.html

Upgrade instructions:
https://theforeman.org/manuals/1.13/index.html#3.6Upgrade

Release notes:
https://theforeman.org/manuals/1.13/index.html#Releasenotesfor1.13

This is also a good time to improve translations for existing locales to
ensure full coverage. Help out at
https://www.transifex.com/foreman/foreman/dashboard/.

Changes in this release
===
This release contains many varied changes, including:

- Support for IPv6 subnets, addresses and orchestration on hosts
- Parsing performance improvements in ISC DHCP smart proxy module
- UEFI boot loaders and TFTP boot files configured
- Puppet facts importer supports Facter 2+ structured facts
- OpenStack Liberty, server groups and scheduler support

Lots more features can be found listed in the release notes by
category, please have a look through for anything that you might rely
on and give it a test:
https://theforeman.org/manuals/1.13/index.html#Releasenotesfor1.13

Do take note of the upgrade warnings and deprecations in this release:
https://theforeman.org/manuals/1.13/index.html#Upgradewarnings

Downloads
=
Packages may be found in the 1.13 directories on both deb.foreman.org
and yum.theforeman.org, and tarballs are on downloads.theforeman.org.

The GPG key used for RPMs and tarballs has the following fingerprint:
  84E7 90DF FB1D 2EAE C429 C6CD 4EA2 F7E7 7DFE 6FC2
  (https://theforeman.org/security.html#GPGkeys)

Bug reporting
=
If you come across a bug in your testing, please file it and note the
version of Foreman that you're using in the report.

Foreman: http://projects.theforeman.org/projects/foreman/issues/new
Proxy: http://projects.theforeman.org/projects/smart-proxy/issues/new
Installer:
http://projects.theforeman.org/projects/puppet-foreman/issues/new

-- 
Dominic Cleal
domi...@cleal.org


-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [foreman-users] Re: [Katello] HandlerNotFound: No handler for: {'type': u'erratum'}

2016-09-13 Thread Edgars M.
Unfortunately 2.8.3 is the latest in 
 rhel-6-server-satellite-tools-6.2-rpms repo.

Edgars

otrdiena, 2016. gada 13. septembris 12:24:54 UTC+2, Pierre-Alain Pulfer 
rakstīja:
>
> On EL6, you have to upgrade pulp-rpm-handlers package too.
> upgrade from 2.6.4 to 2.8.6 worked for me.
>
> Le vendredi 9 septembre 2016 14:50:12 UTC+2, Edgars M. a écrit :
>>
>> It does not work for me on RHEL6 even though yum-plugin-security is 
>> installed. I guess I have to wait until downstream katello-agent is updated.
>>
>> Edgars
>>
>> piektdiena, 2016. gada 9. septembris 14:34:43 UTC+2, Pierre-Alain Pulfer 
>> rakstīja:
>>>
>>> Solved :
>>>
>>> CentOS 6 :
>>> yum-plugin-security was not installed.
>>> Installing yum-plugin-security solved the problem for el6. Thanks !
>>>
>>> For CentOS 5 i had to install yum-security package.
>>> These packages are not installed by default on CentOS 5 / 6.
>>>
>>> On el7 (CentOS 7) :
>>> - updated from pulp-rpm-handlers-2.6.4-1.el7.noarch to 
>>> pulp-rpm-handlers-2.8.6-1.el7.noarch 
>>> - restarted goferd
>>>
>>> THANKS !
>>>
>>>
>>>
>>> Le jeudi 8 septembre 2016 21:51:45 UTC+2, jsherril a écrit :

 On 09/06/2016 09:39 AM, Pierre-Alain Pulfer wrote:

 Hello, 

 Same symptoms for me, after upgrading server from Katello 2.4 to 3.0
 Katello server is CentOS 7


 Can you ensure that the yum-plugin-security package is installed on the 
 el6 client?

 Pulp was updated to require this to improve performance and in 3.1 we 
 started requiring it with katello agent on el6 and el5.  The 'no module 
 named security' error tells me its probably not installed.


 -Justin


 On one test server (Centos 7), a "yum update" + reboot solved the 
 problem. 
 But on another server (CentOS 6), the same action did not solve 
 anything.

 Client log , slightly different than Edgar's log:
 CentOS 6, latest versions

 Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
> gofer.messaging.adapter.connect:28 - connecting: proton+amqps://
> lslkatp01.mydomain.com:5647
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
> gofer.messaging.adapter.proton.connection:87 - open: URL: 
> amqps://lslkatp01.mydomain.com:5647|SSL: ca: 
> /etc/rhsm/ca/katello-default-ca.pem|key: None|certificate: 
> /etc/pki/consumer/bundle.pem|host-validation: None
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] root:510 - 
> connecting to lslkatp01.mydomain.com:5647...
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
> gofer.messaging.adapter.proton.connection:92 - opened: proton+amqps://
> lslkatp01.mydomain.com:5647
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
> gofer.messaging.adapter.connect:30 - connected: proton+amqps://
> lslkatp01.mydomain.com:5647
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] root:539 - 
> connected to lslkatp01.mydomain.com:5647
> Aug 26 11:32:18 lslpput01 goferd: [INFO][worker-0] 
> gofer.rmi.dispatcher:603 - call: Content.install() 
> sn=4815f76e-70d9-4df3-a8fc-d6d76c895353 data={u'task_id': 
> u'3e23e6be-69f7-4adf-96b6-cef334c1e8b9', u'consumer_id': 
> u'f33175e5-47c5-406f-9c71-16132eda4bae'}
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 - handler "rpm", import failed
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 - Traceback (most recent call last):
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 -   File 
> "/usr/lib/python2.6/site-packages/pulp/agent/lib/container.py", line 284, 
> in __load
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 - mod = self.__import_module(path)
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 -   File 
> "/usr/lib/python2.6/site-packages/pulp/agent/lib/container.py", line 313, 
> in __import_module
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 - mod = __import__(path[0], globals(), 
> locals(), [path[-1]])
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 -   File 
> "/usr/lib/python2.6/site-packages/pulp_rpm/handlers/rpm.py", line 9, in 
> 
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 - from pulp_rpm.handlers.rpmtools import 
> Package, PackageGroup, ProgressReport
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 -   File 
> "/usr/lib/python2.6/site-packages/pulp_rpm/handlers/rpmtools.py", line 
> 28, 
> in 
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> pulp.agent.lib.container:290 - import security
> Aug 26 11:32:19 lslpput01 goferd: [ERROR][worker-0] 
> 

Re: [foreman-users] Validation failed: Description has already been taken, Title has already been taken

2016-09-13 Thread Tomer Brisker
Hi David,

The fix is ready for testing in
https://github.com/theforeman/foreman/pull/3836

Thanks
Tomer

On Tue, Sep 13, 2016 at 3:11 AM, David LeVene 
wrote:

> Hi Tomer,
>
> Great that you've been able to reproduce it.
>
> Yep - let me know when I can test it.
>
> Regards
> David
>
> On 12 September 2016 at 05:07, Tomer Brisker  wrote:
>
>> Thank you for the information David!
>>
>> I have managed to reproduce the issue locally and will work to resolve
>> it.
>> It would seem that indeed the cause lies with the OS that has a
>> non-numeric minor version (2.1511).
>> I will let you know once I have a pull request ready to fix the issue so
>> you may test it.
>>
>> Have a nice week,
>> Tomer
>>
>> On Fri, Sep 9, 2016 at 5:39 AM, David LeVene 
>> wrote:
>>
>>> Hi Tomer,
>>>
>>> I've just reverted to a database backup which has the issue - and here
>>> is the information you requested
>>>
>>> foreman=# select * from operatingsystems;
>>>  id | major |  name  | minor  | nameindicator |
>>> created_at | updated_at | release_name |  type
>>> |  description  | hosts_count | hostgroups_count | password_hash
>>> | title
>>> +---+++---+-
>>> ---++--+
>>> +---+-+-
>>> -+---+---
>>>   3 | 7 | CentOS | 2  |   | 2016-01-13
>>> 02:34:09.557672 | 2016-01-13 02:34:09.557672 |  | Redhat
>>> |   |   1 |0 | SHA256|
>>> CentOS 7.2
>>>   1 | 7 | CentOS | 1  |   | 2015-12-07
>>> 03:23:39.087921 | 2015-12-16 06:38:11.025759 |  | Redhat |
>>> CentOS Linux 7.1.1503 |   0 |0 | SHA256|
>>> CentOS Linux 7.1.1503
>>>   2 | 7 | CentOS | 2.1511 |   | 2015-12-16
>>> 07:40:19.21053  | 2016-01-13 02:21:43.201217 |  | Redhat |
>>> CentOS Linux 7.2.1511 |   6 |0 | SHA256|
>>> CentOS Linux 7.2.1511
>>> (3 rows)
>>>
>>>
>>> {"name"=>"CentOS", "family"=>"RedHat", "release"=>{"major"=>"7",
>>> "minor"=>"2", "full"=>"7.2.1511"}, "lsb"=>{"distcodename"=>"Core",
>>> "distid"=>"CentOS", "distdescription"=>"CentOS Linux release 7.2.1511
>>> (Core) ", "release"=>":core-4.1-amd64:core-4.1-noarch",
>>> "distrelease"=>"7.2.1511", "majdistrelease"=>"7", "minordistrelease"=>"2"}}
>>>
>>> 2016-09-09 12:05:52 [app] [I] Import facts for 'testing completed.
>>> Added: 0, Updated: 9, Deleted 0 facts
>>> 2016-09-09 12:05:53 [app] [W] Action failed
>>>  | ActiveRecord::RecordInvalid: Validation failed: Description has
>>> already been taken, Title has already been taken
>>>  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
>>> .5.1/lib/active_record/validations.rb:79:in `raise_record_invalid'
>>>  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
>>> .5.1/lib/active_record/validations.rb:43:in `save!'
>>>  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
>>> .5.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
>>>  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2
>>> .5.1/lib/active_record/transactions.rb:291:in `block in save!'
>>>
>>> I suspect based on what I've seen so far, its trying to add and update
>>> the description in id=3, but it can't as id=2 already has the description
>>> it wants.
>>>
>>> I'll leave it like this until you have enough information to proceed
>>> forward, then i'll fix it on my end.
>>>
>>> Cheers
>>> David
>>>
>>>
>>>
>>> On 7 September 2016 at 16:09, Tomer Brisker  wrote:
>>>
 Hi David,

 Glad to hear this worked out.

 Yes, you are correct - when a host sends its facts, the fact parser
 attempts to map those facts, such as os, to existing foreman entities, and
 if it doesn't find a match it will attempt to create a new one.
 It would seem that at a certain point in the process, with the OSes you
 had defined, it failed to find a match and attempted to create a new one,
 only to fail because it already existed.

 If you would be so kind as to attach the properties of the OSes in
 question, as well as the relevant parts of the host's facter output, to the
 issue, we would be able to attempt to reproduce this locally and fix the
 root cause of this for all of our users.

 Thanks,
 Tomer

 On Wed, Sep 7, 2016 at 5:25 AM, David LeVene 
 wrote:

> Hi Tomer,
>
> Thanks for the guidance - I believe i've worked out the problem. The
> OS's had the name of "CentOS" which is fine, but i had 2 which had the 
> same
> major and minor version listed, well one actually had "2.1511" but i
> believe it was truncating after the 

Re: [foreman-users] [Katello] Applicable vs Installable errata

2016-09-13 Thread Edgars M.
Hi Walden

I took one content host and compared web gui and API results, here is what 
I see:

WebGUI:




And this is if I call API:


[em@katello.local ~]$ curl 
https://katello.local/api/v2/hosts/291/errata?errata_restrict_applicable=true 
-u em | python -m json.tool | grep errata_id
Enter host password for user 'em':
  % Total% Received % Xferd  Average Speed   TimeTime Time 
 Current
 Dload  Upload   Total   SpentLeft 
 Speed
100 593570 593570 0  74973  0 --:--:-- --:--:-- --:--:-- 
74945
"errata_id": "RHSA-2016:1664",
"errata_id": "RHSA-2015:1623",
"errata_id": "RHBA-2015:1827",
"errata_id": "RHBA-2016:1185",
"errata_id": "RHBA-2015:1466",
"errata_id": "RHSA-2015:1272",
"errata_id": "RHSA-2016:1406",
"errata_id": "RHSA-2016:0855",
"errata_id": "RHSA-2015:2636",
"errata_id": "RHBA-2015:1992",
"errata_id": "RHSA-2016:0494",
"errata_id": "RHBA-2016:0150",
"errata_id": "RHSA-2016:0715",


[em@katello.local ~]$ curl 
https://katello.local/api/v2/hosts/291/errata?errata_restrict_installable=true 
-u em | python -m json.tool | grep errata_id
Enter host password for user 'em':
  % Total% Received % Xferd  Average Speed   TimeTime Time 
 Current
 Dload  Upload   Total   SpentLeft 
 Speed
100 593570 593570 0  15410  0 --:--:--  0:00:03 --:--:-- 
15409
"errata_id": "RHSA-2016:1664",
"errata_id": "RHSA-2015:1623",
"errata_id": "RHBA-2015:1827",
"errata_id": "RHBA-2016:1185",
"errata_id": "RHBA-2015:1466",
"errata_id": "RHSA-2015:1272",
"errata_id": "RHSA-2016:1406",
"errata_id": "RHSA-2016:0855",
"errata_id": "RHSA-2015:2636",
"errata_id": "RHBA-2015:1992",
"errata_id": "RHSA-2016:0494",
"errata_id": "RHBA-2016:0150",
"errata_id": "RHSA-2016:0715",



As you can see result is the same. Please file a bug if you know what is 
wrong.


Edgars



pirmdiena, 2016. gada 12. septembris 17:15:14 UTC+2, Walden Raines rakstīja:
>
> Hey Edgars, 
>
> The documentation is correct so if you are seeing non-installable errata 
> show up on that page then it is a bug. 
>
> Out of curiosity, if you go to 
> /api/v2/hosts/2/errata?errata_restrict_applicable=true do you see a list of 
> errata without kernel updates? 
>
> I think I see what the bug is and am happy to file it unless you want to. 
>
> Thanks, 
> Walden 
>
> - Original Message - 
> From: "Edgars M."  
> To: "Foreman users"  
> Sent: Monday, September 12, 2016 10:17:06 AM 
> Subject: [foreman-users] [Katello] Applicable vs Installable errata 
>
> Hi 
>
> I have question regarding Applicable and Installable errata on content 
> hosts. This is from documentation: 
>
> With regard to Content Hosts, Errata is divided into two distinct 
> > classifications depending on whether or not the Errata is present in the 
> > Content Host’s Lifecycle Environment and Content View: 
> > 
> >- Applicable: the errata applies to one or more Content Hosts 
> >- Installable: the errata applies to one or more Content Hosts and is 
> >present in the Content Host’s Lifecycle Environment and Content View 
> > 
> > 
> As far as I understand errata which is filtered out of Content View (not 
> present in CV) is not Installable errata, but is Applicable errata. Am I 
> right? But the thing is - when I go to Content Host -> Errata, where I can 
> see Installable errata I see all erratas including those I have filtered 
> out of CV. Is it a bug and GUI shows Applicable errata instead of 
> Installable? Or bug in documentation? 
>
> For example, I have filtered out all kernel packages from CV. So these 
> packages should be Applicable but not Installable, but here is what I see: 
>
> <
> https://lh3.googleusercontent.com/-IB4y-cgbTQo/V9a4ShuQ7JI/ADM/43cr_J6ORWo6LjwIjyPLXgvgioY4Iey3QCLcB/s1600/errata.JPG>
>  
>
>
>
> I see all kernel packages as installable, although I have filtered them 
> out 
> and when I do yum check-update they do not appear as available update. 
>
>
> Katello 3.1 
>
>
> Edgars 
>   
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Foreman users" group. 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to foreman-user...@googlegroups.com . 
> To post to this group, send email to forema...@googlegroups.com 
> . 
> Visit this group at https://groups.google.com/group/foreman-users. 
> For more options, visit https://groups.google.com/d/optout. 
>

-- 
You