Project

General

Profile

Actions

Bug #9314

closed

power-state change on vms in aws-compute resource cause 500 server error

Added by Brian Galura about 9 years ago. Updated about 9 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I have not been able to get power actions to work through the v2 API on foreman 1.7.1. I am following the API spec here: http://theforeman.org/api/apidoc/v2/hosts/power.html

curl -X PUT --user user:pass -H "Content-Type: application/json" -d '{"power_action":"status","host":{}}' https://foreman/api/v2/hosts/testhost.example.com/power

{

"error": {"message":"undefined method `search_for' for #<Class:0x000000045395e0>"}

}

Full stack trace: http://pastebin.com/dtwx6x2e

The same operation works OK in the UI.

[ ~]# foreman-debug

HOSTNAME: foreman2.cs.ops.expertcity.com
OS: redhat
RELEASE: Red Hat Enterprise Linux Server release 6.6 (Santiago)
FOREMAN: 1.7.1
RUBY: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
PUPPET:
DENIALS: 0

A debug file has been created: /tmp/foreman-debug-ORzeH.tar.bz2 (18797850 bytes)

You may want to upload the tarball to our public server via rsync. There is a
write only directory (readable only by Foreman core developers) for that. Note
the rsync transmission is UNENCRYPTED:

rsync /tmp/foreman-debug-ORzeH.tar.bz2 rsync://theforeman.org/debug-incoming

Do you want to do this now? [y/N] y
Uploading...
The tarball has been uploaded, please contact us on mailing list or IRC.


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #8812: Pass model type in API base controllerClosed12/30/2014Actions
Actions #1

Updated by Dominic Cleal about 9 years ago

  • Is duplicate of Bug #8812: Pass model type in API base controller added
Actions #2

Updated by Dominic Cleal about 9 years ago

  • Status changed from New to Duplicate

Thanks for the report, we have a patch tracked under #8812 which fixes this error that occurs for non-admin users.

Actions

Also available in: Atom PDF