Project

General

Profile

Actions

Bug #21037

closed

"Invalid single-table inheritance type: Host::Discovered is not a subclass of Host::Managed" caused by auditing host

Added by Ivan Necas over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

In the host auditing, we're setting the auditable_class to Host. And in the Host, we're redirecting
all the methods to the Host::Managed. This causes issues, when converting the host from discovered
to managed and creating an audit record of it.

Reproducer (having a discovered host).

host2 = host.become(Host::Managed)
host2.type = "Host::Managed" 
host2.save

Related issues 3 (0 open3 closed)

Related to Discovery - Bug #20972: STI issues with Host::Discovered on Rails 5Duplicate09/17/2017Actions
Related to Foreman - Bug #25207: Invalid single-table inheritance type: Host::Discovered is not a subclass of Host::ManagedClosedLukas ZapletalActions
Related to Discovery - Bug #25556: 'Discovery manager' role brokenDuplicateActions
Actions #1

Updated by The Foreman Bot over 6 years ago

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

Updated by The Foreman Bot over 6 years ago

  • Pull request https://github.com/theforeman/foreman/pull/4864 added
Actions #3

Updated by Anonymous over 6 years ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/4863)
Actions #4

Updated by Ivan Necas over 6 years ago

  • Related to Bug #20972: STI issues with Host::Discovered on Rails 5 added
Actions #5

Updated by Ivan Necas over 6 years ago

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

Updated by Marek Hulán over 6 years ago

  • translation missing: en.field_release set to 296
Actions #7

Updated by Lukas Zapletal over 6 years ago

  • translation missing: en.field_release changed from 296 to 240

I actually need this in 1.16 if Rails5 is part of that branch, this is discovery blocker.

Actions #8

Updated by Lukas Zapletal over 6 years ago

  • translation missing: en.field_release changed from 240 to 296

Ok Rails5 is not part of 1.16.

Actions #9

Updated by Lukas Zapletal over 5 years ago

  • Related to Bug #25207: Invalid single-table inheritance type: Host::Discovered is not a subclass of Host::Managed added
Actions #10

Updated by Lukas Zapletal over 5 years ago

  • Triaged set to No

Hello, we have an initial version of a patch that solves this. It's one liner, please apply it, restart and get back to me with feedback:

https://github.com/theforeman/foreman/pull/6192/files

Actions #11

Updated by Lukas Zapletal over 5 years ago

  • Related to Bug #25556: 'Discovery manager' role broken added
Actions

Also available in: Atom PDF