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

Consider -g flag usage in neofs-cli #2089

Closed
vkarak1 opened this issue Nov 23, 2022 · 2 comments · Fixed by #2111
Closed

Consider -g flag usage in neofs-cli #2089

vkarak1 opened this issue Nov 23, 2022 · 2 comments · Fixed by #2111
Assignees
Labels
bug Something isn't working neofs-cli NeoFS CLI application issues U3 Regular

Comments

@vkarak1
Copy link

vkarak1 commented Nov 23, 2022

Please leave '-g' flag usage where it makes sense. Please find below some examples where -g flag exists in command helper but can't / shouldn't be used:

root@az:/home/service# neofs-cli control shards list -g -r node1:8080
Error: unknown shorthand flag: 'r' in -r
Usage:
  neofs-cli control shards list [flags]

Flags:
      --address string     Address of wallet account
      --endpoint string    Remote node control address (as 'multiaddr' or '<host>:<port>')
  -g, --generate-key       Generate new private key
  -h, --help               help for list
      --json               Print shard info as a JSON array
  -t, --timeout duration   Timeout for an operation (default 15s)
  -w, --wallet string      Path to the wallet or binary key

Global Flags:
  -c, --config string   Config file (default is $HOME/.config/neofs-cli/config.yaml)
  -v, --verbose         Verbose output

unknown shorthand flag: 'r' in -r

It's allowed to create container with -g flag but you will not be able to delete it:

root@az:/home/service# neofs-cli container create --name rep1 --policy "REP 2 IN X CBF 1 SELECT 2 FROM * AS X" --basic-acl public-read-write -g --rpc-endpoint node1.neofs:8080   --await
container ID: mm73yxDPYoWNkKXc3pMjFn1CoZh2Gw93WfGjt9XYSnM
awaiting...
container has been persisted on sidechain
root@az:/home/service# neofs-cli container delete --cid mm73yxDPYoWNkKXc3pMjFn1CoZh2Gw93WfGjt9XYSnM  -r node1:8080
can't fetch private key: unable to read file from given path: open : no such file or directory
root@az:/home/service# neofs-cli container delete --cid mm73yxDPYoWNkKXc3pMjFn1CoZh2Gw93WfGjt9XYSnM  -r node1:8080 -f
can't fetch private key: unable to read file from given path: open : no such file or directory

Help for neofs-cli control drop-objects should be also updated, it looks like -g flag is not applicable here:

root@az:/home/service# neofs-cli object put   -g  -r node1:8080  --cid 9RP8Wtjpe2sj4KAvmUBrbjE1xU1NwFDZJiiwQ11Vkk4Z --file /etc/neofs/storage/tatlin-object-sber-tfstate/vkarakozov/object1 -t 100m
 157286400 / 157286400 [====================================================================================================================================================================================] 100.00% 1m41s
[/etc/neofs/storage/tatlin-object-sber-tfstate/vkarakozov/object1] Object successfully stored
  OID: 9BtkimwNZUY8U1xeAp1i9YmEE8TW4y2wSXxcBasjPWtu
  CID: 9RP8Wtjpe2sj4KAvmUBrbjE1xU1NwFDZJiiwQ11Vkk4Z
root@az:/home/service# neofs-cli control drop-objects -o 9RP8Wtjpe2sj4KAvmUBrbjE1xU1NwFDZJiiwQ11Vkk4Z/9BtkimwNZUY8U1xeAp1i9YmEE8TW4y2wSXxcBasjPWtu -g --endpoint localhost:8091
can't fetch private key: unable to read file from given path: open : no such file or directory

Your Environment

NeoFS Storage node
Version: v0.34.0-60-g02049ca5
GoVersion: go1.19.3
@vkarak1
Copy link
Author

vkarak1 commented Nov 23, 2022

Also look at behavior of the neofs-cli control healthcheck parameter:

root@az:/home/service# neofs-cli control healthcheck -h
Health check of the NeoFS node. Checks storage node by default, use --ir flag to work with Inner Ring.

Usage:
  neofs-cli control healthcheck [flags]

Flags:
      --address string     Address of wallet account
      --endpoint string    Remote node control address (as 'multiaddr' or '<host>:<port>')
  -g, --generate-key       Generate new private key
  -h, --help               help for healthcheck
      --ir                 Communicate with IR node
  -t, --timeout duration   Timeout for an operation (default 15s)
  -w, --wallet string      Path to the wallet or binary key

Global Flags:
  -c, --config string   Config file (default is $HOME/.config/neofs-cli/config.yaml)
  -v, --verbose         Verbose output
root@az:/home/service# neofs-cli control healthcheck -g --endpoint localhost:8091
can't fetch private key: unable to read file from given path: open : no such file or directory
root@az:/home/service# neofs-cli control healthcheck -g --endpoint localhost:8091 --ir
can't fetch private key: unable to read file from given path: open : no such file or directory

@alexchetaev alexchetaev added the U3 Regular label Nov 23, 2022
@fyrchik
Copy link
Contributor

fyrchik commented Nov 24, 2022

Let's remove it from wherever is makes no sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working neofs-cli NeoFS CLI application issues U3 Regular
Projects
None yet
4 participants