Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Problem

Some users Users may observe the following error message when initially running jobs:

...

This problem can occur if, for example, workflows have been used from JS7 - Download.

As a result, some jobs of in the example workflows fail with the above error message.

Analysis

The error message indicates that an environment variable with the name COMPUTERNAME is used in a job. However this environment variable does not exist.

  • The reason is lies with the JS7 - Job Resources from the archive Defaults.zip that archive which is offered available from JS7 - Download. After import being imported this archive is extracted to a JOC Cockpit folder with the name Defaults and a job resource with the name Default. Find details from Details can be found in the JS7 - Job Environment Variables article.
  • The Default job resource includes an argument with the name js7AgentHostname and an environment variable with the name JS7_AGENT_HOSTNAME. By default the argument is assigned this the following value:

    Code Block
    js7AgentHostname = env('HOSTNAME', env('COMPUTERNAME'))
  • The This expression first makes use of a HOSTNAME environment variable (available for most Unix systems) and if this does not exist uses the COMPUTERNAME environment variable (available for Windows systems). Therefore running a job that makes use of the Default job resource on a Unix OS that does not provide the HOSTNAME environment variable causes the error.
  • The HOSTNAME environment variable which is assumed from the Job Resource in fact is a bash variable and may not be available if another shell such as ksh or tsh is used or if the Agent's account has not been assigned the bash shell in /etc/passwd.

The assignment of the js7AgentHostname argument is performed in the Configuration view for Job Resources like this:


Solution

Modify the value of the js7AgentHostname argument like thisas follows:

Code Block
js7AgentHostname = env('HOSTNAME', env('COMPUTERNAME'), ""))

Explanation:

  • The env() function makes use of two arguments: the first argument specifies an environment variable, the second argument specifies a default value should if the environment variable does not exist.
  • Adding an empty default value - specified by two double quotes - as provided from in the example above example resolves the problem.
  • To apply changes deploy the job resource after modification.
  • As an alternative to this solution users can assign the /bin/bash shell to the user account used by the Agent.