SSH errors when installing a new TiDB cluster (v6.5.0)

Application environment:

Linux AMD64 cluster with all nodes running Ubuntu 20.04.5 LTS

TiDB version:

v6.5.0

Reproduction method:

Follow the installation instructions here: Deploy a TiDB Cluster Using TiUP | PingCAP Docs as far as Step 4. The problem arises in Step 4, when I do:

tiup cluster deploy tidb-cluster v6.5.0 machines/tidb/tidb-config.yaml --user fano

Here fano is the name of the user I will be running the cluster as. I have set up passwordless login for this user to all nodes.

Problem:

Deployment fails with:

Error: failed to fetch cpu-arch or kernel-name: executor.ssh.execute_failed: Failed to execute command over SSH for ‘fano@fs-9:22’ {ssh_stderr: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c “uname -m”}, cause: Process exited with status 1

This happens in the step “Detect CPU Arch Name”.

I get exactly the same error if I add the “-p” option to the “tiup cluster deploy…” command above: it asks for the SSH password and then fails with exactly the same error, at exactly the same point.

I also get exactly the same error if I add the “–ssh system” flag to the “tiup cluster deploy…” command above, and also if I add both options: “–ssh system -p”. In each case it fails with exactly the same error, at exactly the same point.

Please advise!

Resource allocation:

192Gb RAM, 8Tb hard disk.

Attachment:

n/a

you should use the users with ssh and sudo privileges to complete the deployment.

The user fano has both SSH and sudo privileges. So I think that cannot be the cause.

The error is

ssh_stderr: sudo: a terminal is required to read the password

I think you should use following command with -p option to specify the password.

tiup cluster deploy tidb-cluster v6.5.0 machines/tidb/tidb-config.yaml --user fano -p your_password

Depending on the TiUP version etc. it might be that --ssh system can help here. If system doesn’t work, try builtin.

Many thanks for your help @crazycs520 and @dveeden. Based on what you told me, I figured out what was wrong. The user fano that I was using for the install had sudo privileges, but did not have passwordless sudo privileges. Once I gave fano passwordless sudo privileges on each node, the installation worked smoothly.

It might be a good idea to make a tiny edit to the documentation, replacing “users with ssh and sudo privileges” by “users with ssh and passwordless sudo privileges”, in case anyone else runs into the same problem.

Thank you again! :grinning:

2 Likes