| Summary: | [new relic] EmbCartController#update raised NoMethodError: undefined method `external_port' for nil:NilClass | ||
|---|---|---|---|
| Product: | OpenShift Online | Reporter: | Jessica Forrester <jforrest> |
| Component: | Pod | Assignee: | Rajat Chopra <rchopra> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 1.x | CC: | jhou, rpenta |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-01-30 00:52:43 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Jessica Forrester
2013-12-09 14:51:52 UTC
Missing port interfaces of some gears will cause this. Should fix such gears by calling out expose ports for all components of the gears. Note to QE : 1. Create some scalable apps and manually remove the port_interfaces of some of them. 2. Then find out about the broken apps using the query in comment#4. 3. Run the attached script with the uuids from step 2 4. Check mongo to see that port_interfaces are restored. Also to be tested is that the fix script can be re-run several times without issues. There is an error executing the re-expose-ports.rb.
The test was performed against devenv-stage_570 on which the gears haven't been flattened(gears were embedded in group_instances)
1. Create one scalable php app with mysql
2. Delete one port_interface using rockmongo interface
3. Execute the query to list the app uuid needing fix:
libra_rs:PRIMARY> db.applications.find( {"scalable" : true, $where : "function() { for(var j=0; j < this.group_instances.length; j++) {for(var i=0; i<this.group_instances[j].gears.length; i++) { if( !this.group_instances[j].gears[i].port_interfaces || this.group_instances[j].gears[i].port_interfaces.length == 0 ) { return true; }}} return false; } " } , { "_id" : 1, "uuid" : 1})
{ "_id" : ObjectId("52a7103109a9c12653000006"), "uuid" : "52a7103109a9c10ae5000001" }
4. Add the uuid to the script, and execute it, an error show up.
[root@ip-10-183-191-83 ~]# ruby re-expose-ports.rb
/opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/attributes.rb:249:in `method_missing': undefined method `has_component?' for #<Gear:0x000000073c8b18> (NoMethodError)
from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.16.12/app/models/gear.rb:268:in `method_missing'
from re-expose-ports.rb:21:in `block (4 levels) in <main>'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/proxy.rb:143:in `each'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/proxy.rb:143:in `method_missing'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/embedded/many.rb:396:in `method_missing'
from re-expose-ports.rb:20:in `block (3 levels) in <main>'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/proxy.rb:143:in `each'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/proxy.rb:143:in `method_missing'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/embedded/many.rb:396:in `method_missing'
from re-expose-ports.rb:19:in `block (2 levels) in <main>'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/proxy.rb:143:in `each'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/proxy.rb:143:in `method_missing'
from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/embedded/many.rb:396:in `method_missing'
from re-expose-ports.rb:18:in `block in <main>'
from re-expose-ports.rb:11:in `each'
from re-expose-ports.rb:11:in `<main>'
Not sure what code is carried in devenv_stage-570. has_component? method was introduced with 2.0.36 release so it will not be available on AMIs before that. Could you test it on code from stage-2.0.36? sorry, I missed the devenv-stage_601 which has stage-2.0.36 and does not have flattened gears.
1. Create one scalable php app with mysql
2. Delete one port_interface using rockmongo interface
3. Execute the query to list the app uuid needing fix:
libra_rs:PRIMARY> db.applications.find( {"scalable" : true, $where : "function() { for(var j=0; j < this.group_instances.length; j++) {for(var i=0; i<this.group_instances[j].gears.length; i++) { if( !this.group_instances[j].gears[i].port_interfaces || this.group_instances[j].gears[i].port_interfaces.length == 0 ) { return true; }}} return false; } " } , { "_id" : 1, "uuid" : 1})
{ "_id" : ObjectId("52a7c897ac7b63c02c00004b"), "uuid" : "52a7c897ac7b630a58000005" }
{ "_id" : ObjectId("52a7cac3ac7b6370a200001a"), "uuid" : "52a7cac3ac7b63253c000003" }
4. Run re-expose-ports.rb
[root@domU-12-31-39-07-79-26 ~]# ruby re-expose-ports.rb
Completed exposing ports for 52a7c897ac7b630a58000005
Completed exposing ports for 52a7cac3ac7b63253c000003
5. Re-check mongo, and the applications are fixed.
6. Delete some other port_interfaces, re-execute the script
There are no errors
|