Troubleshoot Edge Delta on Docker

Troubleshooting the Edge Delta Fleet on Docker.

Overview

To troubleshoot the Edge Delta Fleet on Docker, ensure the Fleet container is running and consult the logs for any errors that might indicate issues. Adjust resource limits as necessary by updating the container’s start command to prevent frequent restarts.

1. View the Fleet Configuration

Check if the Edge Delta Fleet’s configuration is set correctly in the container.

docker ps

Replace <edgedelta-container-id> with the actual container ID of the Edge Delta Fleet:

docker exec -it <edgedelta-container-id> cat /edgedelta/config.yml

2. View the Container Process Configuration

Inspect the container setup:

docker inspect edgedelta-container-id

Check for:

  • Container configuration details such as environment variables set for the Edge Delta Fleet, the command used to start the container, and the image from which the container was instantiated.
  • Runtime information, like the current state of the container (running, paused, stopped), restart count, and uptime.
  • Network settings, including the IP address assigned to the container, open ports, and network modes.
  • Resource limits and usage statistics, such as memory limits, CPU shares, and storage settings.
  • Mount points and volume configurations, to see where data is being stored and shared with the host system.
  • Any configured health checks and their status to ensure the application is operating as expected within the container.

The docker inspect command outputs a JSON object which can provide extensive details about the container’s setup. You need to parse this JSON output to find relevant information for troubleshooting.

3. Get the Container Process Status:

Check the status of the Edge Delta container:

docker ps | grep edgedelta-container-id

Examine the following information:

  • Container ID: The unique identifier for the Edge Delta container.
  • Image: The Docker image being used to run the Edge Delta container.
  • Command: The command that was used to start the container.
  • Created: When the container was created.
  • Status: The current status of the container (e.g., Up, Exited, Restarting).
  • Ports: Any network ports that are exposed and mapped to the host.
  • Names: The name assigned to the container.

The status tells you whether the container is currently running, stopped, restarting, or has exited with an error. If the container is not in the expected “Up” state, or if it has been restarting frequently, this may indicate an issue that requires further investigation.

4. Restart

Restart the Edge Delta container:

docker restart edgedelta-container-id

You restart the container to refresh the running state. A restart also performs the following:

  • Apply Configuration Changes: If changes have been made to the container’s configuration, restarting the container can apply those changes. This is common after updating environment variables or configuration files within the container.
  • Resolve Transient Issues: Sometimes, a container may encounter a transient problem or error that can be resolved by simply restarting it. This could be due to memory leaks, network issues, or other non-persistent problems cleared by a restart.
  • Update the Application: If the Edge Delta Fleet has been updated or patched, restarting the container might be necessary to run the new version.
  • Restore Functionality: In cases where the container has become unresponsive or is behaving unexpectedly, a restart may restore it to a functional state.
  • Free up Resources: Restarting the container can sometimes free up used resources that are not being correctly released, like memory or file handles.

Note: While restarting the container can resolve some issues, it should not be used as a permanent fix. Regularly needing to restart a container may indicate a more significant issue that warrants a deeper investigation into the application’s health and configuration.

5. Get the Container’s System Information:

Check the system information and resource usage of the Edge Delta container:

docker stats edgedelta-container-id

6. Restart the Docker service or container:

Unlike system services in Linux, you don’t need to restart the entire operating system for Docker, but rather just reload the Docker service or container if a configuration change is made.

systemctl reload docker

7. View the Fleet Log File:

Check the Fleet’s log files in the Docker environment:

docker logs edgedelta-container-id
  • Identify Errors and Warnings: Look for any error messages (ERROR) or warnings (WARN) that indicate issues with the Edge Delta Fleet. These entries usually provide a description of the issue and can serve as a starting point for troubleshooting.
  • Review Recent Entries: If the Edge Delta Fleet has encountered a recent problem, the corresponding log messages near the time of the issue can offer important clues.
  • Look for Patterns: Regularly occurring log messages may point to a recurring issue that needs to be addressed. This could reveal patterns in resource usage or errors that happen at specific intervals.
  • Check for Resource Issues: Log entries may show if the Edge Delta Fleet has resource-related issues, like memory or CPU constraints, which might cause performance problems or restarts.
  • Note Timestamps: Log entries are timestamped, which helps correlate events within the container to other system or application events.
  • Follow Startup Sequences: On starting or restarting the Edge Delta container, the logs will show the startup sequence of the Fleet. Ensure the startup process completes without errors.
  • Understand Log Levels: Logs are usually printed with severity levels such as DEBUG, INFO, WARN, and ERROR. DEBUG logs are verbose and used for development or deep debugging; INFO logs provide general operational information; WARN logs flag potential issues that are not immediate errors; ERROR logs flag actionable issues that likely need immediate attention.
  • Filter Relevant Information: Depending on the volume of logs, it might be necessary to filter the output to find relevant information. One can use additional command-line tools like grep to sift through the logs for specific terms related to known issues or symptoms.

8. Troubleshoot Memory Limits:

To manage Docker container memory limits, you can specify resource constraints when you run the container using parameters like –cpus and –memory. For example:

docker run --name edgedelta -d --cpus=".25" --memory="256m" edgedelta/agent-image

If the Edge Delta service restarts frequently due to reaching memory limits, you can adjust these limits as shown or enable memory profiling by setting environment variables when running the container.