Issues with building and using HCO command
search cancel

Issues with building and using HCO command

book

Article ID: 413076

calendar_today

Updated On:

Products

CA Harvest Software Change Manager CA Harvest Software Change Manager - OpenMake Meister

Issue/Introduction

When we have an hco command like this:

hco -b "<broker>" -en "<project>" -st "<state>"  -vp "<viewpath>" -sy -r -op pc -s "*" -o "<logfilename>" -usr "<userid>" -pw "<password>"


We see an error like this:

I00060040: New connection with Broker hapdevel established.
Error: Unable to create session

Environment

Harvest Software Change Manager v12.x and higher
Unix/Linux/AIX environments

Cause

We found that the password included on the command line contained a special character, for example "$Example123".  

Any time you include a parameter containing a special character in a Unix/Linux/AIX command it can cause unexpected side effects.  This is because there are some special characters that the operating system reserves for its own use and that have a special meaning.

Resolution

There are a couple of ways to work around this problem:

  1. Use the svrenc command to create an encrypted password file.  When you do this, don't include the "-pw <password>" parameter on the command line.  Instead, execute this command and let it prompt you for the userid and password:

    svrenc -f <encrypted password file name>

    Then, when you build your hco command (or any other command), use the "-eh <encrypted password file name>" parameter instead of "-usr <userid> -pw <password>".  For example:

    hco -b "<broker>" -en "<project>" -st "<state>"  -vp "<viewpath>" -sy -r -op pc -s "*" -o "<logfilename>" -eh <encrypted password file name>


  2. Use the "-prompt" parameter instead of "-usr <userid> -pw <password>".  This instructs Harvest to prompt separately for userid and password rather than including those on the command line.  For example:

    hco -b "<broker>" -en "<project>" -st "<state>"  -vp "<viewpath>" -sy -r -op pc -s "*" -o "<logfilename>" -prompt

Additional Information

Information on the hco command can be found here: hco Command-Check-out

Information on the svrenc command can be found here: svrenc Command-Encrypt User and Password Credentials to a File

Information on the "-prompt" parameter can be found here: Get Started with CA Harvest SCM Commands - Common Options