-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
prints additional None with --output text, --query and --max-items #7277
Comments
Hi @gonrial, thanks for reaching out and sorry to hear you're having trouble. I tried reproducing using the same command below on both v2.7.21 and v2.7.33 (latest version) and unfortunately I wasn't able to. I received expected output without additional line you mentioned. I would investigate more on your debug logs and sync up with tim-finnigan@ as well. Thanks for being patient with us!
|
@aBurmeseDev I give you a way to reproduce in a clean install. Note that the cluster MUST have more items than the
It is not only for ecs and task lists. Here is the same result for another resources
|
@gonrial - thank you for the clarification. I added more tasks in my cluster and can confirm that I was able to reproduce the same behavior. I narrowed down the possible cause and the issue seems to be related to I also found out that you could use
Though, We're going to investigate further into this and keep this issue open while we do. Please feel free to check back in for further updates. Thank you again! Best, |
I'm experiencing a similar issue: zvi.cahana:~/ $ aws ec2 describe-vpcs --filters Name=tag:Name,Values=k8s-tkg-0014-management-vpc --query "Vpcs[].VpcId" --max-items 1 --output text | cat
vpc-06071692433b1e83e
None
zvi.cahana:~/ $ aws ec2 describe-vpcs --filters Name=tag:Name,Values=k8s-tkg-0014-management-vpc --query "Vpcs[].VpcId" --max-items 2 --output text | cat
vpc-06071692433b1e83e vpc-0b83a649f1e789bb8 Due to the |
Same for me with aws logs filter-log-events \
--log-group-name log-group \
--query 'events[0].message' \
--output json
"/usr/local/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError" aws logs filter-log-events \
--log-group-name log-group \
--query 'events[0].message' \
--output text
/usr/local/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
None
None aws logs filter-log-events \
--log-group-name log-group \
--query 'events[0].message' \
--output text \
--no-paginate
/usr/local/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError Using AWS CLI v2.9.6. |
This appears to be intentional behavior:
https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html#cli-usage-filter-client-side |
Thanks for sharing the documentation in the comment above. As noted there, this is a limitation/edge case when using |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Running a command with
--max-items
,--output text
and--query
produce an additional line with the string None. Any other combination does not show that string.Also appeared as #5654 and #7172
@tim-finnigan sorry that I reopen this, but I didn't see the previous notifications. Now with debug data
Expected Behavior
Current Behavior
Reproduction Steps
Where max-items should be n-1 elements from the existing tasks.
Possible Solution
No response
Additional Information/Context
Command with debug:
Result:
CLI version used
aws-cli/2.7.21
Environment details (OS name and version, etc.)
Python/3.9.11 Linux/5.15.0-43-generic exe/x86_64.ubuntu.22 prompt/off
The text was updated successfully, but these errors were encountered: