Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation failed: ManageIQ::providers::openstack::cloudmanager::template cannot be a descendant of itself. #862

Open
SanthoshRam-03 opened this issue Sep 27, 2023 · 12 comments
Assignees

Comments

@SanthoshRam-03
Copy link

Hi @Fryguy @agrare

I am facing this issue when we connecting with provider openstack it is showing the validation failed error.

I shared the screenshot below,

image

evm.log

image

Can you suggest me any solution for this issue.

@agrare agrare self-assigned this Sep 27, 2023
@agrare agrare added the bug label Sep 27, 2023
@agrare
Copy link
Member

agrare commented Sep 27, 2023

That is an interesting one @SanthoshRam-03 , what version is this and did it start happening e.g. after an upgrade or just randomly?

@SanthoshRam-03
Copy link
Author

Hi @agrare

Thanks for quick response,

We are using Petrosian-1 version.

When we connect with default domain it works as expected.

When we try to connect with different domain (other than the default openstack domain) it's not working as expected and gives us errors.

@remo233
Copy link

remo233 commented Oct 2, 2023

Hi @agrare ,

Is there any update on the same. We are facing the same issue in our manageiq environment too

@agrare
Copy link
Member

agrare commented Oct 2, 2023

@remo233 is it also failing for you in non-default domains? Did this start happening on an upgrade to a specific version?

@remo233
Copy link

remo233 commented Oct 2, 2023

Hi @agrare ,

Yes, its failing for non-default domains. Also its happening in najdrof, oparin and petrosian.

I think it is happening in particular snapshots. So, can we please provide me the commands or steps to check the exact errored template from manageiq.

@agrare
Copy link
Member

agrare commented Oct 2, 2023

Okay I'm surprised we haven't seen this before if it is failing all the way back in najdorf. Okay let me create another domain in my local openstack environment and see if I can reproduce it.

@SanthoshRam-03
Copy link
Author

Hi @agrare any update for this above issue?

@remo233
Copy link

remo233 commented Dec 8, 2023

Hi |

@agrare , any update on this ?

@SanthoshRam-03
Copy link
Author

SanthoshRam-03 commented Dec 12, 2023

Hi @remo233

FILE PATH: manageiq/providers/inventory/persister/builder/cloud_manager.rb

In the above file, I commented out the particular lines in the source code, and it worked.

def vm_and_miq_template_ancestry_save_block
lambda do |_ems, inventory_collection|
vms_inventory_collection = inventory_collection.dependency_attributes[:vms].try(:first)
miq_templates_inventory_collection = inventory_collection.dependency_attributes[:miq_templates].try(:first)

      return if vms_inventory_collection.blank? || miq_templates_inventory_collection.blank?

      # Fetch IDs of all vms and genealogy_parents, only if genealogy_parent is present
             #       vms_genealogy_parents = vms_inventory_collection.data.each_with_object({}) do |x, obj|
             #         unless x.data[:genealogy_parent].nil?
             #           genealogy_parent_id = x.data[:genealogy_parent].load.try(:id)
             #           obj[[x.id](http://x.id/)] = genealogy_parent_id if genealogy_parent_id
             #         end
             #      end
          
             #       miq_template_genealogy_parents = miq_templates_inventory_collection.data.each_with_object({}) do |x, obj|
             #         unless x.data[:genealogy_parent].nil?
             #           genealogy_parent_id = x.data[:genealogy_parent].load.try(:id)
             #           obj[[x.id](http://x.id/)] = genealogy_parent_id if genealogy_parent_id
             #         end
             #       end
          
             #       ActiveRecord::Base.transaction do
                      # associate parent templates to child instances
             #        parent_miq_templates = miq_templates_inventory_collection.model_class
             #                                                                  .where(:id => vms_genealogy_parents.values).find_each.index_by(&:id)
             #         vms_inventory_collection.model_class
             #                                 .where(:id => vms_genealogy_parents.keys).find_each do |vm|
             #           vm.update!(:genealogy_parent => parent_miq_templates[vms_genealogy_parents[[vm.id](http://vm.id/)]])
             #         end
             #       end
          
             #       ActiveRecord::Base.transaction do
                      # associate parent instances to child templates
             #         parent_vms = vms_inventory_collection.model_class
             #                                              .where(:id => miq_template_genealogy_parents.values).find_each.index_by(&:id)
             #         miq_templates_inventory_collection.model_class
             #                                           .where(:id => miq_template_genealogy_parents.keys).find_each do |miq_template|
             #           miq_template.update!(:genealogy_parent => parent_vms[miq_template_genealogy_parents[[miq_template.id](http://miq_template.id/)]])
             #         end
             #       end
    end
    

    **EXPLANATION:**

If the "vm_and_miq_template_ancestry_save_block" references the non-existent genealogy_parent column and you've ensured that this column is not required for the refresh functionality to work, then these changes should not negatively affect the refresh process.

Hi @agrare Is this correct?

@miq-bot
Copy link
Member

miq-bot commented Mar 18, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

@miq-bot miq-bot added the stale label Mar 18, 2024
@miq-bot
Copy link
Member

miq-bot commented Jun 24, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

1 similar comment
@miq-bot
Copy link
Member

miq-bot commented Sep 30, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants