Python scripts fail to execute in Windows Agent v24 - Automic Workload Automation
search cancel

Python scripts fail to execute in Windows Agent v24 - Automic Workload Automation

book

Article ID: 447560

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

Python jobs using the :BEGIN_EXT_INTERPRETER PYTHON function fail to execute correctly on Windows Agent v24, even though the job may end with Return Code 0. The job report does not show the expected script output.  The following is seen:

  • Windows jobs using Python external interpreters appear to start but do not perform the scripted actions.
  • The job report is missing standard output (STDOUT) or error messages (STDERR) from the Python script.
  • The job completes with Return Code 0 despite the full python script not running.

Environment

  • Automic Workload Automation
  • Windows Agent v24.x
  • Python Interpreter

Cause

An encoding mismatch occurs when the Windows Agent is configured with the legacy UC_HOST_CODE=UC_CODE. In v24 and higher, the agent expects UTF-8. Using legacy encoding causes script characters to be jumbled when the temporary script file is generated, preventing the Python interpreter from executing the code correctly.

Resolution

To resolve this issue, update the agent configuration to use UTF-8 encoding:

  1. Open the Windows Agent configuration file (ucxjwx6.ini).
  2. Locate the UC_HOST_CODE parameter in the [VARIABLE] section.
  3. Change the value to <UTF-8>:
     
     
    UC_HOST_CODE=<UTF-8>
  4. Save the file.
  5. Restart the Windows Agent service.