Apply Changes fails with error "Details: undefined method `length' for an instance of ActionController::Parameters "
search cancel

Apply Changes fails with error "Details: undefined method `length' for an instance of ActionController::Parameters "

book

Article ID: 382438

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

The symptom observed on this issue are errors referencing a property not defined similar to the example below:

E, [20xx-xx-xxTxx:xx:xx.xxxxxx #xxxx] ERROR -- : [xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx]         Exception caught via rescue_from (code 500):
        (See app/controllers/application_controller.rb)
        undefined method `length' for an instance of ActionController::Parameters
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:53:in `each'
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:53:in `sort_by'
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:53:in `sort_and_dedupe'
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:17:in `initialize'
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:11:in `new'
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:11:in `from_properties'
    /home/tempest-web/tempest/web/lib/password_scrubber.rb:7:in `from_products'
    /home/tempest-web/tempest/web/app/models/deployer/installation_plan.rb:157:in `create_password_scrubber'
    /home/tempest-web/tempest/web/app/models/deployer/installation_plan.rb:78:in `start_install'
        .
        .

Cause

This issue can be caused by a property value from a staged product (tile) submitted via the API with an incorrect format. The bad value causes the property to error out as it can't be consumed.

Resolution

To resolve this issue, use the API to query the properties of the existing staged products. This will allow to identify the product that persisted an incorrect value.

 

 

The product with the incorrect values will error out or return ActionController::Parameters somewhere in the response. Once the property with the incorrect value is identified the customer can modify it to the correct format.

Below is an example of how an invalid format can look:

## property value with incorrect format:
 .cloud_controller.encrypt_key:
   value:
     secret:
       secret: MYPASSWORD
 
 
 ## correct format for the property
 .cloud_controller.encrypt_key:
   value:
     secret: MYPASSWORD