Code Monkey home page Code Monkey logo

Comments (5)

GilbertCherrie avatar GilbertCherrie commented on July 17, 2024 1

I fixed the issue and will get a PR out. After reviewing the vm controller file it turns out the vm is not actually sending in the parent and child resources to the update call. These are only used in different functions that set the parent and child relationships. So after adding in the logic from the vm controller file, the template controller file seems to be fixed now.

from manageiq-api.

Fryguy avatar Fryguy commented on July 17, 2024

So, as discussed, the templates controller doesn't accept the parent_resource and child_resources, but I also didn't think it should blow up, since the templates controller explicitly removes everything except name and description. Do you have a stack trace?

from manageiq-api.

GilbertCherrie avatar GilbertCherrie commented on July 17, 2024
[----] F, [2022-01-18T11:16:07.391216 #56877:ba568] FATAL -- : Error caught: [ActiveRecord::AssociationNotFoundError] Association named 'child_resources' was not found on ManageIQ::Providers::Redhat::InfraManager::Template; perhaps you misspelled it?
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/associations.rb:235:in `association'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/associations/builder/association.rb:108:in `child_resources='
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activemodel-6.0.4.4/lib/active_model/attribute_assignment.rb:50:in `public_send'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activemodel-6.0.4.4/lib/active_model/attribute_assignment.rb:50:in `_assign_attribute'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activemodel-6.0.4.4/lib/active_model/attribute_assignment.rb:43:in `block in _assign_attributes'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activemodel-6.0.4.4/lib/active_model/attribute_assignment.rb:42:in `each'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activemodel-6.0.4.4/lib/active_model/attribute_assignment.rb:42:in `_assign_attributes'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/attribute_assignment.rb:21:in `_assign_attributes'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activemodel-6.0.4.4/lib/active_model/attribute_assignment.rb:35:in `assign_attributes'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/persistence.rb:634:in `block in update!'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/transactions.rb:375:in `block in with_transaction_returning_status'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/transactions.rb:212:in `transaction'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/transactions.rb:366:in `with_transaction_returning_status'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/persistence.rb:633:in `update!'
/Users/gilbertcherrie/manageiq-api/app/controllers/api/base_controller/generic.rb:47:in `edit_resource'
/Users/gilbertcherrie/manageiq-api/app/controllers/api/templates_controller.rb:11:in `edit_resource'
/Users/gilbertcherrie/manageiq-api/app/controllers/api/base_controller/manager.rb:101:in `update_one_collection'
/Users/gilbertcherrie/manageiq-api/app/controllers/api/base_controller/manager.rb:23:in `update_collection'
/Users/gilbertcherrie/manageiq-api/app/controllers/api/base_controller.rb:98:in `update'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/abstract_controller/base.rb:195:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/callbacks.rb:135:in `run_callbacks'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/abstract_controller/callbacks.rb:41:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal/rescue.rb:22:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/notifications.rb:180:in `block in instrument'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-6.0.4.4/lib/active_support/notifications.rb:180:in `instrument'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activerecord-6.0.4.4/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/abstract_controller/base.rb:136:in `process'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal.rb:190:in `dispatch'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_controller/metal.rb:254:in `dispatch'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_dispatch/routing/route_set.rb:33:in `serve'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_dispatch/journey/router.rb:49:in `block in serve'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_dispatch/journey/router.rb:32:in `each'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_dispatch/journey/router.rb:32:in `serve'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/actionpack-6.0.4.4/lib/action_dispatch/routing/route_set.rb:834:in `call'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rack-attack-6.5.0/lib/rack/attack.rb:113:in `call'
/Users/gilbertcherrie/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/routes_lazy_routes-0.4.2/li...

from manageiq-api.

Fryguy avatar Fryguy commented on July 17, 2024

@kbrock Can you help @GilbertCherrie here? it's almost like the values aren't being removed?

from manageiq-api.

GilbertCherrie avatar GilbertCherrie commented on July 17, 2024

@Fryguy I guess I wasn't too clear but on my local API code I changed the code so that it doesn't remove any values. This error is the result of that. I just thought the edit should still work even if all the logic is missing in the api code for the parent and children.

from manageiq-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.