Bug 1515894 - [RFE] Service pane service/explorer Unexpecting error encountered
Summary: [RFE] Service pane service/explorer Unexpecting error encountered
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: GA
: 5.9.0
Assignee: drew uhlmann
QA Contact: Shveta
URL:
Whiteboard:
Depends On: 1505033
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-21 14:56 UTC by Satoe Imaishi
Modified: 2018-03-06 15:22 UTC (History)
9 users (show)

Fixed In Version: 5.9.0.10
Doc Type: Enhancement
Doc Text:
Clone Of: 1505033
Environment:
Last Closed: 2018-03-06 15:22:09 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 2 CFME Bot 2017-11-29 20:47:13 UTC
New commit detected on ManageIQ/manageiq-automation_engine/gaprindashvili:
https://github.com/ManageIQ/manageiq-automation_engine/commit/d705a2f0064f00cae27edca2bc88bcd1e5b256fd

commit d705a2f0064f00cae27edca2bc88bcd1e5b256fd
Author:     Greg McCullough <gmccullo>
AuthorDate: Mon Nov 20 15:46:27 2017 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Tue Nov 21 09:54:43 2017 -0500

    Merge pull request #118 from d-m-u/bz1505033
    
    Changes service name update to raise errors
    (cherry picked from commit 89e0003b35c89fe506d63fb1838102cbaf80fc12)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1515894

 lib/miq_automation_engine/service_models/miq_ae_service_service.rb | 3 +--
 spec/service_models/miq_ae_service_service_spec.rb                 | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

Comment 3 Shveta 2018-02-16 21:36:50 UTC
I am still able to update service_name to null.
Version : 5.9.0.21.20180214154720_6f2109d

Appliance : https://10.8.198.52
through psql I ran : 
UPDATE services SET name = null WHERE id = 1;

Comment 4 drew uhlmann 2018-02-19 14:55:12 UTC
Hi Shveta! Changing the service name via a database call like that is not going to run any Rails validations. That's expected behavior. I can't replicate being able to set the name to nil without hitting an error now, and without the the automation logs from the 2017 run where this broke originally I can't tell that anything is still wrong with this. You can see that the validation on the name runs by running the following line in rails console: 

Service.first.update_attributes!(:name => nil)

which should fail with an error about the name being blank.

Comment 5 Shveta 2018-02-19 16:28:05 UTC
rails c
Loading production environment (Rails 5.0.6)
irb(main):001:0> Service.first.update_attributes!(:name => nil)
PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0
ActiveRecord::RecordInvalid: Validation failed: Name can't be blank
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/validations.rb:78:in `raise_validation_error'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/validations.rb:50:in `save!'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:324:in `block in save!'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:230:in `transaction'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:211:in `transaction'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:324:in `save!'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/suppressor.rb:45:in `save!'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/persistence.rb:288:in `block in update!'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `block in transaction'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/transaction.rb:189:in `within_new_transaction'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:211:in `transaction'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
	from /opt/rh/cfme-gemset/gems/activerecord-5.0.6/lib/active_record/persistence.rb:286:in `update!'
	from (irb):1
	from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/console.rb:65:in `start'
	from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/console_helper.rb:9:in `start'
	from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:78:in `console'
	from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /opt/rh/cfme-gemset/gems/railties-5.0.6/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'


Note You need to log in before you can comment on or make changes to this bug.