Skip to content

Fix Error importing plugin=builder - #3429

Closed
erickbarros311 wants to merge 1 commit into
apache:masterfrom
erickbarros311:fix_error_import_plugin
Closed

erickbarros311 wants to merge 1 commit into
apache:masterfrom
erickbarros311:fix_error_import_plugin

Conversation

@erickbarros311

Copy link
Copy Markdown

When building the MITRE CALDERA Docker image and starting the application, the following error may appear:

ERROR Error importing plugin=builder, No module named 'docker'
ERROR Error loading plugin=builder

The error occurs because the Python Docker SDK (docker package) is missing from the runtime environment. As a result, the builder plugin fails to load.

To Reproduce

  1. Clone the MITRE CALDERA repository.
  2. Build the Docker image using the provided Dockerfile.
  3. Start the CALDERA container.
  4. Check the application logs for the plugin loading errors.

Expected behavior

The Docker image should include the Python dependencies required by the builder plugin, allowing it to be imported without errors.

Screenshots

Not applicable.

Desktop (please complete the following information):

  • HOST OS: Linux (Ubuntu 24.04.5)
  • Container base image: debian:bookworm-slim
  • Deployment method: Docker
  • CALDERA version: 5.3.0

Additional context

The issue was resolved by installing the Python Docker SDK in the runtime stage of the Dockerfile.

Initially, the following instruction was added to the ui-build stage, which uses node:23:

RUN pip3 install docker

However, this stage is responsible only for building the frontend and does not provide the Python environment used by CALDERA.

The solution was to move the installation to the runtime stage, after installing Python and pip, and add the following instruction:

# Install Docker SDK for Python (required by builder plugin)
RUN pip3 install --break-system-packages --no-cache-dir docker

This ensures that the docker Python module is available in the runtime environment, resolving the No module named 'docker' error and allowing the builder plugin to load.

Note: This change resolves the missing Python dependency. If the plugin needs to interact with the Docker Engine to build payloads, additional Docker Engine access configuration may be required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant