Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cluster: improved error for missing tar #2499

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cluster/task/install_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package task

import (
"bytes"
"context"
"fmt"
"path"
Expand Down Expand Up @@ -51,6 +52,9 @@ func (c *InstallPackage) Execute(ctx context.Context) error {

_, stderr, err := exec.Execute(ctx, cmd, false)
if err != nil {
if bytes.Contains(stderr, []byte("command not found")) {
Copy link
Member

@breezewish breezewish Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about polish the text to install tar in the host xxx (xxx is the dest host name)? Then user will not misunderstood to install in the current machine. The rest LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 16da107

$ tiup cluster check topology.yaml 
The SSH identity key is encrypted. Input its passphrase: 

+ Detect CPU Arch Name
  - Detecting node 192.168.122.196 Arch info ... Done

+ Detect CPU OS Name
  - Detecting node 192.168.122.196 OS info ... Done
+ Download necessary tools
  - Downloading check tools for linux/amd64 ... Done
+ Collect basic system information
  - Getting system info of 192.168.122.196:22 ... Error

Error: tar command was not found on 192.168.122.196, please install it

Verbose debug logs has been written to /home/dvaneeden/.tiup/logs/tiup-cluster-debug-2025-01-21-13-26-46.log.

return errors.Errorf("tar command was not found on %s, please install it", c.host)
}
return errors.Annotatef(err, "stderr: %s", string(stderr))
}
return nil
Expand Down
Loading