Project

General

Profile

Bug #16484

Cannot create new hostgroup via API/CLI

Added by Sachin Ghai almost 3 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1374253
Description of problem:
It is not possible to create new HostGroup via API or CLI.

  1. Hammer

hammer> hostgroup create --name=test
Could not create the hostgroup:
ActiveModel::ForbiddenAttributesError

  1. API

2016-09-07 18:03:49 - nailgun.client - DEBUG - Making HTTP POST request to https://example.com/api/v2/hostgroups with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and data {"hostgroup": {"name": "MbgZIiiZ"}}.
2016-09-07 18:03:50 - nailgun.client - WARNING - Received HTTP 500 response: {

"error": {"message":"ActiveModel::ForbiddenAttributesError"}
}

Version-Release number of selected component (if applicable):
Foreman 1.13.0-develop (nightly 2016-09-07)

How reproducible:
Always

Steps to Reproduce:
1. Create a new hostgroup, providing a valid name
2. E.g. with "hammer hostgroup create --name=test"
3.

Actual results:
1. "ActiveModel::ForbiddenAttributesError" error
2. hostgroup wasn't created.

Expected results:
Hostgroup should be created

Additional info:
foreman-debug:

OS: redhat
RELEASE: Red Hat Enterprise Linux Server release 7.2 (Maipo)
FOREMAN: 1.13.0-develop
RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
PUPPET: 3.8.7
DENIALS: 4

Installed packages:
  • candlepin-0.9.54.6-1.el7.noarch
  • candlepin-selinux-0.9.54.6-1.el7.noarch
  • foreman-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-compute-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-debug-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-ec2-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-gce-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-installer-1.13.0-0.develop.201609060324gitb49a16e.el7.noarch
  • foreman-installer-katello-3.2.0-1.nightly.201609062204git5de9187.el7.noarch
  • foreman-libvirt-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-openstack-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-ovirt-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-postgresql-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-proxy-1.13.0-0.develop.201609011824gite02ca04.el7.noarch
  • foreman-rackspace-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-release-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • foreman-release-scl-3-1.el7.noarch
  • foreman-selinux-1.13.0-0.develop.201608101426git264951f.el7.noarch
  • foreman-vmware-1.13.0-0.develop.201609051301git713be41.el7.noarch
  • katello-3.1.0-4.nightly.el7.noarch
  • katello-certs-tools-2.4.0-1.el7.noarch
  • katello-client-bootstrap-1.1.0-1.el7.noarch
  • katello-common-3.1.0-4.nightly.el7.noarch
  • katello-debug-3.1.0-4.nightly.el7.noarch
  • katello-default-ca-1.0-1.noarch
  • katello-installer-base-3.2.0-1.nightly.201609062204git5de9187.el7.noarch
  • katello-repos-3.2.0-2.nightly.el7.noarch
  • katello-selinux-3.0.1-1.el7.noarch
  • katello-server-ca-1.0-1.noarch
  • katello-service-3.1.0-4.nightly.el7.noarch
  • openldap-2.4.40-9.el7_2.x86_64
  • pulp-client-1.0-1.noarch
  • pulp-docker-plugins-2.0.3-1.el7.noarch
  • pulp-katello-1.0.2-1.el7.noarch
  • pulp-puppet-plugins-2.9.1-1.el7.noarch
  • pulp-puppet-tools-2.9.1-1.el7.noarch
  • pulp-rpm-plugins-2.9.1-1.el7.noarch
  • pulp-selinux-2.9.1-1.el7.noarch
  • pulp-server-2.9.1-1.el7.noarch
  • python-ldap-2.4.15-2.el7.x86_64
  • tfm-rubygem-ldap_fluff-0.4.3-1.el7.noarch
  • tfm-rubygem-net-ldap-0.15.0-1.el7.noarch
hammer_debug.txt hammer_debug.txt 7.53 KB Stanislav Tkachenko, 09/08/2016 07:31 AM
production.log production.log 19.2 KB Stanislav Tkachenko, 09/08/2016 07:31 AM
foreman-debug-q1fcm.tar.xz foreman-debug-q1fcm.tar.xz 463 KB Stanislav Tkachenko, 09/08/2016 07:31 AM

Related issues

Related to Katello - Bug #20862: Katello overrides apipie definition for hostgroupsClosed2017-09-06

Associated revisions

Revision 5608b835 (diff)
Added by Brad Buckingham almost 3 years ago

fixes #16484 - hostgroup - fix create params

Update to sync up the extensions params with foreman as well
as update to fix 'ActiveModel::ForbiddenAttributesError' error.

Revision a2ed5e0a
Added by Brad Buckingham almost 3 years ago

Merge pull request #6311 from bbuckingham/issue-16484

fixes #16484 - hostgroup - fix create params

History

#1 Updated by Dominic Cleal almost 3 years ago

  • Category set to API
  • Status changed from New to Need more information

Works fine here, please provide corresponding logs from Foreman and try again with fewer plugins installed to narrow down if something else is causing it.

2016-09-08 07:04:26 325061c1 [app] [I] Started POST "/api/hostgroups" for 127.0.0.1 at 2016-09-08 07:04:26 -0400
2016-09-08 07:04:26 325061c1 [app] [I] Processing by Api::V2::HostgroupsController#create as JSON
2016-09-08 07:04:26 325061c1 [app] [I]   Parameters: {"hostgroup"=>{"name"=>"test", "puppet_proxy_id"=>nil, "puppet_ca_proxy_id"=>nil, "puppetclass_ids"=>nil}, "apiv"=>"v2"}
2016-09-08 07:04:26 325061c1 [app] [I] Authorized user admin(Admin User)
2016-09-08 07:04:26 325061c1 [app] [I]   Rendered api/v2/hostgroups/create.json.rabl (23.9ms)
2016-09-08 07:04:26 325061c1 [app] [I] Completed 201 Created in 80ms (Views: 20.8ms | ActiveRecord: 15.4ms)

(on foreman-1.13.0-0.develop.201609051301git713be41.el7.noarch with Hammer CLI 0.8.0)

#2 Updated by Stanislav Tkachenko almost 3 years ago

Added tail of production log, hammer with debug enabled and foreman debug file.

#3 Updated by Dominic Cleal almost 3 years ago

  • Project changed from Foreman to Katello
  • Category deleted (API)
  • Status changed from Need more information to New

Appears to be Katello overriding the host groups API controller.

#4 Updated by Brad Buckingham almost 3 years ago

  • Assignee set to Brad Buckingham
  • Target version set to 126
  • Difficulty set to easy

#5 Updated by The Foreman Bot almost 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6311 added

#6 Updated by Brad Buckingham almost 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Justin Sherrill almost 3 years ago

  • Legacy Backlogs Release (now unused) set to 162

#8 Updated by Marek Hulán almost 2 years ago

  • Related to Bug #20862: Katello overrides apipie definition for hostgroups added

Also available in: Atom PDF