Bug 1217002 - "Error during 'Policy Import': undefined method `collect' for "test 'as da ad":String" in control Import/Export
Summary: "Error during 'Policy Import': undefined method `collect' for "test 'as da ad...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.4.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: GA
: 5.5.0
Assignee: eclarizi
QA Contact: Aziza Karol
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-29 11:40 UTC by Aziza Karol
Modified: 2015-12-08 13:06 UTC (History)
7 users (show)

Fixed In Version: 5.5.0.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-08 13:06:32 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
snapshot (39.63 KB, image/png)
2015-04-29 11:40 UTC, Aziza Karol
no flags Details
test file (15 bytes, text/plain)
2015-05-18 06:51 UTC, Aziza Karol
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2551 0 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 17:58:09 UTC

Description Aziza Karol 2015-04-29 11:40:29 UTC
Created attachment 1020084 [details]
snapshot

Description of problem:


Version-Release number of selected component (if applicable):
5.4.0.0.23.20150423131011_69b48fd 

How reproducible:
100%

Steps to Reproduce:
1.Navigate to Control->Import/Export
2.upload an invalid file
3.

Actual results:
"Error during 'Policy Import': undefined method `collect' for "test 'as da ad":String" displayed in UI. see attached screenshot.

Expected results:
Better flash message for invalid files.


Additional info:
evm.log
[----] I, [2015-04-29T07:37:07.165582 #2391:e27ea8]  INFO -- : MIQ(MiqServer.populate_queue_messages) Fetched 4 miq_queue rows for queue_name=generic, wcount=4, priority=200
[----] E, [2015-04-29T07:37:07.839105 #2642:123bea4] ERROR -- : MIQ(miq_policy_controller-export): Error during 'Policy Import': undefined method `collect' for "test 'as da ad":String

Comment 3 Aziza Karol 2015-05-15 09:57:08 UTC
production.log 


[----] I, [2015-05-15T05:45:08.782255 #2350:11e5ea0]  INFO -- : Started POST "/miq_policy/upload?dbtype=pp&type=import" for 127.0.0.1 at 2015-05-15 05:45:08 -0400
[----] I, [2015-05-15T05:45:08.792402 #2350:11e5ea0]  INFO -- : Processing by MiqPolicyController#upload as HTML
[----] I, [2015-05-15T05:45:08.792616 #2350:11e5ea0]  INFO -- :   Parameters: {"utf8"=>"&#x2713;", "authenticity_token"=>"/Xbh9nz268Gtkt1Q5C49msOIGlrNlbi9MUmu3lN7iz0=", "upload"=>{"file"=>#<ActionDispatch::Http::UploadedFile:0x000000119a7340 @original_filename="code", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"upload[file]\"; filename=\"code\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<Tempfile:/tmp/RackMultipart20150515-2350-1y8mfaz>>}, "commit"=>"Upload", "dbtype"=>"pp", "type"=>"import"}
[----] I, [2015-05-15T05:45:08.842534 #2350:11e5ea0]  INFO -- : Redirected to https://10.16.6.208/miq_policy/export?dbtype=pp&flash_error=true&flash_msg=Error+during+%27Policy+Import%27%3A+undefined+method+%60collect%27+for+%22%22%3AString
[----] I, [2015-05-15T05:45:08.862349 #2350:11e5ea0]  INFO -- : Completed 302 Found in 69.6ms (ActiveRecord: 1.2ms)
[----] I, [2015-05-15T05:45:09.223942 #2350:11e5ea0]  INFO -- : Started GET "/miq_policy/export?dbtype=pp&flash_error=true&flash_msg=Error+during+%27Policy+Import%27%3A+undefined+method+%60collect%27+for+%22%22%3AString" for 127.0.0.1 at 2015-05-15 05:45:09 -0400
[----] I, [2015-05-15T05:45:09.243060 #2350:11e5ea0]  INFO -- : Processing by MiqPolicyController#export as HTML
[----] I, [2015-05-15T05:45:09.243214 #2350:11e5ea0]  INFO -- :   Parameters: {"dbtype"=>"pp", "flash_error"=>"true", "flash_msg"=>"Error during 'Policy Import': undefined method `collect' for \"\":String"}
[----] I, [2015-05-15T05:45:09.271442 #2350:11e5ea0]  INFO -- :   Rendered layouts/_flash_msg.html.haml (0.4ms)

Comment 4 Greg McCullough 2015-05-15 17:36:21 UTC
Aziza - Can you provide the file you were testing with?  The import should displays a flash error message "Error during 'Policy Import: Invalid YAML file".  I validated that the error message is still showing for files I tested so it sounds like it is data related.

Comment 5 Aziza Karol 2015-05-18 06:50:30 UTC
Greg,
I have attached the file "test" used for testing.

~Aziza

Comment 6 Aziza Karol 2015-05-18 06:51:22 UTC
Created attachment 1026576 [details]
test file

Comment 7 CFME Bot 2015-06-25 21:52:31 UTC
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ffc8bba4304a68ed3f7ce77d47f19f88cca33845

commit ffc8bba4304a68ed3f7ce77d47f19f88cca33845
Author:     Erik Clarizio <eclarizi>
AuthorDate: Tue Jun 23 08:03:33 2015 -0700
Commit:     Erik Clarizio <eclarizi>
CommitDate: Wed Jun 24 13:14:15 2015 -0700

    Added a clearer message to an error when MiqPolicy import fails
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1217002

 vmdb/app/services/miq_policy_import_service.rb     |  4 ++
 .../services/miq_policy_import_service_spec.rb     | 52 ++++++++++++++--------
 2 files changed, 37 insertions(+), 19 deletions(-)

Comment 8 Aziza Karol 2015-09-21 04:58:51 UTC
Verified in 5.5.0.1-alpha1.20150915151429_2230bd4.

Comment 10 errata-xmlrpc 2015-12-08 13:06:32 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://access.redhat.com/errata/RHSA-2015:2551


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