Tanzu Error: Error: current server “” not found in tanzu config

Problem:

rajesh@ubuntu:~$ tanzu cluster create raju
Error: current server "" not found in tanzu config
Usage:
  tanzu cluster create CLUSTER_NAME [flags]

Flags:
  -d, --dry-run       Does not create cluster, but show the deployment YAML instead
  -f, --file string   Configuration file from which to create a cluster
  -h, --help          help for create
      --tkr string    TanzuKubernetesRelease(TKr) to be used for creating the workload cluster. If TKr name prefix is provided, the latest compatible TKr matching the TKr name prefix would be used

Global Flags:
      --log-file string   Log file path
  -v, --verbose int32     Number for the log level verbosity(0-9)

Error: exit status 1

✖  exit status 1

Tanzu Error: docker is not installed or not reachable. Verify it’s installed, running

Error

rajesh@ubuntu:~/tce-linux-amd64-v0.12.1$ tanzu unmanaged-cluster create one-cluster

📁 Created cluster directory

🧲 Resolving and checking Tanzu Kubernetes release (TKr) compatibility file
   projects.registry.vmware.com/tce/compatibility
   Compatibility file exists at /home/rajesh/.config/tanzu/tkg/unmanaged/compatibility/projects.registry.vmware.com_tce_compatibility_v9

🔧 Resolving TKr
   projects.registry.vmware.com/tce/tkr:v1.22.7-2
   TKr exists at /home/rajesh/.config/tanzu/tkg/unmanaged/bom/projects.registry.vmware.com_tce_tkr_v1.22.7-2
   Rendered Config: /home/rajesh/.config/tanzu/tkg/unmanaged/one-cluster/config.yaml
   Bootstrap Logs: /home/rajesh/.config/tanzu/tkg/unmanaged/one-cluster/bootstrap.log

🔧 Processing Tanzu Kubernetes Release

🎨 Selected base image
   projects.registry.vmware.com/tce/kind:v1.22.7

📦 Selected core package repository
   projects.registry.vmware.com/tce/repo-12:0.12.0

📦 Selected additional package repositories
   projects.registry.vmware.com/tce/main:0.12.0

📦 Selected kapp-controller image bundle
   projects.registry.vmware.com/tce/kapp-controller-multi-pkg:v0.30.1

🚀 Creating cluster one-cluster
   Cluster creation using kind!
   ❤️  Checkout this awesome project at https://kind.sigs.k8s.io
failed to create cluster, Error: system checks detected issues, please resolve first: [docker is not installed or not reachable. Verify it's installed, running, and your user has permissions to interact with it. Error when attempting to run docker ps: command "docker ps" failed with error: exit status 1]
Error: exit status 7

✖  exit status 7

Solution

You are not allowed to run / install tanzu using root user but normal user. where as normal user is allowed to run docker command which is run internally when you fire tanzu command. In order to fix this, you need to add user into a linux group called “docker”. Use following command

$ sudo gpasswd -a $USER docker

or

sudo gpasswd -a rajesh docker

and Close and open a SSH terminal again to make effective.