Fix: Speedtest-tracker V1.8.0 On Docker Ubuntu 24.04 LTS

by Alex Johnson 57 views

Experiencing issues with speedtest-tracker v1.8.0 while running it on Docker with Ubuntu 24.04 LTS? You're not alone! This comprehensive guide will walk you through a common problem encountered in this setup and provide a detailed solution to get your speedtest-tracker up and running smoothly.

The Issue: Docker Container Fails to Start

One prevalent issue users face is the speedtest-tracker container failing to start when using Docker version 29+ on Ubuntu 24.04 LTS, particularly in ARM environments. The error message typically observed in the logs is related to mounting the overlay filesystem, indicating an "invalid argument." Let’s dive into the specifics.

Decoding the Error Message

The error message, Error response from daemon: failed to mount /tmp/containerd-mount... err: invalid argument, points to a problem with how Docker is trying to mount the container's filesystem. This usually occurs due to incompatibilities between the Docker version, the underlying operating system kernel, and the filesystem drivers. In this case, it seems Docker 29+ has some issues in the ARM environment on Ubuntu 24.04 when mounting the overlay filesystem, which is used for container layers.

Symptoms of the Problem

  • The speedtest-tracker container fails to start.
  • Error messages in Docker logs indicate issues with mounting the overlay filesystem.
  • The problem is observed on ARM-based systems running Ubuntu 24.04 LTS with Docker version 29+.
  • Downgrading Docker to version 28.5.2 resolves the issue.

Identifying Your Environment

Before we proceed with the solution, let's ensure you are indeed facing the same problem. Verify your environment details by running the following commands:

  1. Kernel Version:
    uname -a
    
    This command displays your kernel information. If you're on an ARM-based system, you'll likely see aarch64 in the output.
  2. Operating System:
    cat /etc/*release*
    
    This shows your OS distribution details, confirming if you're using Ubuntu 24.04 LTS.
  3. Docker Version:
    sudo docker --version
    
    Check if your Docker version is 29 or higher.
  4. Docker Compose Version:
    sudo docker-compose --version
    
    This verifies your Docker Compose version, which should be compatible with your Docker installation.

Example Environment Details

Here's an example of the environment where this issue is observed:

  • Kernel: Linux NanoPi-R6C 6.1.99 #32 SMP Mon Jan 20 15:50:32 CST 2025 aarch64 aarch64 aarch64 GNU/Linux
  • OS:
    BOARD="NanoPi-R6C"
    BOARD_NAME="NanoPi-R6C"
    LINUXFAMILY=nanopi6
    BRANCH=dev
    BOARD_VENDOR=FriendlyELEC
    ARCH=arm
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=24.04
    DISTRIB_CODENAME=noble
    DISTRIB_DESCRIPTION="Ubuntu 24.04.3 LTS"
    
  • Docker: Docker version 29.0.2, build 8108357
  • Docker Compose: Docker Compose version v2.40.3

The Solution: Downgrading Docker

The most effective solution currently is to downgrade Docker to version 28.5.2. This version is known to work well with speedtest-tracker on Ubuntu 24.04 LTS in ARM environments. Here’s how to do it:

Step-by-Step Downgrade Instructions

  1. Specify the Docker Version: First, we define the version string for Docker 28.5.2.
    VERSION_STRING=5:28.5.2-1~ubuntu.24.04~noble
    
  2. Install the Specific Docker Version: Use apt to install the desired Docker version and its dependencies.
    sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
    
    This command tells apt to install the specified versions of Docker CE, Docker CLI, containerd.io, Docker Buildx plugin, and Docker Compose plugin. This ensures all components are compatible.
  3. Verify the Installation: After installation, verify the Docker version to confirm the downgrade.
    sudo docker --version
    
    The output should now display Docker version 28.5.2.

Understanding the Downgrade Process

The downgrade process involves installing specific versions of Docker packages. By specifying the exact version string, you ensure that you're not just getting the latest available but the version known to resolve the compatibility issue. The command installs docker-ce, docker-ce-cli, containerd.io, docker-buildx-plugin, and docker-compose-plugin, ensuring all necessary components are aligned with the downgraded version.

Configuring Your compose.yaml

To ensure speedtest-tracker works correctly, you'll need a compose.yaml file. Here’s an example configuration. Remember to replace the placeholder for APP_KEY with your actual key.

Example compose.yaml

services:
    speedtest-tracker:
        container_name: speedtest-tracker
        ports:
            - 8080:80
            - 8443:443
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=America/New_York
            - APP_KEY=base64:V0Fe3Ez...=
            - DB_CONNECTION=sqlite
            - DISPLAY_TIMEZONE=America/New_York
            - SPEEDTEST_SCHEDULE=*/30 * * * *
            - SPEEDTEST_SERVERS=2404,71392
            - PRUNE_RESULTS_OLDER_THAN=14
        volumes:
            - ./config:/config
        image: lscr.io/linuxserver/speedtest-tracker:latest
        restart: unless-stopped

