Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1353979 - [ActiveRecord::RecordInvalid]: Validation failed: Name can't be blank
Summary: [ActiveRecord::RecordInvalid]: Validation failed: Name can't be blank
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.6.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: GA
: 5.7.0
Assignee: Marcel Hild
QA Contact: Matouš Mojžíš
URL:
Whiteboard: validation
: 1425057 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-08 15:17 UTC by Colin Arnott
Modified: 2017-08-25 16:01 UTC (History)
11 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-25 16:01:02 UTC
Category: ---
Cloudforms Team: ---


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0012 normal SHIPPED_LIVE CFME 5.7.0 bug fixes and enhancement update 2017-01-04 17:50:36 UTC

Description Colin Arnott 2016-07-08 15:17:23 UTC
Description of problem:
AWS EC2 supports VMs with no names, only keying off the "instance ID" field. CloudForms requires that all VMs have a name, and fails validation during EMS refresh if a blank VM name is encountered.

Version-Release number of selected component (if applicable):
cfme-5.6.0.13-1.el7cf.x86_64

How reproducible:
trivial

Steps to Reproduce:
1. create a new VM on AWS with no name
2. add AWS to CloudForms
3. trigger EMS refresh

Actual results:
EMS refresh never completes, attached loglines can be found.

Expected results:
EMS refresh finishes.

Additional info:
(logs pending)

Comment 3 Marcel Hild 2016-08-17 10:53:57 UTC
@Colin would you expect the name to be the instance-id? 
Or should we make the name optional for aws instances? 
I'm not sure about the implications of the latter solution

Comment 4 Colin Arnott 2016-08-22 11:31:56 UTC
I do not really have a strong preference for the solution, as I see the collection of the VM information to the paramount.

I also agree that allowing the name field to be optional is problematic, due to the current UI design, but as you key off an internal id (i.e. 20000000000017), it should be technically possible.

Using the instance-id could be a good stop-gap measure, but as the name field is blank in AWS, a 'null', 'nil' or 'empty' value may be more representative of the ground truth. My vote would be to use nil, but this may confuse non-technical users.

Comment 5 Marcel Hild 2016-08-30 18:39:00 UTC
PR https://github.com/ManageIQ/manageiq-providers-amazon/pull/35  is merged

Comment 7 Matouš Mojžíš 2016-11-10 15:26:00 UTC
Verified in 5.7.0.10. No errors and refresh passes.

Comment 9 errata-xmlrpc 2017-01-04 12:57:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0012.html

Comment 10 Adam Grare 2017-02-23 20:03:18 UTC
*** Bug 1425057 has been marked as a duplicate of this bug. ***

Comment 11 myoder 2017-07-14 19:58:25 UTC
Reopening bug, looks like we have a regression as customer is hitting this on 5.7.2.1

[----] E, [2017-07-14T05:35:06.715936 #2770:8a712c] ERROR -- : MIQ(EmsRefresh.save_vms_inventory) EMS: [AWS TEST], id: [1000000000006] Processing Vm: [] failed with error [Validation failed: Name can't be blank]. Skipping Vm.
[----] E, [2017-07-14T05:35:06.716400 #2770:8a712c] ERROR -- : [ActiveRecord::RecordInvalid]: Validation failed: Name can't be blank  Method:[rescue in block (2 levels) in save_vms_inventory]
[----] E, [2017-07-14T05:35:06.716795 #2770:8a712c] ERROR -- : /opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/validations.rb:78:in `raise_validation_error'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/validations.rb:50:in `save!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/transactions.rb:324:in `block in save!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:230:in `transaction'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/transactions.rb:211:in `transaction'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/transactions.rb:324:in `save!'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/suppressor.rb:45:in `save!'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:187:in `save_hardware_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:109:in `block in save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:109:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:109:in `save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:114:in `block (2 levels) in save_vms_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:58:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:58:in `block in save_vms_inventory'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `block in transaction'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:189:in `within_new_transaction'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
/opt/rh/cfme-gemset/gems/activerecord-5.0.2/lib/active_record/transactions.rb:211:in `transaction'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:57:in `save_vms_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:109:in `block in save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:109:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_helper.rb:109:in `save_child_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory_cloud.rb:69:in `save_ems_cloud_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/save_inventory.rb:4:in `save_ems_inventory'
/opt/rh/cfme-gemset/bundler/gems/manageiq-providers-amazon-1b78b94636be/app/models/manageiq/providers/amazon/cloud_manager/refresher.rb:11:in `save_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:91:in `block in refresh_targets_for_ems'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:91:in `refresh_targets_for_ems'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:24:in `block (2 levels) in refresh'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:24:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:14:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:14:in `refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:10:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:91:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:90:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:90:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:347:in `block in deliver'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `block in catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch'
/opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:106:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:343:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:107:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:135:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:153:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:336:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:333:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:333:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:155:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:130:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:21:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:343:in `block in start'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:341:in `start'
/var/www/miq/vmdb/app/models/miq_worker.rb:270:in `start_worker'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:68:in `start_worker_for_ems'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:46:in `block in sync_workers'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:45:in `each'
/var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:45:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:53:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `each'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:22:in `monitor_workers'
/var/www/miq/vmdb/app/models/miq_server.rb:346:in `block in monitor'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/miq_server.rb:346:in `monitor'
/var/www/miq/vmdb/app/models/miq_server.rb:368:in `block (2 levels) in monitor_loop'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store'
/var/www/miq/vmdb/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block'
/var/www/miq/vmdb/app/models/miq_server.rb:368:in `block in monitor_loop'
/var/www/miq/vmdb/app/models/miq_server.rb:367:in `loop'
/var/www/miq/vmdb/app/models/miq_server.rb:367:in `monitor_loop'
/var/www/miq/vmdb/app/models/miq_server.rb:250:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:65:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:92:in `start'
/var/www/miq/vmdb/lib/workers/bin/evm_server.rb:4:in `<main>'

Comment 17 Jeff Teehan 2017-07-14 22:50:58 UTC
I was able to generate this error by creating a Tag in AWS that has key but no value.  Looks to be the same thing.

[----] E, [2017-07-14T18:33:01.620906 #4941:3f9134] ERROR -- : MIQ(EmsRefresh.save_vms_inventory) EMS: [awsdave], id: [2] Processing Vm: [] failed with error [Validation failed: Name can't be blank]. Skipping Vm.
[----] E, [2017-07-14T18:33:01.621331 #4941:3f9134] ERROR -- : [ActiveRecord::RecordInvalid]: Validation failed: Name can't be blank  Method:[rescue in block (2 levels) in save_vms_inventory]
[----] E, [2017-07-14T18:33:01.621708 #4941:3f9134] ERROR -- : /opt/rh/cfme-gemset/gems/activerecord-5.0.3/lib/active_record/validations.rb:78:in `raise_validation_error'

Will test patch when it's ready to merge.

Comment 18 Jeff Teehan 2017-07-14 22:51:25 UTC
The tag is on the image, not the instance

Comment 20 Jeff Teehan 2017-07-14 23:07:53 UTC
Applied above PR manually using 5.7.3 appliance and could not reproduce the error.

Comment 21 Satoe Imaishi 2017-08-25 16:01:02 UTC
Putting back to CLOSED - the new issue which PR 273 was created for is tracked under bug 1471297.


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