pingcap / pingcap/tiup

After tmp-storage-path is set, the error permission denied is returned

Open
#2,328 0 comments 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?

when deploy tidb cluster and set tmp-storage-path, tidb deploy success but start faild because of permission denied.

tiup cluster deploy lwt v6.5.5 ./test.yaml -utidb(user_a)

global:
 user: "tidb"(user_b)
 ssh_port: 22
 deploy_dir: "/DATA/disk1/tidb-deploy"
 data_dir: "/DATA/disk1/tidb-data"
tidb_servers:
 - host: xxx
   port: 13309
   status_port: 10030
   deploy_dir: /DATA/disk1/tidb-deploy/tidb-13309
   log_dir: /DATA/disk1/tidb-deploy/tidb-13309/log
   config:
     tmp-storage-path: /DATA/disk1/lwtmp

deploy_user "tidb" has sudo permissions and can successfully create a directory
but user_b(tidb) mkdir failed.
and sudo user_b(tidb) mkdir success.

[tidb@172-16-120-12 ~]$ sudo mkdir /DATA/disk1/lwtmp
[tidb@172-16-120-12 ~]$ ssh -i /home/tidb/.tiup/storage/cluster/clusters/lwt/ssh/id_rsa [tidb@10.2.8.2](mailto:tidb@10.2.8.2) 'mkdir /DATA/disk1/lwtmp1'
mkdir: 无法创建目录"/DATA/disk1/lwtmp1": 权限不够
[tidb@172-16-120-12 ~]$

[tidb@172-16-120-12 config]$ ssh -i /home/tidb/.tiup/storage/cluster/clusters/lwt/ssh/id_rsa tidb@10.2.8.2 'sudo mkdir /DATA/disk1/lwtmp2'
[tidb@172-16-120-12 config]$
  1. What did you expect to see?

no error

  1. What did you see instead?

tiup cluster start tidb-server failed because of mkdir tmp-storage-path failed.

  1. What version of TiUP are you using (tiup --version)?

[tidb@172-16-120-12 config]$ tiup --version
1.13.0 v1.13.0-nightly-3
Go Version: go1.21.1
Git Ref: master
GitHash: 9d1ba4b8357a1b34d02556cbd77236de1df1b1dc

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 by reproducing the tiup cluster deploy and tiup cluster start commands with the shown test.yaml, focusing on the tmp-storage-path mkdir step under the deployment user. Trace how TiUP handles directory creation and permissions; done means the cluster starts successfully without the permission-denied error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.