Bug 738200 - createConsumer fails: {"errors":["User admin is not allowed to access api/systems/activate"]}
Summary: createConsumer fails: {"errors":["User admin is not allowed to access api/sys...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Ivan Necas
QA Contact: Garik Khachikyan
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-09-14 10:24 UTC by Garik Khachikyan
Modified: 2019-09-25 21:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 17:56:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Garik Khachikyan 2011-09-14 10:24:27 UTC
Description of problem:
Following is the call which fails with "{"errors":["User admin is not allowed to access api/systems/activate"]}" during a try of customer creation:
---
curl -k -s -uadmin:admin -H "Accept: application/json" -H "content-type: application/json" -d "{'org_name':'auto-org-1315994915', 'facts':{'dmi.bios.relase_date':'01/01/2007', 'net.interface.lo.ipaddr':'127.0.0.1', 'network.hostname':'auto-1315994918.brq.redhat.com', 'cpu.hypervisor_vendor':'KVM', 'system.entitlements_valid':true, 'dmi.memory.type':'RAM', 'dmi.bios.address':'0xe8000', 'dmi.bios.runtime_size':'96 KB', 'distribution.id':'Santiago', 'dmi.memory.maximum_capacity':'1 GB', 'dmi.chassis.asset_tag':'Not Specified', 'dmi.memory.bank_locator':'Not Specified', 'cpu.virtualization_type':'full', 'net.interface.eth0.hwaddr':'54:52:00:69:55:b6', 'dmi.system.wake-up_type':'Power Switch', 'dmi.chassis.boot-up_state':'Safe', 'distribution.name':'Red Hat Enterprise Linux Server', 'cpu.thread(s)_per_core':'1', 'dmi.chassis.manufacturer':'RED HAT', 'dmi.bios.bios_revision':'1.0', 'dmi.chassis.version':'Not Specified', 'distribution.version':'6.1', 'uname.version':'#1 SMP Tue Apr 5 19:58:31 EDT 2011', 'net.interface.lo.hwaddr':'00:00:00:00:00:00', 'dmi.bios.vendor':'QEMU', 'dmi.memory.error_correction_type':'Multi-bit ECC', 'dmi.memory.locator':'DIMM 0', 'dmi.system.manufacturer':'Red Hat', 'dmi.chassis.serial_number':'Not Specified', 'dmi.bios.rom_size':'64 KB', 'cpu.stepping':'3', 'uname.release':'2.6.32-130.el6.x86_64', 'dmi.system.uuid':'83fa52d2-deb9-11e0-9652-00163e652d27', 'dmi.memory.array_handle':'0x1000', 'cpu.cpu_op-mode(s)':'32-bit, 64-bit', 'net.interface.eth0.netmask':'255.255.255.224', 'dmi.memory.data_width':'64 bit', 'memory.swaptotal':'1015800', 'net.interface.lo.broadcast':'0.0.0.0', 'dmi.chassis.lock':'Not Present', 'cpu.cpu_mhz':'2793.074', 'dmi.memory.speed':'  (ns)', 'uname.machine':'x86_64', 'dmi.memory.form_factor':'DIMM', 'dmi.memory.total_width':'64 bit', 'cpu.l1d_cache':'32K', 'virt.is_guest':true, 'cpu.cpu(s)':'1', 'net.interface.lo.netmask':'255.0.0.0', 'net.interface.eth0.broadcast':'10.34.56.31', 'dmi.memory.error_information_handle':'Not Provided', 'cpu.architecture':'x86_64', 'cpu.vendor_id':'GenuineIntel', 'dmi.processor.upgrade':'Other', 'dmi.system.sku_number':'Not Specified', 'cpu.bogomips':'5586.14', 'dmi.memory.location':'Other', 'dmi.chassis.thermal_state':'Safe', 'dmi.system.serial_number':'Not Specified', 'cpu.cpu_socket(s)':'1', 'dmi.processor.voltage':' ', 'uname.sysname':'Linux', 'dmi.system.family':'Red Hat Enterprise Linux', 'cpu.model':'6', 'dmi.processor.version':'Not Specified', 'uname.nodename':'auto-1315994918.brq.redhat.com', 'dmi.chassis.power_supply_state':'Safe', 'dmi.memory.use':'System Memory', 'dmi.system.version':'Not Specified', 'memory.memtotal':'1019852', 'cpu.on-line_cpu(s)_list':'0', 'dmi.system.status':'No errors detected', 'dmi.bios.version':'QEMU', 'cpu.numa_node(s)':'1', 'dmi.chassis.security_status':'Unknown', 'virt.host_type':'kvm', 'dmi.chassis.type':'Other', 'net.interface.eth0.ipaddr':'10.34.56.22', 'dmi.processor.type':'Central Processor', 'dmi.processor.socket_designation':'CPU 1', 'dmi.system.product_name':'KVM', 'cpu.byte_order':'Little Endian', 'dmi.processor.status':'Populated:Enabled', 'cpu.numa_node0_cpu(s)':'0', 'cpu.core(s)_per_socket':'1', 'dmi.memory.size':'1024 MB', 'network.ipaddr':'10.34.56.22', 'dmi.processor.family':'Other', 'cpu.cpu_family':'6'}, 'name':'auto-1315994918.brq.redhat.com', 'type':'system'}" -X POST https://<$KATELLO_SERVER>/katello/api/consumers?owner=auto-org-1315994915

Version-Release number of selected component (if applicable):
katello-0.1.81-1.git.0.e1d297a.fc15.noarch

How reproducible:
always on invoking the api call (note: NOT using RHSM).

Steps to Reproduce:
1.invoke the call above.
2.
3.
  
Actual results:
failing

Expected results:
success

Additional info:

Comment 1 Ivan Necas 2011-09-14 12:21:43 UTC
Fixed in commit c0b9ecd1987e36a249b92365b65bef38f099a59b

Note on the bug:

caused by params[:action] used instead of action_name. This variables don't have to represent the same value, especially with connection to constraints in router.

In router we had the following code:

match '/consumers' => 'systems#activate', :via => :post, :constraints => RegisterWithActivationKeyContraint.new
resources :consumers, :controller => 'systems'

Alhought the constraint was evaluated false, the params[:action] was set to "activate". action_name was correctly set to "create"

Comment 2 Garik Khachikyan 2011-09-23 11:47:18 UTC
# VERIFIED

checked against latest: katello-0.1.83-1.git.48.02111ba.fc15.noarch

system gets successfully registered.

Comment 5 Mike McCune 2013-08-16 17:51:35 UTC
getting rid of 6.0.0 version since that doesn't exist


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