Solution to the error message: "incorrect number of tail fields, expected 3 but found 4"

Solution to the error message: "incorrect number of tail fields, expected 3 but found 4"

WSL2 error when working with microk8s

One of the common errors developers who run a Linux distro (ubuntu) on Windows using wsl2 face when working with Kubernetes and microk8s is this error: "incorrect number of tail fields, expected 3 but found 4" when trying to run a microk8s command.

Explanation/Reason for the Error

This error is mainly due to the Docker Desktop being installed in a default location and hence cannot be accessed by microk8s.

Solution

To fix this error follow these steps:

  1. Uninstall the existing installation of Docker Desktop in Windows.

  2. Download the latest version of Docker Desktop for Windows.

  3. Open Command Prompt (cmd).

  4. Change the current working directory to the downloaded Docker Desktop folder. i.e.

    cd "C:\Users\%USERNAME%\Downloads"

  5. Run the following command to install Docker Desktop in a folder other than the default one.

    "Docker Desktop Installer.exe" install --accept-license --installation-dir=C:\Docker

With this, the error should disappear like smoke, and you can continue your project.