pingcap / pingcap/tiup

wrong scp command with ipv6 address

Open
#2,541 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?

tiup deploy yaml:

global:
  user: "user"
  systemd_mode: "user"
  deploy_dir: "/data00/tikv/tikv-deploy"
  data_dir: "/data00/tikv/tikv-data"
  arch: "amd64"

server_configs:
  tikv:
    server.grpc-compression-type: gzip
    raftstore.raft-entry-max-size: 1GB
    raftstore.raft-max-size-per-msg: 1GB
    server.max-grpc-send-msg-len: 1073741824
    
pd_servers:
  - host: "fdbd:dc0c:1:121a::51"
  - .....
 tikv_servers:
  - host: "fdbd:dc0c:1:121a::51"
    port: 20160
    status_port: 20180
    deploy_dir: "/data00/tikv/tikv-deploy/tikv-20160"
    data_dir: "/data00/tikv/tikv-data/tikv-20160"
    log_dir: "/data00/tikv/tikv-20160/log"
  - ...

tiup cluster check deploy-online.yaml --user user --ssh=system

  1. What did you expect to see?

everything is good.

  1. What did you see instead?
Error: failed to scp /home/user/.tiup/storage/cluster/packages/insight-v0.4.2-linux-amd64.tar.gz to fdbd:dc0c:1:121a::51:/tmp/tiup/bin/insight-v0.4.2-linux-amd64.tar.gz: executor.ssh.execute_failed: Failed to transfer file over SCP for 'user@fdbd:dc0c:1:121a::51:22' {ssh_stderr: ssh: Could not resolve hostname fdbd: Name or service not known
lost connection
, ssh_stdout: , ssh_command: scp -r -o StrictHostKeyChecking=no -o ConnectTimeout=5 /home/user/.tiup/storage/cluster/packages/insight-v0.4.2-linux-amd64.tar.gz user@fdbd:dc0c:1:121a::51:/tmp/tiup/bin/insight-v0.4.2-linux-amd64.tar.gz}, cause: exit status 1

it seems that the problem is caused by missing '[]' at ipv6 address in scp command

  1. What version of TiUP are you using (tiup --version)?
$ tiup --version
1.16.2 tiup
Go Version: go1.21.13
Git Ref: v1.16.2
GitHash: 678c52de0c0ef30634b8ba7302a8376caa95d50d

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 tracing the tiup cluster check path that constructs the SCP command for hosts from the YAML configuration, using the IPv6 reproduction in this issue. Verify how the host is formatted before execution. Done means the generated SCP command brackets IPv6 addresses and the transfer succeeds for the provided configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.