aliyun / aliyun-cli

Alibaba Cloud CLI
Apache License 2.0
827 stars 198 forks source link

Tool does not write errors to stderr #266

Closed mlafeldt closed 3 years ago

mlafeldt commented 4 years ago

While working on https://github.com/mlafeldt/dotfiles/blob/master/bin/alicloud-assume-role, I noticed that the aliyun-cli tool does not write errors to stderr. Instead all output is written to stdout.

Proof:

$ aliyun sts AssumeRole >/dev/null

$ aliyun sts AssumeRole 2>/dev/null
ERROR: required parameters not assigned:
  --RoleArn
  --RoleSessionName

This makes scripting harder than it should be.

night556 commented 4 years ago

While working on https://github.com/mlafeldt/dotfiles/blob/master/bin/alicloud-assume-role, I noticed that the aliyun-cli tool does not write errors to stderr. Instead all output is written to stdout.

Proof:

$ aliyun sts AssumeRole >/dev/null

$ aliyun sts AssumeRole 2>/dev/null
ERROR: required parameters not assigned:
  --RoleArn
  --RoleSessionName

This makes scripting harder than it should be.

Thank you for your issue, this issue is a legacy of history and we are currently repairing it. We will reply under this issue after the repair.

aschleifer commented 4 years ago

Is there any update on when this issue might get fixed? It makes it annoying to debug issues in automation if this is not fixed.

JacksonTian commented 3 years ago

We will release a version to fix it before 7.31.

JacksonTian commented 3 years ago
$ go run main/main.go sts AssumeRole
ERROR: required parameters not assigned: 
  --RoleArn
  --RoleSessionName

use `aliyun sts AssumeRole --help` to get more information
exit status 3
$ go run main/main.go sts AssumeRole 2>/dev/null
JacksonTian commented 3 years ago

After #373 merged and release new CLI, this issue will be fixed.