Problem: After uninstalling Proxmox plugin the about site is broken:
Oops, we’re sorry but something went wrong: The single-table inheritance mechanism failed to locate the subclass: ‘ForemanFogProxmox::Proxmox’. This error is raised because the column ‘type’ is reserved for storing the class in case of inheritance. Please rename this column if you didn’t intend it to be used for storing the inheritance class or overwrite ComputeResource.inheritance_column to use another column for that information.
Expected outcome: A non-broken about site.
Foreman and Proxy versions: 1.22
Foreman and Proxy plugin versions: 1.22
Other relevant data:
What I’ve done: After upgrade I get `[]=' for nil:NilClass errors - #4 by mfuhrmann
Unfortunately, removing plugins can be difficult as they sometimes makes changes to the DB as part of their installation and we don’t have a good way of removing these changes. For this specific error, you can try running the following command in the foreman-rake console
:
ComputeResource.where(type: 'ForemanFogProxmox::Proxmox').delete_all
This should delete the proxmox compute resource that was configured. (You will likely see the same error on the compute resources page as well)
Thanks @tbrisker
Unfortunately, I had to remove the Proxmox plugin because it does not work in Foreman 1.22.
It does not work:
[10:13]root@rmvm069:~# foreman-rake console
ComputeResource.where(type: 'ForemanFogProxmox::Proxmox').delete_all
Loading production environment (Rails 5.2.1)
irb(main):001:0> ComputeResource.where(type: 'ForemanFogProxmox::Proxmox').delete_all
ActiveRecord::InvalidForeignKey: PG::ForeignKeyViolation: ERROR: update or delete on table "compute_resources" violates foreign key constraint "compute_attributes_compute_resource_id_fk" on table "compute_attributes"
DETAIL: Key (id)=(1) is still referenced from table "compute_attributes".
: DELETE FROM "compute_resources" WHERE "compute_resources"."type" = $1
from (irb):1
from lib/tasks/console.rake:5:in `block in <top (required)>'
irb(main):002:0>
Right, looks like you also need to remove the compute profile associations. Please try the following:
cr = ComputeResource.where(type: 'ForemanFogProxmox::Proxmox')
ComputeAttribute.where(compute_resource_id: cr.pluck(:id)).delete_all
cr.delete_all
1 Like
Yes! Now the about site works great again!
Thanks a lot!