-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
"sam deploy" does not execute if a tag has a long value #1845
Comments
This appears to be caused by this regex that was added in version 0.42.0: https://github.com/awslabs/aws-sam-cli/blob/develop/samcli/cli/types.py#L207. I isolated this code and tried it with a short tag and a long tag and it is the |
In my case there is no any error msg showing up. It took me a day to figure out what the problem is and it was because I was lucky to google and find this page... I am using 0.44. |
I too am hitting this issue as well. Using the AWS CLI directly does work fine aws cloudformation deploy \
--template .aws-sam/build/packaged.yaml \
--stack-name 'my-stack-name' \
--capabilities CAPABILITY_NAMED_IAM \
--tags \
SERVICE=ggg-ggggggggg-ggggggg \
GIT_BRANCH=master \
GIT_REPOSITORY=gggggg-ggggggggg-ggg-gggggggggggggg Using the same call with AWS SAM either does not work... or takes way too long sam deploy \
--template-file .aws-sam/build/packaged.yaml \
--stack-name 'my-stack-name' \
--capabilities CAPABILITY_NAMED_IAM \
--no-fail-on-empty-changeset \
--tags \
SERVICE=ggg-ggggggggg-ggggggg \
GIT_BRANCH=master \
GIT_REPOSITORY=gggggg-ggggggggg-ggg-gggggggggggggg What I've noticed is that there seems to even be an exponential execute time increase when I increase that Unfortunately, I'm in the middle of authoring a course, showcasing AWS SAM, that needs this working. 😞 |
@sriram-mv @jfuss Has anyone looked into this issue yet? I noticed that v0.48 of the cli was just released and this has been an issue since v0.42.0. I have had to freeze on v0.41.0 because of this issue. Why was this regex added to being with? It is not clear what it is supposed to do or look for, but the pattern is terribly non-performant. |
Thanks @beck3905 for linking the code where the issue. On adding some extra logging, the regex pattern we are using is To add to that, I don't think this regex is completely bug free. For Eg: AWS EC2 Tagging restriction mention that you can use Usually we try to stay consistent with how AWS CLI handles things however different services across AWS have different way to handle tagging. Eg: Plus we don't want to break backwards compatibility for our current users. I'll sync with team and try to update here on what approach we want to take to fix this, but given that we are already broken with:
We can probably consider not supporting |
@c2tarun Thanks for digging into this. I'm not sure about whether or not to support the |
@beck3905 Yeah, on giving this more thought there might be people who are base64 encoding something as value. Even though we are parsing it wrong, but breaking on multiple |
Actually we don't have to worry about approaches taken by other AWS Services as long as we stay consistent with AWS CFN. CFN interestingly supports both approaches taken by S3 and EC2 :) The solution I think will work is:
It is little more work then I thought, but should solve most of the problems. There is still a risk if breaking someone if they are already using multiple |
Correction in my investigation, in order to use |
FYI - I have the same problem, tagging the stack with the git commit url (using github actions), hangs the |
We just released v0.49.0. Sorry for the delay, you should be able to upgrade now. Please feel free to re-open this ticket if you have any questions. |
@c2tarun I am still experiencing hangs in my CI/CD environment due to long tags. It works eventually on my OSX terminal, but on my CircleCI environment it hangs and the job times out. Even in my OSX terminal, it takes 6+ minutes from when I start the |
@beck3905 Can you please share a sample tag similar to what you are using, 6+ minutes on OSX is still too long and we should address it. I want to test with your tag once. Thanks |
@c2tarun These are similar to the tags entry in my samconfig.toml. In particular, the
|
I went back to version 0.41.0, which was the last version before any of the regex stuff was added and everything is working great and quick with that version. |
@c2tarun Any updates on this? I'm still stuck using v 0.41.0 until this gets addressed. |
Hey @beck3905 , sorry and thanks a lot for your patience. This fell off my radar. I can confirm that I am able to reproduce issue with I am re-opening this issue. Interestingly |
Hello @beck3905, I was able to merge a fix for this issue yesterday. I don't have exact release date yet, but when we'll do next release you should be able to upgrade. I'll leave this issue open, until that happens. |
Hello @beck3905, we have released fix for this issue in our release 1.1.0. Can you please confirm once if this works for you? Thanks |
Closing this issue, please re-open if this still an issue. |
Hello I have an issue with --tags parameter. In OS X sam deploy works well but not using docker images like python-3.8.8-alpine-3.13 Execute this command: sam deploy --template-file ./templates/${CI_ENVIRONMENT_NAME}/package.yaml --stack-name AWSConfigEventListener --capabilities CAPABILITY_IAM --no-confirm-changeset --s3-bucket ${BUCKET_NAME} --region $AWS_REGION --tags $TAGS
Usage: sam deploy [OPTIONS]
Try 'sam deploy -h' for help.
Error: Invalid value for '--tags': ('ambiente=staging', 'pais=cl', 'ceco=cgo1007324', 'cuenta=xxxxxxx', 'proyecto="Plataformas', 'TxD"', 'aplicacion="DevOps', 'Tools"', 'nombre=AWSConfigEventListener', 'Name=AWSConfigEventListener', '[email protected]', 'tribe="Arquitectura', 'y', 'Plataforma"', 'epm=opex', 'ApplicationName="Plataformas', 'TxD"', 'BusinessUnit=SHARED') is not in valid format. It must look something like 'KeyName1=string KeyName2=string' where the $TAGS are: ambiente=staging pais=cl ceco=cgo1007324 cuenta=xxxxxxxxx proyecto="Plataformas TxD" aplicacion="DevOps Tools" nombre=AWSConfigEventListener Name=AWSConfigEventListener [email protected] tribe="Arquitectura y Plataforma" epm=opex ApplicationName="Plataformas TxD" BusinessUnit=SHARED Is there a workaround to solve this ? Thanks in advance |
Description:
The
sam deploy
command hangs if a tag with a long value (approx 30+ characters long) is provided. Tested on SAM CLI v0.43.0.Steps to reproduce the issue:
sam deploy --stack-name test --tags key=012345678901234567890123456789
Observed result:
The command hangs and does not produce any output.
Expected result:
However, if a shorter tag value is provided (e.g.
sam deploy --stack-name test --tags key=01234567890123456789
) then the correct output gets printed.The text was updated successfully, but these errors were encountered: