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 #1

Updated by Marek Hulán about 8 years ago

  • Status changed from New to Assigned
Actions #2

Updated by Dominic Cleal about 8 years ago

  • Related to Bug #14239: Creating a host via API fails with cryptic error when no primary interface is set explicitly added
Actions #3

Updated by The Foreman Bot about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3346 added
Actions #4

Updated by Marek Hulán about 8 years ago

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

Updated by Ohad Levy about 8 years ago

  • Related to Bug #14516: Host::Base#domain_id= delegated to primary_interface.domain_id=, but primary_interface is nil added
Actions

Also available in: Atom PDF