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

When auto-prompt is on, aws codecommit credential-helper fails. #8370

Closed
t-morissey opened this issue Nov 28, 2023 · 2 comments
Closed

When auto-prompt is on, aws codecommit credential-helper fails. #8370

t-morissey opened this issue Nov 28, 2023 · 2 comments
Assignees
Labels
auto-prompt-mode Issues related to CLI auto-prompt mode documentation This is a problem with documentation. duplicate This issue is a duplicate.

Comments

@t-morissey
Copy link

t-morissey commented Nov 28, 2023

Describe the bug

aws codecommit credential-helper command fails when auto-prompt is on.

Expected Behavior

If auto-prompt is on, the command will successfully complete.

Current Behavior

The command fails with a warning Warning: Input is not a terminal (fd=0). and an error Unknown options: protocol=https.

Reproduction Steps

  1. Enable auto-prompt
  2. git config --global credential.helper '!aws codecommit credential-helper $@'
  3. git config --global credential.UseHttpPath true
  4. git clone https://git-codecommit..amazonaws.com/v1/repos/<repo_name>

My output:

$ export AWS_CLI_AUTO_PROMPT=on
$ git config --global credential.helper '!aws codecommit credential-helper $@'
$ git config --global credential.UseHttpPath true
$ git clone https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/xxxxxxx
Cloning into 'xxxxxxx'...
Warning: Input is not a terminal (fd=0).
warning: invalid credential line: > aws codecommit credential-helper get

Unknown options: protocol=https
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe
Username for 'https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/xxxxxxx':

Possible Solution

I guess this error is caused by the temporary use of STDOUT to show prompt when using auto-prompt, which does not happen when on-partial, it might be enough to just mention that in the documentation.

Additional Information/Context

No response

CLI version used

aws-cli/2.13.27

Environment details (OS name and version, etc.)

Python/3.11.6 Darwin/22.6.0 exe/x86_64 prompt/off

@t-morissey t-morissey added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 28, 2023
@tim-finnigan tim-finnigan self-assigned this Nov 29, 2023
@tim-finnigan
Copy link
Contributor

tim-finnigan commented Nov 29, 2023

Hi @t-morissey thanks for reaching out. We received another issue related to auto-prompt recently: #8330. I think it's worth having further discussion there around how the current behavior or documentation could be improved.

The CLI documentation does note the following for on-partial mode:

on-partial uses partial auto-prompt mode. If a command is incomplete or cannot be run due to client-side validation errors, auto-prompt is used. This mode is particular useful if you have pre-existing scripts, runbooks, or you only want to be auto-prompted for commands you are unfamiliar with rather than prompted on every command.

If you have any specific feedback on the wording there or in any part of the CLI User Guide, we recommend using the Provide feedback link at the bottom of the page to send feedback.

I think the codecommit credential-helper command is unique in that it is "not designed to be called directly from the AWS CLI." So maybe just that examples file could be updated to highlight the scenario you mentioned. (A PR to update the wording may be considered but I can't guarantee that.)

But since other commands may be affected, it may be better to add a section for this to the AWS CLI Troubleshooting Guide.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

@tim-finnigan tim-finnigan added duplicate This issue is a duplicate. documentation This is a problem with documentation. auto-prompt-mode Issues related to CLI auto-prompt mode and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-prompt-mode Issues related to CLI auto-prompt mode documentation This is a problem with documentation. duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

2 participants