Comments (13)
@jrafanie Here are the steps to reproduce the problem:
git clone [email protected]:ManageIQ/manageiq.git
- Run the server using
bin/rails s
- Using rails console, add a couple of physical chasses using
chassis = ManageIQ::Providers::Redfish::PhysicalInfraManager::PhysicalChassis.new( :name => "my_redfish_chassis")
chassis.save!
chassis = ManageIQ::Providers::Lenovo::PhysicalInfraManager::PhysicalChassis.new( :name => "my_lenovo_chassis")
chassis.save!
- Log into MiQ and hit
http://localhost:3000/physical_chassis
and it should load the two chasses just created. - Stop ManageIQ.
git clone [email protected]:ManageIQ/manageiq-api.git
- create file
<mangeiq_dir>/bundler.d/overrides.rb
- To override, the default manageiq-api, add to the
overrides.rb
override_gem "manageiq-api", :path => "<PATH_TO _THE_PARENT_DIR>/manageiq-api
- Start ManageIQ, login and hit
http://localhost:3000/physical_chassis
PROBLEM: Page not found and the development log should show the FATAL errors reported in the original description.
from manageiq-api.
Hugh step back but why is controllers/api on the load path? That alone feels like recipe for disaster, because it effectively unnamespaces from autoloads point of view
from manageiq-api.
The controller is actually namespaced right... so, possibly the culprit is something in graphql:
manageiq-graphql-5f68621f2791/lib/manageiq/graphql/rest_api_proxy.rb:18:in `call'
Not sure what that's doing there or why it gets called though.
from manageiq-api.
Could not reproduce the problem when using master stream and no bundler.d/overrides.rb used.
Could reproduce the problem when "bundler.d/overrides.rb" was used to load "manageiq-api".
from manageiq-api.
@thearifismail asked me to take a look at this... I can't recreate this. I can envision the only way this can occur:
irb(main):002:0> pp $LOAD_PATH.grep(/controllers/)
["/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-v2v-63d961599bea/app/controllers",
"/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-ui-classic-01c014825f79/app/controllers/mixins",
"/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-ui-classic-01c014825f79/app/controllers",
"/Users/joerafaniello/.gem/ruby/2.4.5/gems/high_voltage-3.0.0/app/controllers",
"/Users/joerafaniello/.gem/ruby/2.4.5/gems/high_voltage-3.0.0/app/controllers/concerns",
"/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-graphql-82fdd9385bdd/app/controllers",
"/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-api-55621be8daa6/app/controllers/api",
"/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-api-55621be8daa6/app/controllers"]
Something tries to autoload the constant PhysicalChassisController
using the "/Users/joerafaniello/.gem/ruby/2.4.5/bundler/gems/manageiq-api-55621be8daa6/app/controllers/api"
from the load path. The constant defined by that file is Api:: PhysicalChassisController
. I tried dropping the other controller paths from the load path and couldn't recreate it so I have something wrong.
Does this only happen in dev mode? Maybe it's not code reloading friendly?
from manageiq-api.
@himdel ^
from manageiq-api.
To see if the problem was caused by overriding just the manageiq-api
or other plugins also, I used manageiq-graphql
and removed manageiq-api
from the bundler.d/overrides.rb
. The problem went away. It appears that the problem occurs only in dev mode and is limited to manageiq-api
.
This is what I get:
irb(main):020:0> pp $LOAD_PATH.grep(/controllers/)
["/Users/aarif/Documents/dev-ws/manageiq-api-thearifismail/app/controllers/api",
"/Users/aarif/Documents/dev-ws/manageiq-api-thearifismail/app/controllers",
"/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-v2v-63d961599bea/app/controllers",
"/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-ui-classic-2359c9dfbb77/app/controllers/mixins",
"/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-ui-classic-2359c9dfbb77/app/controllers",
"/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/high_voltage-3.0.0/app/controllers",
"/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/high_voltage-3.0.0/app/controllers/concerns",
"/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-graphql-82fdd9385bdd/app/controllers"]
=> ["/Users/aarif/Documents/dev-ws/manageiq-api-thearifismail/app/controllers/api", "/Users/aarif/Documents/dev-ws/manageiq-api-thearifismail/app/controllers", "/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-v2v-63d961599bea/app/controllers", "/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-ui-classic-2359c9dfbb77/app/controllers/mixins", "/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-ui-classic-2359c9dfbb77/app/controllers", "/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/high_voltage-3.0.0/app/controllers", "/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/high_voltage-3.0.0/app/controllers/concerns", "/Users/aarif/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/bundler/gems/manageiq-graphql-82fdd9385bdd/app/controllers"]
irb(main):021:0>
from manageiq-api.
@jrafanie I'm not quite sure if it's limited to dev mode or just less likely to appear otherwise, but for me, the surest way to recreate the issue in cases it went away was to simply touch manageiq-api/app/controllers/api/physical_chassis_controller.rb
.
So, yeah, I'm guessing autoloader issues..
from manageiq-api.
I can replicate the error by performing the following steps:
- Checkout latest master branch of
manageiq
core repo. - Remove all overrides from
bundler.d
. - Run
bin/update
. - Add
override_gem "manageiq-api", :path => "/path/to/manageiq-api
to overrides, where/path/to/manageiq-api
repo has checked-out latest master. - Visit http://localhost:3000/physical_chassis/show_list
If I remove the override, the error is gone.
from manageiq-api.
Hugh step back but why is controllers/api on the load path? That alone feels like recipe for disaster, because it effectively unnamespaces from autoloads point of view
Good point. I believe I tried removing the controllers/api from the autoload path at some point and it was a disaster. It's probably the best thing to do even if it's breaks everywhere. I'll see if I can dig up the problems I encountered when I did that.
from manageiq-api.
Taking it a step further, when you put a directory on the autoloads path, that implies the directory name is not in the namespace (e.g. we don't have Mixins::PasswordMixin). The fact that Api:: is a thing should preclude it from being on the autoload path
from manageiq-api.
I think this can be closed now that the autoload_path no longer contains manageiq-api/app/controllers/api.
If anyone can reproduce on the latest code, please feel free to reopen,
from manageiq-api.
π I just retried #489 (comment) and I can't reproduce it anymore :)
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
- Template API Issue with child_resources HOT 5
- 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 6
- Issue while creating a Custom Button with expression via API HOT 9
- Incorrect work of role accesses in API HOT 6
- 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 9
- 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.