pingcap / pingcap/tiup

tiup should not require sudo / su

Open
#2,127 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Go
Stars
466
Forks
338
Avg merge
3d 7h
Merged PRs (30d)
8

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    tiup cluster check ./topology.yaml

  2. What did you expect to see?
    Command succeeds

  3. What did you see instead?
    tiup is checking updates for component cluster ...
    Starting component cluster: /home/tiup/.tiup/components/cluster/v1.11.2/tiup-cluster check ./topology.yaml

  • Download necessary tools
    • Downloading check tools for linux/amd64 ... Done
  • Collect basic system information
    • Getting system info of 127.0.0.1:22 ... Error

Error: executor.ssh.execute_failed: Failed to execute command over SSH for 'tiup@127.0.0.1:22' {ssh_stderr: We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
, ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c "test -d /tmp || (mkdir -p /tmp && chown tiup:$(id -g -n tiup) /tmp)"}, cause: Process exited with status 1

  1. What version of TiUP are you using (tiup --version)?
    1.11.1 tiup
    Go Version: go1.19.2
    Git Ref: v1.11.1
    GitHash: b95172df211e4f9b643590f2dd8436ad60c72b38

Note:

  • systemd supports user services
  • Many organisations will not approve the use of "sudo" in a production environment. I've already encountered some during POCs ( as a TSA ), and seen yet more people discuss this in lark

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tiup cluster check ./topology.yaml entry point and trace the SSH execution that runs /usr/bin/sudo. Review the reported executor.ssh.execute_failed path and determine the intended behavior when sudo requires a password; done means the check succeeds without requiring an interactive sudo prompt, with coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.