Key Configuration Parameters Explained

  • ports: Maps ports 8080 and 8443 on the host to ports 80 and 443 in the container, respectively.
  • environment: Sets various environment variables, including:
    • PUID and PGID: User and group IDs for permissions.
    • TZ: Timezone.
    • APP_KEY: Application key for security (ensure this is correctly set).
    • DB_CONNECTION: Database connection type (SQLite in this case).
    • DISPLAY_TIMEZONE: Timezone for display.
    • SPEEDTEST_SCHEDULE: Cron schedule for running speed tests.
    • SPEEDTEST_SERVERS: Specific Speedtest servers to use.
    • PRUNE_RESULTS_OLDER_THAN: How long to keep test results (in days).
  • volumes: Mounts the ./config directory on the host to /config in the container for persistent storage.
  • image: Specifies the Docker image to use.
  • restart: Sets the restart policy to unless-stopped.

Deploying with Docker Compose

With your compose.yaml file configured, you can now deploy speedtest-tracker using Docker Compose.

Steps to Deploy

  1. Navigate to the Directory: Go to the directory containing your compose.yaml file.
    cd /path/to/your/compose/file
    
  2. Run Docker Compose: Start the container in detached mode.
    docker compose up -d
    
    This command will pull the speedtest-tracker image (if not already present), create the container, and start it in the background.

Expected Outcome

After running docker compose up -d, the speedtest-tracker container should start without issues. You can verify this by running:

    docker ps

This will list all running containers, and you should see speedtest-tracker in the list.

Validating the Fix

Once the container is running, you should validate that speedtest-tracker is working correctly. Access the application through your web browser using the appropriate port (usually port 8080).

Accessing speedtest-tracker

Open your web browser and navigate to http://<your-server-ip>:8080. You should see the speedtest-tracker interface. If you've configured SSL (port 8443), use https://<your-server-ip>:8443.

Common Validation Steps

  • Check the Interface: Ensure the web interface loads correctly.
  • Run a Speed Test: Manually trigger a speed test to confirm it runs and records results.
  • Review Logs: Check the container logs for any errors.

Additional Troubleshooting Tips

If you still encounter issues, here are some additional troubleshooting steps:

Docker and System Checks

  • Check Docker Status: Ensure Docker is running correctly.
    sudo systemctl status docker
    
  • Check Container Logs: View the logs for your speedtest-tracker container.
    docker logs speedtest-tracker
    
  • Verify Disk Space: Ensure you have sufficient disk space.
    df -h
    

Common Pitfalls and How to Avoid Them

  • Incorrect APP_KEY: Ensure your APP_KEY in the compose.yaml is correct. An incorrect key can prevent the application from starting.
  • Port Conflicts: If you have other services using ports 8080 or 8443, you may need to change the port mappings in your compose.yaml.
  • Permissions Issues: Ensure the user and group IDs (PUID and PGID) are correctly set to avoid permissions issues with the mounted volumes.

When to Seek Further Assistance

If you've tried the above steps and are still facing issues, it may be time to seek further assistance. Here are some scenarios where you should consider reaching out for help:

  • Persistent Errors: If the container consistently fails to start despite downgrading Docker and checking configurations.
  • Unclear Error Messages: If the logs contain error messages you don't understand.
  • Complex Network Configurations: If you have a complex network setup that might be interfering with container communication.

Conclusion

Running speedtest-tracker on Docker with Ubuntu 24.04 LTS can be seamless with the right configuration. By downgrading Docker to version 28.5.2, you can bypass the mounting issues encountered in newer versions on ARM environments. This guide has provided a step-by-step solution, covering everything from identifying the problem to validating the fix.

By following these instructions, you should be able to get your speedtest-tracker up and running, allowing you to monitor your network performance effectively. If you need more information about docker you can visit the official Docker Documentation for detailed guides and best practices.