Removal of Azure Plugin Breaks "About" Page

Problem:
After removing the Azure Plugin on 1.17 and 1.18, the About Page in Foreman throws an error.

Expected outcome:
The plugin removal should not break the About page.

Foreman and Proxy versions:
1.18

Foreman and Proxy plugin versions:
1.18

Other relevant data:
The About page now displays this error:
Oops, we’re sorry but something went wrong The single-table inheritance mechanism failed to locate the subclass: ‘ForemanAzure::Azure’. 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.

Please let me know if you’d like the trace output attached.

Do you still have an Azure Compute Resource configured under Compute Resources? I’m guessing since the stacktrace isn’t given, but I think it’s trying to render a compute resource that it no longer has the code for…

I don’t, only two compute resources for VMware. I’ve noticed this has also broken Host Groups - so I cannot modify them. If I try and re-install the plugin, it causes Foreman to fail to start completely.

Looks like there’s some leftover compute resource in the database, and manual cleanup will be needed. To remove it, you can open foreman-rake console and run the following command:

ComputeResource.where(type: 'ForemanAzure::Azure').destroy_all

If this also fails with the same error, you might need to manually also clean up all the associated objects if there are any:

az = ComputeResource.where(type: 'ForemanAzure::Azure')
Image.where(compute_resource: az).destroy_all
ComputeAttribute.where(compute_resource: az).destroy_all
az.delete_all

If this doesn’t work, can you please provide the stack trace from production.log when trying to load the about page?

Thanks, that second batch of code worked. It did find an old OpenLogic Azure Image I had created and removed it.

irb(main):003:0> Image.where(compute_resource: az).destroy_all => [#<Image id: 3, operatingsystem_id: 1, compute_resource_id: 3, architecture_id: 1, uuid: "5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS...", username: "root", name: "CentOS 7.4 Azure", created_at: "2018-01-29 14:38:26", updated_at: "2018-01-29 14:38:26", iam_role: nil, user_data: false, password: nil>]

My About Page and Host Groups pages are functional again.