Release Automation

 View Only
Expand all | Collapse all

How to get environment parameter value

  • 1.  How to get environment parameter value

    Posted Jan 04, 2016 08:34 AM

    Hi,

     

    I am trying to test an action "Get Environment Parameter" on RA 5.5.2 but can't get it.

    I am using the action like this :

     

    But when I execute it (the environment parameter is set to true) I got the following error message :

    parameter set to true

    2016-01-04 14:17:14,729 [job-98424-jobServer-98428-6:ROC - Get forcer_deploiment_total(P235809.F235813.E235814):ROC - Get Environment Parameter] DEBUG (com.nolio.platform.shared.executables.actions.releasecenter.utils.RequestsUtil:73) - Sending http request: AgentHttpRequest{uri='/a/api/v3/get-environment-parameter', httpVerb=POST, body='{"application":"APP01","environment":"ENV01","parameterPath":"component/deployment/force_deployment"}', jobId=98424, knownHost=RELEASE_CENTER, rocAuthentication=JOB_RUNNER}

    2016-01-04 14:17:14,923 [job-98424-jobServer-98428-6:ROC - Get forcer_deploiment_total(P235809.F235813.E235814):ROC - Get Environment Parameter] INFO  (com.nolio.platform.shared.executables.actions.releasecenter.utils.RequestsUtil:76) - Response received: AgentHttpResponse{statusCode=200, statusMessage='OK', body='{"parameterPath":"component/deployment/force_deployment","simpleValue":"true","result":true}', jobId=98424}

    2016-01-04 14:17:14,923 [job-98424-jobServer-98428-6:ROC - Get forcer_deploiment_total(P235809.F235813.E235814):ROC - Get Environment Parameter] ERROR (com.nolio.platform.shared.datamodel.Action:117) - Failed to get the value for the parameter [component/deployment/force_deployment].

    java.lang.NullPointerException

            at com.nolio.platform.shared.executables.actions.releasecenter.actions.parameters.GetEnvironmentParameterRCAction.setOutputsPerServerType(GetEnvironmentParameterRCAction.java:123)

            at com.nolio.platform.shared.executables.actions.releasecenter.actions.parameters.GetEnvironmentParameterRCAction.execute(GetEnvironmentParameterRCAction.java:106)

            at com.nolio.platform.shared.datamodel.ActionExecutionState.localExecution(ActionExecutionState.java:333)

            at com.nolio.platform.shared.datamodel.ActionExecutionState.access$500(ActionExecutionState.java:39)

            at com.nolio.platform.shared.datamodel.ActionExecutionState$2.execAction(ActionExecutionState.java:112)

            at com.nolio.platform.shared.datamodel.ActionExecutionState.exec(ActionExecutionState.java:343)

            at com.nolio.platform.shared.datamodel.Action.run(Action.java:227)

            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

            at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

            at java.util.concurrent.FutureTask.run(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

            at com.nolio.platform.shared.flowcontrol.LocalFlowController$JobBoundThreadFactory$1.run(LocalFlowController.java:788)

            at java.lang.Thread.run(Unknown Source)

    2016-01-04 14:17:14,924 [job-98424-jobServer-98428-6:ROC - Get forcer_deploiment_total(P235809.F235813.E235814):ROC - Get Environment Parameter] INFO  (com.nolio.platform.shared.datamodel.Action:334) - ------------------------Finished action [ROC - Get forcer_deploiment_total(P235809.F235813.E235814):ROC - Get Environment Parameter] result [false, Failed to get the value for the parameter [component/deployment/force_deployment].<br/><br/>Internal Error:<br/>]------------------------

     

    An if the environment parameter is set to false :

    parameter set to false

    2016-01-04 14:28:46,254 [job-98425-jobServer-98429-6:ROC - Get forcer_deploiement_total(P235846.F235850.E235851):ROC - Get Environment Parameter] DEBUG (com.nolio.platform.shared.executables.actions.releasecenter.utils.RequestsUtil:73) - Sending http request: AgentHttpRequest{uri='/a/api/v3/get-environment-parameter', httpVerb=POST, body='{"application":"APP01","environment":"ENV01","parameterPath":"component/deployment/force_deployment"}', jobId=98425, knownHost=RELEASE_CENTER, rocAuthentication=JOB_RUNNER}

    2016-01-04 14:28:46,465 [job-98425-jobServer-98429-6:ROC - Get forcer_deploiement_total(P235846.F235850.E235851):ROC - Get Environment Parameter] INFO  (com.nolio.platform.shared.executables.actions.releasecenter.utils.RequestsUtil:76) - Response received: AgentHttpResponse{statusCode=200, statusMessage='OK', body='{"parameterPath":"component/deployment/force_deployment","simpleValue":"false","result":true}', jobId=98425}

    2016-01-04 14:28:46,466 [job-98425-jobServer-98429-6:ROC - Get forcer_deploiement_total(P235846.F235850.E235851):ROC - Get Environment Parameter] ERROR (com.nolio.platform.shared.datamodel.Action:117) - Failed to get the value for the parameter [component/deployment/force_deployment].

    java.lang.NullPointerException

            at com.nolio.platform.shared.executables.actions.releasecenter.actions.parameters.GetEnvironmentParameterRCAction.setOutputsPerServerType(GetEnvironmentParameterRCAction.java:123)

            at com.nolio.platform.shared.executables.actions.releasecenter.actions.parameters.GetEnvironmentParameterRCAction.execute(GetEnvironmentParameterRCAction.java:106)

            at com.nolio.platform.shared.datamodel.ActionExecutionState.localExecution(ActionExecutionState.java:333)

            at com.nolio.platform.shared.datamodel.ActionExecutionState.access$500(ActionExecutionState.java:39)

            at com.nolio.platform.shared.datamodel.ActionExecutionState$2.execAction(ActionExecutionState.java:112)

            at com.nolio.platform.shared.datamodel.ActionExecutionState.exec(ActionExecutionState.java:343)

            at com.nolio.platform.shared.datamodel.Action.run(Action.java:227)

            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

            at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

            at java.util.concurrent.FutureTask.run(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

            at com.nolio.platform.shared.flowcontrol.LocalFlowController$JobBoundThreadFactory$1.run(LocalFlowController.java:788)

            at java.lang.Thread.run(Unknown Source)

    2016-01-04 14:28:46,466 [job-98425-jobServer-98429-6:ROC - Get forcer_deploiement_total(P235846.F235850.E235851):ROC - Get Environment Parameter] INFO  (com.nolio.platform.shared.datamodel.Action:334) - ------------------------Finished action [ROC - Get forcer_deploiement_total(P235846.F235850.E235851):ROC - Get Environment Parameter] result [false, Failed to get the value for the parameter [component/deployment/force_deployment].<br/><br/>Internal Error:<br/>]------------------------

     

    So, it seeems like it does work since I can see in the HTT response, the difference when the parameter is set to true or false.

     

    How come the job can be in failure when it succeeded in retrieving the value ?

     

    I than you in advance for your answer.

     

    Regards.



  • 2.  Re: How to get environment parameter value

    Posted Jan 04, 2016 12:25 PM

    Is this an environment parameter for the current deployment and current environment?  It looks like it's a component parameter......if that's true, then you need to fill in the server-type field......

     

    But if it's the current deployment/environment, just use the parameter itself, it's already set for you!



  • 3.  Re: How to get environment parameter value

    Posted Jan 05, 2016 04:35 AM

    Hi,

     

    I meet the same error with Server Type set.

     

    Regards.



  • 4.  Re: How to get environment parameter value

    Broadcom Employee
    Posted Jan 05, 2016 08:30 AM
      |   view attached

    What build of CA Release Automation 5.5.2 are you running?



  • 5.  Re: How to get environment parameter value

    Posted Jan 05, 2016 08:50 AM

    Running Version: 5.5.2.239



  • 6.  Re: How to get environment parameter value

    Broadcom Employee
    Posted Jan 05, 2016 10:49 AM
      |   view attached

    Hello there.  I have tried running your example (installed build 239 as well) and I don’t get this problem.  It might be worth opening a support case to pursue this.  I have one quick question for you. ☺

    You specified the path as,

    component/deployment/force_deployment.

     

    Is “component” the actual name of your component?  Is this a shared component?

     

     

    regards



  • 7.  Re: How to get environment parameter value

    Posted Jan 05, 2016 11:00 AM

    I furnished 'component' as an example, the actual name of my component is 'jahia' and yes it is a shared component.

     

    I get around the problem calling the WS /datamanagement/a/api/v3/get-environment-parameter.

     

    I will open a case when I have time :-)

     

    Thank you.



  • 8.  Re: How to get environment parameter value

    Broadcom Employee
    Posted Feb 01, 2016 01:48 PM

    Just wanted to follow up on this -- Were you able to open a support ticket?  We'll be glad to help out with this further if you're still stuck with it.



  • 9.  Re: How to get environment parameter value

    Posted Feb 02, 2016 03:13 AM

    Hi,

     

    I used a REST action to get the parameter value since I can't find how to do it with the dedicated one.

    I did not try again nor opened a case for that.

     

    Regards.



  • 10.  Re: How to get environment parameter value

    Posted Feb 02, 2016 05:32 AM

    Hi Nicolas,

     

    From the logs, I can read that the action failing is named "ROC - Get forcer_deploiment_total" although your screenshot shows the same action called "ROC - Get force_deployment value".

    Is it matter of publishing your process? in which context do you want to execute your action? (pre-plan, pre-deploy in Init stage).

     

    Thanks,

    Cyrille



  • 11.  Re: How to get environment parameter value

    Posted Feb 02, 2016 07:40 AM

    I just change the name, to write it in english. but it is the same...

    I am trying to run it as test in design, and through process execution in pre-deployment step.

     

    Regards.



  • 12.  Re: How to get environment parameter value

    Posted Feb 02, 2016 08:10 AM

    I think your problem is this:

    I am trying to run it as test in design, and through process execution in pre-deployment step.

     

    when I'm not mistaken you can use environment paramters only during deployment steps, when the processes actually runs in this environment (not the pre-deployment or just tests of the action itself)



  • 13.  Re: How to get environment parameter value

    Posted Feb 02, 2016 10:28 AM

    Effectively, that could be my problem but I see nowhere in the Action "ROC - Get Environment Parameter" description, nor on CA Wiki that it should be run in a Deployment step.

     

    Someone could confirm ?

     

    Thanks for your help.

     

    Regards.



  • 14.  Re: How to get environment parameter value
    Best Answer

    Posted Feb 02, 2016 04:34 PM

    I believe I have replicated your problem.

     

    I have tested this action and was able to successfully complete a test within Designer. And after a few different changes to the values in the action, I was able to generate the same error that you were getting.

     

    In the first screenshot you provided, the "Server Type" value is blank. I believe this is what is causing the problem. It will need to be set to have "No Value". You can do this by pressing Ctrl+Space inside of the text field of the value and selecting "No Value" from the menu that opens shown below.

     

     

    After selecting "No Value" it should looks like the screenshot below rather than a blank field.

     

     

     

     

     

     

     

     

    Please let us know if this works for you.



  • 15.  Re: How to get environment parameter value

    Posted Feb 03, 2016 06:05 AM

    Thanks a lot !

    It works now...