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

aws cli too few arguments error #24

Closed
jhackGC opened this issue Sep 13, 2019 · 12 comments
Closed

aws cli too few arguments error #24

jhackGC opened this issue Sep 13, 2019 · 12 comments
Labels
question Further information is requested

Comments

@jhackGC
Copy link

jhackGC commented Sep 13, 2019

Hi, when running this Orb command (setup), I'm getting this error:

aws configure set aws_access_key_id
$AWS_ACCESS_KEY_ID
--profile default
usage: aws [options] [ ...] [parameters]
To see help text, you can run:

aws help
aws help
aws help
aws: error: too few arguments

Thanks !

@s4ros
Copy link

s4ros commented Sep 15, 2019

did you provide the proper ENV variables within your CircleCI project's settings?

@lokst
Copy link
Contributor

lokst commented Sep 17, 2019

@jhackGC Could you check if AWS_ACCESS_KEY_ID is defined?

@lokst lokst added the question Further information is requested label Sep 17, 2019
@jhackGC
Copy link
Author

jhackGC commented Sep 17, 2019 via email

@lokst
Copy link
Contributor

lokst commented Nov 14, 2019

@jhackGC Apologies for the late response!

Is this the command that is giving you the error? Would you mind rerunning the job with SSH and then running the same command in your SSH session to check the output?

aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default

I recommend checking what the value of $AWS_ACCESS_KEY_ID is too. You could do that by running set -x before the above command.

@lokst
Copy link
Contributor

lokst commented Jan 14, 2020

Closing this due to inactivity.

@lokst lokst closed this as completed Jan 14, 2020
@patsa
Copy link

patsa commented Feb 24, 2020

@lokst
I can confirm this issue but not while using CircleCi. Instead I'm trying to implement an automated deployment through GitlabCI.
I'm currently using a Node 12.x image and install the aws cli through the following commands.

- apt install -y software-properties-common
- apt install -y python-dev
- apt install -y python-pip
- apt install -y groff
- apt install -y less
- pip install awscli
- aws configure set aws_access_key_id $live_id --profile default
- aws configure set aws_secret_access_key $live_key --profile default
- aws configure set region $region --profile default

When executing the last three commands I get the error message aws: error: too few arguments.
I can confirm that the variables are set. I used echo to display them and they were correct.

Any ideas what could be the issue here?

@patsa
Copy link

patsa commented Feb 24, 2020

It seems to be because of the dollar notation.
If I try to execute the same command with a normal string, the command succeeds without any problems.

Any idea how to escape the dollar sign in a way to make the aws cli accept it?

@lokst
Copy link
Contributor

lokst commented Feb 24, 2020

@patsa Could you try adding set -x before the aws commands run so that you can confirm the actual command run?

@patsa
Copy link

patsa commented Feb 24, 2020

@lokst
The output looks like this now:

++ echo '�[32;1m$ aws configure set aws_access_key_id "${live_id}"�[0;m'
�[32;1m$ aws configure set aws_access_key_id "${live_id}"�[0;m
++ aws configure set aws_access_key_id ''

and like this when written like in my original post:

 ++ echo '$ aws configure set aws_access_key_id $live_id --profile default'
 $ aws configure set aws_access_key_id $live_id --profile default
 ++ aws configure set aws_access_key_id --profile default

But the correct value is definitely set within the variable $live_id, as I confirmed by executing echo $live_id.

@lokst
Copy link
Contributor

lokst commented Feb 26, 2020

@patsa I'd recommend trying something like echo "live_id is $live_id" && aws configure set aws_access_key_id $live_id --profile default to be sure that the variable is set at the point the aws command is run

@deeptechs
Copy link

deeptechs commented Mar 9, 2020

@lokst
I can confirm this issue but not while using CircleCi. Instead I'm trying to implement an automated deployment through GitlabCI.
I'm currently using a Node 12.x image and install the aws cli through the following commands.

- apt install -y software-properties-common
- apt install -y python-dev
- apt install -y python-pip
- apt install -y groff
- apt install -y less
- pip install awscli
- aws configure set aws_access_key_id $live_id --profile default
- aws configure set aws_secret_access_key $live_key --profile default
- aws configure set region $region --profile default

When executing the last three commands I get the error message aws: error: too few arguments.
I can confirm that the variables are set. I used echo to display them and they were correct.

Any ideas what could be the issue here?

@patsa maybe you can check the protected variables / protected branches in gitlab CI.
You can't use protected variables in unprotected branches. So maybe you don't really have your env variables.

@patsa
Copy link

patsa commented Mar 17, 2020

@deeptechs That was actually the culprit. Thanks for mentioning it!

brivu added a commit that referenced this issue Apr 20, 2022
parent 86625eb
author Brian Vu <emailbrian.vu@gmail.com> 1650493284 -0700
committer Brian Vu <emailbrian.vu@gmail.com> 1650493685 -0700

# This is a combination of 12 commits.tree 8fff8bd4b79ace9a23d4d2a9038b67823b6e8fac
parent 86625eb
author Brian Vu <emailbrian.vu@gmail.com> 1650493284 -0700
committer Brian Vu <emailbrian.vu@gmail.com> 1650493284 -0700

parent a2e5910
author Brian Vu <emailbrian.vu@gmail.com> 1649403325 -0700
committer Brian Vu <emailbrian.vu@gmail.com> 1650493045 -0700

feat: Added OIDC support

# This is the commit message #12:

test: debugging

# This is the commit message #23:

test: debugging

# This is the commit message #24:

test: debugging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants