Bug 1245724 - automate drb load limit error "too large packet"
automate drb load limit error "too large packet"
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
5.4.0
All All
high Severity high
: GA
: 5.5.0
Assigned To: mkanoor
Martin Kourim
: ZStream
Depends On:
Blocks: 1247629
  Show dependency treegraph
 
Reported: 2015-07-22 11:16 EDT by Josh Carter
Modified: 2016-09-20 00:25 EDT (History)
9 users (show)

See Also:
Fixed In Version: 5.5.0.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1247629 (view as bug list)
Environment:
Last Closed: 2015-12-08 08:23:19 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
jkrocil: automate_bug-


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2551 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 12:58:09 EST

  None (edit)
Comment 6 mkanoor 2015-07-23 16:20:13 EDT
When an automate method calls the inspect function on MiqAeServiceObject marshaled via Drb, the results are different between version's 5.3 and 5.4.

In version 5.3 we were using Ruby 1.9.3 and in version 5.4 we are using Ruby 2.0.
The inspect method is not being defined in MiqAeServiceObject so in ruby 2.0 it calls the Object.inspect instead of the to_s method which is defined in MiqAeServiceObject.

The solution would be to implement the inspect method in MiqAeServiceObject. The inspect method like the to_s method should return the name of the object.


The error that we see [too large packet 27396444] is happening when we try and log one of the objects returned via $evm.instantiate. We call the inspect method on the object before logging it, the inspect method yields a string of size 27,396,444 which is over the 25 MB limit that is defined in DRb when exchanging objects.

lib/drb/drb.rb

@@load_limit = 256 * 102400
Comment 7 CFME Bot 2015-07-27 11:10:05 EDT
New commit detected on manageiq/master:
https://github.com/ManageIQ/manageiq/commit/684600fdafb686b58719ae6e2da6041a6173b281

commit 684600fdafb686b58719ae6e2da6041a6173b281
Author:     Madhu Kanoor <mkanoor@redhat.com>
AuthorDate: Fri Jul 24 11:23:58 2015 -0400
Commit:     Madhu Kanoor <mkanoor@redhat.com>
CommitDate: Fri Jul 24 17:09:41 2015 -0400

    Define inspect method for MiqAeServiceObject
    
    Notes from ruby 2.0 incompatibilities
    Object#inspect does always return a string like #<ClassName:0x…> instead
    of delegating to #to_s. [#2152]
    
    Since we didn't have the inspect method defined it would call the
    Object#inspect causing the entire workspace and rest of automate objects
    to be added as strings generating data over 27MB when an inspect is
    called in any of the Drb returned objects. The automate methods would
    then try to log this string and get the error [too large packet xxxxxxxx]
    
    inspect now outputs the class, object_id and name
    https://bugzilla.redhat.com/show_bug.cgi?id=1245724

 lib/miq_automation_engine/engine/miq_ae_service.rb    |  5 +++++
 spec/lib/miq_automation_engine/miq_ae_service_spec.rb | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
Comment 8 CFME Bot 2015-07-28 10:19:44 EDT
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=b23dd0c3543668739b8f87113c9a035d37ed6eb2

commit b23dd0c3543668739b8f87113c9a035d37ed6eb2
Author:     Madhu Kanoor <mkanoor@redhat.com>
AuthorDate: Fri Jul 24 11:23:58 2015 -0400
Commit:     Madhu Kanoor <mkanoor@redhat.com>
CommitDate: Mon Jul 27 14:26:29 2015 -0400

    Define inspect method for MiqAeServiceObject
    
    Notes from ruby 2.0 incompatibilities
    Object#inspect does always return a string like #<ClassName:0x…> instead
    of delegating to #to_s. [#2152]
    
    Since we didn't have the inspect method defined it would call the
    Object#inspect causing the entire workspace and rest of automate objects
    to be added as strings generating data over 27MB when an inspect is
    called in any of the Drb returned objects. The automate methods would
    then try to log this string and get the error [too large packet xxxxxxxx]
    
    inspect now outputs the class, object_id and name
    https://bugzilla.redhat.com/show_bug.cgi?id=1245724

 vmdb/lib/miq_automation_engine/engine/miq_ae_service.rb    |  5 +++++
 vmdb/spec/lib/miq_automation_engine/miq_ae_service_spec.rb | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
Comment 9 CFME Bot 2015-07-28 10:19:57 EDT
New commit detected on cfme/5.4.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7a409d25a2fda1cb05230efb6fdd2ab7a3db24f4

commit 7a409d25a2fda1cb05230efb6fdd2ab7a3db24f4
Merge: 70ed07a b23dd0c
Author:     Greg McCullough <gmccullo@redhat.com>
AuthorDate: Tue Jul 28 09:12:25 2015 -0400
Commit:     Greg McCullough <gmccullo@redhat.com>
CommitDate: Tue Jul 28 09:12:25 2015 -0400

    Merge branch 'test_54_bz_1245724' into '5.4.z'
    
    Define inspect method for MiqAeServiceObject
    
    Notes from ruby 2.0 incompatibilities
    Object#inspect does always return a string like #<ClassName:0x…> instead
    of delegating to #to_s. [#2152]
    
    Since we didn't have the inspect method defined it would call the
    Object#inspect causing the entire workspace and rest of automate objects
    to be added as strings generating data over 27MB when an inspect is
    called in any of the Drb returned objects. The automate methods would
    then try to log this string and get the error [too large packet xxxxxxxx]
    
    inspect now outputs the class, object_id and name
    https://bugzilla.redhat.com/show_bug.cgi?id=1245724
    
    See merge request !193

 vmdb/lib/miq_automation_engine/engine/miq_ae_service.rb    |  5 +++++
 vmdb/spec/lib/miq_automation_engine/miq_ae_service_spec.rb | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
Comment 10 mkanoor 2015-07-28 10:59:48 EDT
In order to test this issue 

From an automate method call evm.instantiate and then call log on the inspect

obj=$evm.instantiate('/Test/System/Demo/Fred')
$evm.log("info","Object Inspect data is #{obj.inspect}")


Before this fix is applied the log will have huge amounts of data depending on your Automate model, after you apply this fix it should print the class_name, id and object name.

If you try this in previous version it will just print the name of the instance.
Comment 11 mkanoor 2015-07-28 11:00:03 EDT
In order to test this issue 

From an automate method call evm.instantiate and then call log on the inspect

obj=$evm.instantiate('/Test/System/Demo/Fred')
$evm.log("info","Object Inspect data is #{obj.inspect}")


Before this fix is applied the log will have huge amounts of data depending on your Automate model, after you apply this fix it should print the class_name, id and object name.

If you try this in previous version it will just print the name of the instance.
Comment 12 Taras Lehinevych 2015-11-27 09:33:39 EST
Verified fixed in version 5.5.0.12
Comment 14 errata-xmlrpc 2015-12-08 08:23:19 EST
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.