Description of problem: If deleting a domain with app by oo-admin-ctl-domain, will meet Mongoid::Errors::DeleteRestriction errors. Version-Release number of selected component (if applicable): devenv_3434 How reproducible: always Steps to Reproduce: 1. Setup an account and create a domain named "cdm" rhc setup --server ec2-54-242-245-159.compute-1.amazonaws.com -l chunchen 2. Create an app rhc app create cdiy diy-0.1 --no-git 3. SSH into the instance and delete this domain by oo-admin-ctl-domain oo-admin-ctl-domain -l chunchen -c delete -n cdm Actual results: /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/cascading/restrict.rb:32:in `cascade': (Mongoid::Errors::DeleteRestriction) Problem: Cannot delete Domain because of dependent 'applications'. Summary: When defining 'applications' with a :dependent => :restrict, Mongoid will raise an error when attempting to delete the Domain when the child 'applications' still has documents in it. Resolution: Don't attempt to delete the parent Domain when it has children, or change the dependent option on the relation. from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/cascading.rb:32:in `block in cascade!' from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/cascading.rb:28:in `each' from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/relations/cascading.rb:28:in `cascade!' from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/persistence/deletion.rb:22:in `prepare' from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/persistence/operations/remove.rb:26:in `persist' from /opt/rh/ruby193/root/usr/share/gems/gems/mongoid-3.0.21/lib/mongoid/persistence.rb:62:in `remove' from /usr/sbin/oo-admin-ctl-domain:257:in `<main>' Expected results: Should only return a short error messages like "Your domain contains applications. Delete applications first." Additional info:
Fixed in https://github.com/openshift/origin-server/pull/2994
Commits pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/258dcb2d73dea5b3edc18e8bfb7442b2164212b0 Bug 980333 - Add missing 'exit 1' in oo-admin-ctl-domain https://github.com/openshift/origin-server/commit/179cbade56db0d92ab6f7eac50a75a0e6cf3ca62 Merge pull request #2994 from pravisankar/dev/ravi/bug980333 Merged by openshift-bot
It's fixed, checked on devenv_3456, please help to change status to ON_QA, then i will modify to VERIFIED. Please refer to the following results: 1. Setup an account and create a domain named "cdm" 2. Create an app 3. SSH into the instance and delete this domain by oo-admin-ctl-domain oo-admin-ctl-domain -l chunchen -c delete -n cdm Actual results: User still has applications. Delete them first.