Project

General

Profile

Actions

Bug #14264

closed

Getting 500 when creating host through API and not specifying any interface attributes

Added by Marek Hulán about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Getting following trace

2016-03-18T12:43:29 [app] [W] Action failed
 | NoMethodError: undefined method `[]=' for nil:NilClass
 | /home/ares/Projekty/Zdrojaky/foreman/app/controllers/api/v2/hosts_controller.rb:289:in `host_attributes'
 | /home/ares/Projekty/Zdrojaky/foreman/app/controllers/api/v2/hosts_controller.rb:98:in `create'

https://github.com/theforeman/foreman/commit/38d9333f8e82e45fc6771ea7740e6ea625b97d3f is not careful enough, also I think it should be rather fixed in host model than in API controller.


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #14239: Creating a host via API fails with cryptic error when no primary interface is set explicitlyClosedTom Caspy03/16/2016Actions
Related to Foreman - Bug #14516: Host::Base#domain_id= delegated to primary_interface.domain_id=, but primary_interface is nilClosedMarek Hulán04/07/2016Actions
Actions

Also available in: Atom PDF