Comments (5)
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.
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.
[----] 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.
@kbrock Can you help @GilbertCherrie here? it's almost like the values aren't being removed?
from manageiq-api.
@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)
- Slow API requests part deux HOT 17
- Switch tag subcollection missing HOT 2
- Api for timeline charts. HOT 7
- Need API for Cloud Volume Snapshot Subcollection HOT 3
- Sporadic test failure in authentication_spec HOT 4
- vm_reconfigure request has no effect on vm params HOT 10
- Need Policy Simulation Endpoints for non-VM options HOT 2
- If a resource doesnโt come in as hash or `{}` return bad request error HOT 4
- Sporadic test failure with authentication_spec HOT 12
- API Interface Changes HOT 5
- Issue while creating a Custom Button with expression via API HOT 9
- Incorrect work of role accesses in API HOT 5
- New API endpoints HOT 2
- [OPARIN] API Interface Changes
- Add support for Native Console over the API /vm#request_console
- [RFE] Ability to change Catalog Item Request Info via API HOT 8
- Auth API action
- Can't create a user for multiple groups HOT 7
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manageiq-api.