Troubleshoot Engine Import Error or Invalid Syntax Error - Administrator Guide - 8 - Cortex XSOAR - Cortex - Security Operations

Cortex XSOAR Administrator Guide

Product
Cortex XSOAR
Version
8
Creation date
2024-09-18
Last date published
2024-11-28
Category
Administrator Guide
Solution
Cloud
Retire_Doc
Retiring
Link_to_new_Doc
/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation
Abstract

Troubleshoot engine import error or invalid syntax error.

When running an integration on an engine, the most common errors are:

  • Broken Pipe

  • “ ImportError: No module named...

  • Invalid syntax

  • Script failed to run: exec: “python”: executable file not found in $PATH (2603)

These errors could indicate that the engine is not using Docker.

  1. Use SSH to access the engine server.

  2. Make sure Docker is healthy.

    1. Ensure that Docker is installed and is running.

      sudo systemctl status docker

      If the Docker status is not good, restart your Docker.

      sudo systemctl restart docker

    2. Ensure Docker can run a container.

      sudo docker run hello-world

      If this fails, reinstall your Docker.

  3. Access the d1.conf file on the engine server.

    sudo vi /usr/local/demisto/d1.conf

  4. Add the "python.engine.docker": true configuration to the d1.conf file and remove any other configurations related to python and Docker, such as “python.executable.no.docker”.

  5. Restart the system on the engine server.

    sudo systemctl restart d1

    Note

    If the Allow running multiple engines on the same machine option is selected, run the command:

    sudo systemctl restart d1_<Engine _name>

  6. Retest the integration from the user interface. This may take a few minutes since it may need to pull the relevant Docker image.