Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microk8s in WSL2 Ubuntu giving error "incorrect number of tail fields, expected 3 but found 4" #3911

Closed
hanzlamateen opened this issue Apr 10, 2023 · 2 comments

Comments

@hanzlamateen
Copy link

hanzlamateen commented Apr 10, 2023

Summary

When I run any microk8s command I get incorrect number of tail fields, expected 3 but found 4 error message.

What Should Happen Instead?

Previously there was no such error.

Reproduction Steps

  1. Here is my WSL version wsl -v
WSL version: 1.1.6.0
Kernel version: 5.15.90.1
WSLg version: 1.0.50
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.1413
  1. Docker Desktop 4.18.0 (104112)
  2. Installed microk8s using snap 1.26/stable in WSL Ubuntu
  3. When I run any command I get following error:
2023/04/10 15:16:27.283959 system_key.go:129: cannot determine nfs usage in generateSystemKey: cannot parse mountinfo: incorrect number of tail fields, expected 3 but found 4
2023/04/10 15:16:27.291663 cmd_run.go:1046: WARNING: cannot create user data directory: cannot determine SELinux status: failed to obtain SELinux mount path: incorrect number of tail fields, expected 3 but found 4
  1. (Optional) When I run microk8s enable dashboard it gives following error:
2023/04/10 15:29:41.669394 system_key.go:129: cannot determine nfs usage in generateSystemKey: cannot parse mountinfo: incorrect number of tail fields, expected 3 but found 4
2023/04/10 15:29:41.676119 cmd_run.go:1046: WARNING: cannot create user data directory: cannot determine SELinux status: failed to obtain SELinux mount path: incorrect number of tail fields, expected 3 but found 4
Infer repository core for addon dashboard
Enabling Kubernetes Dashboard
Traceback (most recent call last):
  File "/snap/microk8s/4959/scripts/wrappers/enable.py", line 41, in <module>
    enable(prog_name="microk8s enable")
  File "/snap/microk8s/4959/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/microk8s/4959/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/microk8s/4959/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/microk8s/4959/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/microk8s/4959/scripts/wrappers/enable.py", line 37, in enable
    xable("enable", addons)
  File "/snap/microk8s/4959/scripts/wrappers/common/utils.py", line 445, in xable
    enabled_addons_info, disabled_addons_info = get_status(available_addons_info, True)
  File "/snap/microk8s/4959/scripts/wrappers/common/utils.py", line 491, in get_status
    kube_output = kubectl_get("all,ingress")
  File "/snap/microk8s/4959/scripts/wrappers/common/utils.py", line 216, in kubectl_get
    return run(KUBECTL, "get", cmd, "--all-namespaces", die=False)
  File "/snap/microk8s/4959/scripts/wrappers/common/utils.py", line 74, in run
    result.check_returncode()
  File "/snap/microk8s/4959/usr/lib/python3.6/subprocess.py", line 389, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '('/snap/microk8s/4959/microk8s-kubectl.wrapper', 'get', 'all,ingress', '--all-namespaces')' returned non-zero exit status 1.

Introspection Report

inspection-report-20230410_152125.tar.gz

@ktsakalozos
Copy link
Member

Could this be related? docker/for-win#13318

@hanzlamateen
Copy link
Author

Could this be related? docker/for-win#13318

@ktsakalozos thanks for your response. This issue was mainly due to Docker Desktop being installed in default location. Here are the steps I followed to fix:

  1. Uninstall existing installation of Docker Desktop in Windows.
  2. Download latest version of Docker Desktop for Windows.
  3. Open Command Prompt (cmd).
  4. Change current working directory to downloaded Docker Desktop folder. i.e.
cd "C:\Users\%USERNAME%\Downloads"
  1. Run following command to install Docker Desktop in a folder other than default one.
"Docker Desktop Installer.exe" install --accept-license --installation-dir=C:\Docker

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

No branches or pull requests

2 participants