-
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 refresh #5109
Comments
Hi @simoroma, could you provide more details and steps for us to reproduce the issue? You can also run it with the |
Thanks for the reply. This issue happens if I just do the following:
The deployment works, but on the terminal it gets stuck here:
|
So far I get outputs only when it rolls back. |
Hello @simoroma, |
Thanks @moelasmar sam deploy -g --debug --profile simone-anton
2023-05-26 10:03:40,624 | Config file location: /home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/samconfig.toml
2023-05-26 10:03:40,628 | Loading configuration values from [default.['deploy'].parameters] (env.command_name.section) in config file at
'/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/samconfig.toml'...
2023-05-26 10:03:40,640 | Configuration values successfully loaded.
2023-05-26 10:03:40,642 | Configuration values are: {'stack_name': 'sam-classification-segmentation-nuxt', 'capabilities': 'CAPABILITY_IAM',
'confirm_changeset': True, 'resolve_s3': True, 's3_prefix': 'sam-classification-segmentation-nuxt', 'region': 'us-east-1', 'profile':
'simone-anton', 'image_repositories': []}
2023-05-26 10:03:40,660 | Using SAM Template at
/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/.aws-sam/build/template.yaml
2023-05-26 10:03:40,749 | Using config file: samconfig.toml, config environment: default
2023-05-26 10:03:40,751 | Expand command line arguments to:
2023-05-26 10:03:40,753 | --guided
--template_file=/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/.aws-sam/build/template.yaml --fail_on_empty_changeset
--confirm_changeset --on_failure=ROLLBACK --stack_name=sam-classification-segmentation-nuxt --s3_prefix=sam-classification-segmentation-nuxt
--resolve_s3 --capabilities=['CAPABILITY_IAM']
2023-05-26 10:03:41,089 | There is no customer defined id or cdk path defined for resource ServerlessRestApiClassSegNuxt, so we will use the
resource logical id as the resource id
2023-05-26 10:03:41,090 | There is no customer defined id or cdk path defined for resource ApiKeyClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:03:41,092 | There is no customer defined id or cdk path defined for resource ApiUsagePlanClassSegNuxt, so we will use the
resource logical id as the resource id
2023-05-26 10:03:41,093 | There is no customer defined id or cdk path defined for resource ApiUsagePlanKeyClassSegNuxt, so we will use the
resource logical id as the resource id
2023-05-26 10:03:41,095 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
Configuring SAM deploy
======================
Looking for config file [samconfig.toml] : Found
Reading default arguments : Success
Setting default arguments for 'sam deploy'
=========================================
Stack Name [sam-classification-segmentation-nuxt]:
AWS Region [us-east-1]:
2023-05-26 10:04:03,468 | No Parameters detected in the template
2023-05-26 10:04:03,528 | There is no customer defined id or cdk path defined for resource ServerlessRestApiClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:03,529 | There is no customer defined id or cdk path defined for resource ApiKeyClassSegNuxt, so we will use the resource logical id as
the resource id
2023-05-26 10:04:03,531 | There is no customer defined id or cdk path defined for resource ApiUsagePlanClassSegNuxt, so we will use the resource logical
id as the resource id
2023-05-26 10:04:03,536 | There is no customer defined id or cdk path defined for resource ApiUsagePlanKeyClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:03,537 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:03,542 | 0 stacks found in the template
#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
Confirm changes before deploy [Y/n]:
#SAM needs permission to be able to create roles to connect to the resources in your template
Allow SAM CLI IAM role creation [Y/n]:
#Preserves the state of previously provisioned resources when an operation fails
Disable rollback [y/N]:
2023-05-26 10:04:16,206 | No Parameters detected in the template
2023-05-26 10:04:16,240 | There is no customer defined id or cdk path defined for resource ServerlessRestApiClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:16,241 | There is no customer defined id or cdk path defined for resource ApiKeyClassSegNuxt, so we will use the resource logical id as
the resource id
2023-05-26 10:04:16,242 | There is no customer defined id or cdk path defined for resource ApiUsagePlanClassSegNuxt, so we will use the resource logical
id as the resource id
2023-05-26 10:04:16,243 | There is no customer defined id or cdk path defined for resource ApiUsagePlanKeyClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:16,247 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:16,251 | 5 resources found in the stack
2023-05-26 10:04:16,254 | Found Serverless function with name='ClassificationSegmentationNuxtFunction' and
CodeUri='ClassificationSegmentationNuxtFunction'
2023-05-26 10:04:16,258 | --base-dir is not presented, adjusting uri ClassificationSegmentationNuxtFunction relative to
/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/.aws-sam/build/template.yaml
2023-05-26 10:04:16,262 | 5 resources found in the stack
2023-05-26 10:04:16,265 | Found Serverless function with name='ClassificationSegmentationNuxtFunction' and
CodeUri='ClassificationSegmentationNuxtFunction'
2023-05-26 10:04:16,267 | --base-dir is not presented, adjusting uri ClassificationSegmentationNuxtFunction relative to
/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/.aws-sam/build/template.yaml
2023-05-26 10:04:16,271 | No function or layer definition found with code sign config, skipping
Save arguments to configuration file [Y/n]:
SAM configuration file [samconfig.toml]:
SAM configuration environment [default]:
Looking for resources needed for deployment:
Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-1pu320hh8k89o
A different default S3 bucket can be set in samconfig.toml and auto resolution of buckets turned off by setting resolve_s3=False
2023-05-26 10:04:23,314 | 5 resources found in the stack
2023-05-26 10:04:23,315 | Found Serverless function with name='ClassificationSegmentationNuxtFunction' and
CodeUri='ClassificationSegmentationNuxtFunction'
2023-05-26 10:04:23,317 | --base-dir is not presented, adjusting uri ClassificationSegmentationNuxtFunction relative to
/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/.aws-sam/build/template.yaml
2023-05-26 10:04:24,455 |
Parameter "stack_name=sam-classification-segmentation-nuxt" in [default.deploy.parameters] is defined as a global parameter
[default.global.parameters].
This parameter will be only saved under [default.global.parameters] in
/home/ialuronico/projects/anton/sam-classification-segmentation-nuxt/samconfig.toml.
Saved arguments to config file
Running 'sam deploy' for future deployments will use the parameters saved above.
The above parameters can be changed by modifying samconfig.toml
Learn more about samconfig.toml syntax at
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html
2023-05-26 10:04:24,484 | No Parameters detected in the template
2023-05-26 10:04:24,517 | There is no customer defined id or cdk path defined for resource ServerlessRestApiClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:24,518 | There is no customer defined id or cdk path defined for resource ApiKeyClassSegNuxt, so we will use the resource logical id as
the resource id
2023-05-26 10:04:24,521 | There is no customer defined id or cdk path defined for resource ApiUsagePlanClassSegNuxt, so we will use the resource logical
id as the resource id
2023-05-26 10:04:24,528 | There is no customer defined id or cdk path defined for resource ApiUsagePlanKeyClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:24,530 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:24,533 | 0 stacks found in the template
2023-05-26 10:04:24,535 | No Parameters detected in the template
2023-05-26 10:04:24,583 | There is no customer defined id or cdk path defined for resource ServerlessRestApiClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:24,584 | There is no customer defined id or cdk path defined for resource ApiKeyClassSegNuxt, so we will use the resource logical id as
the resource id
2023-05-26 10:04:24,585 | There is no customer defined id or cdk path defined for resource ApiUsagePlanClassSegNuxt, so we will use the resource logical
id as the resource id
2023-05-26 10:04:24,588 | There is no customer defined id or cdk path defined for resource ApiUsagePlanKeyClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:24,591 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:24,637 | There is no customer defined id or cdk path defined for resource ServerlessRestApiClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:24,640 | There is no customer defined id or cdk path defined for resource ApiKeyClassSegNuxt, so we will use the resource logical id as
the resource id
2023-05-26 10:04:24,647 | There is no customer defined id or cdk path defined for resource ApiUsagePlanClassSegNuxt, so we will use the resource logical
id as the resource id
2023-05-26 10:04:24,648 | There is no customer defined id or cdk path defined for resource ApiUsagePlanKeyClassSegNuxt, so we will use the resource
logical id as the resource id
2023-05-26 10:04:24,650 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:24,652 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ServerlessRestApiClassSegNuxt is
ServerlessRestApiClassSegNuxt
2023-05-26 10:04:24,656 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiKeyClassSegNuxt is
ApiKeyClassSegNuxt
2023-05-26 10:04:24,659 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiUsagePlanClassSegNuxt is
ApiUsagePlanClassSegNuxt
2023-05-26 10:04:24,662 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiUsagePlanKeyClassSegNuxt is
ApiUsagePlanKeyClassSegNuxt
2023-05-26 10:04:24,664 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
Uploading to sam-classification-segmentation-nuxt/e67afbdf1b8dc6880849c8971b35f116 26086836 / 26086836 (100.00%)
Deploying with following values
===============================
Stack name : sam-classification-segmentation-nuxt
Region : us-east-1
Confirm changeset : True
Disable rollback : False
Deployment s3 bucket : aws-sam-cli-managed-default-samclisourcebucket-1pu320hh8k89o
Capabilities : ["CAPABILITY_IAM"]
Parameter overrides : {}
Signing Profiles : {}
Initiating deployment
=====================
2023-05-26 10:04:33,887 | No Parameters detected in the template
2023-05-26 10:04:33,914 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ServerlessRestApiClassSegNuxt is
ServerlessRestApiClassSegNuxt
2023-05-26 10:04:33,916 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiKeyClassSegNuxt is
ApiKeyClassSegNuxt
2023-05-26 10:04:33,918 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiUsagePlanClassSegNuxt is
ApiUsagePlanClassSegNuxt
2023-05-26 10:04:33,922 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiUsagePlanKeyClassSegNuxt is
ApiUsagePlanKeyClassSegNuxt
2023-05-26 10:04:33,925 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:33,927 | 0 stacks found in the template
2023-05-26 10:04:33,929 | No Parameters detected in the template
2023-05-26 10:04:33,963 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ServerlessRestApiClassSegNuxt is
ServerlessRestApiClassSegNuxt
2023-05-26 10:04:33,965 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiKeyClassSegNuxt is
ApiKeyClassSegNuxt
2023-05-26 10:04:33,967 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiUsagePlanClassSegNuxt is
ApiUsagePlanClassSegNuxt
2023-05-26 10:04:33,970 | Sam customer defined id is more priority than other IDs. Customer defined id for resource ApiUsagePlanKeyClassSegNuxt is
ApiUsagePlanKeyClassSegNuxt
2023-05-26 10:04:33,973 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
ClassificationSegmentationNuxtFunction is ClassificationSegmentationNuxtFunction
2023-05-26 10:04:33,979 | 5 resources found in the stack
Uploading to sam-classification-segmentation-nuxt/e535f5675fbf9b5b924409c88c91e5bb.template 3529 / 3529 (100.00%)
Waiting for changeset to be created..
CloudFormation stack changeset
-----------------------------------------------------------------------------------------------------------------------------------------
Operation LogicalResourceId ResourceType Replacement
-----------------------------------------------------------------------------------------------------------------------------------------
* Modify ClassificationSegmentationNuxtFu AWS::Lambda::Function False
nction
* Modify ServerlessRestApiClassSegNuxt AWS::ApiGateway::RestApi False
-----------------------------------------------------------------------------------------------------------------------------------------
Changeset created successfully. arn:aws:cloudformation:us-east-1:646854631039:changeSet/samcli-deploy1685084674/23b9ea22-c159-4a37-ad08-d12b51306341
Previewing CloudFormation changeset before deployment
======================================================
Deploy this changeset? [y/N]: y
2023-05-26 10:04:56 - Waiting for stack create/update to complete
CloudFormation events from stack operations (refresh every 5.0 seconds)
-----------------------------------------------------------------------------------------------------------------------------------------
ResourceStatus ResourceType LogicalResourceId ResourceStatusReason
----------------------------------------------------------------------------------------------------------------------------------------- And this is what I get on the console: I also updated SAM,
|
so it seems the stack got updated successfully, but there is no update in SAM CLI logs. |
Thanks. Nothing happens even if I leave it for long. Just sometimes I got
results. But it was long ago. And I recall having results only for
rollbacks.
It happens for all repos. Even if I take the Python hello world example.
…On Fri, May 26, 2023, 9:08 PM Mohamed Elasmar ***@***.***> wrote:
so it seems the stack got updated successfully, but there is no update in
SAM CLI logs.
Do you receive any exception if you left it for longer time??
Also, Please share your template, and if you can share your project in
some Github repository, it will be really helpful.
—
Reply to this email directly, view it on GitHub
<#5109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJG6WKC72DXLFL6JFAIY5J3XIDWQPANCNFSM6AAAAAAXVM5BZE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok, thanks @simoroma for raising this issue. We will try to investigate this issue and update you. |
Hello @simoroma, are you using |
I am using sam with WSL2. I use Visual Studio Code and connect to the terminal though that. |
just to confirm, is SAM CLI run inside the container, or you mean that you are using WSL2 Docker to run the Lambda emulators locally? |
Hm I am not using Docker. I run SAM in a WSL terminal through the VSC
extension remote development
https://code.visualstudio.com/docs/remote/remote-overview
…On Mon, May 29, 2023, 8:08 PM Mohamed Elasmar ***@***.***> wrote:
just to confirm, is SAM CLI run inside the container, or you mean that you
are using WSL2 Docker to run the Lambda emulators locally?
—
Reply to this email directly, view it on GitHub
<#5109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJG6WKCTZLBZW3MYZ6K36W3XITJ2BANCNFSM6AAAAAAXVM5BZE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok got it, you are running SAM remotely in WSL2 environment. Can I ask you to try |
Unfortunately still the same. I also tried with another project. Everything goes well but it gets stuck at the results. |
Hi, sorry about the delay in response. I am unable to replicate the same behaviour in WSL2 using VSCode's remote functionality to connect to the local WSL2 install from my Windows 10 install. This was tested with version 1.88.0 installed via the Linux zip file noted in our install guide. Are you still experiencing this problem with the latest version of SAM CLI? |
No worries. Thanks for the help anyway. Yes still the same issue unfortunately with 1.88.0. To install it I use It is weird because at deployment time it gets stuck waiting for results. Though, if I cancel the Cloudformation job sometimes I get some output with SAM too. |
Thanks @simoroma for your response, two more points we need to check:
|
Hi @moelasmar Unfortunately, still same issues. I don't recall having a version of SAM working. I had a previous installation of SAM through the procedure from the docs. Nonetheless, in my conda environments I was always installing SAM through pip. Anyway, I uninstalled it and installed 1.89.00 with the docs' procedure. It still does not show a output. It is so weird that just sometimes I see the output. I recall seeing it when I cancel the deployment. But just sometimes. |
Hello @simoroma, |
Sure! However, I am going to be available after the middle of July. Could you write me an email at [email protected] so that we can schedule the call? Thanks again. |
I have to type CTRL+C to Abort because the output does not change anymore. The AWS Console shows |
Same issue here
|
thanks @simoroma for checking it. aws-sam-cli/samcli/lib/deploy/deployer.py Lines 395 to 408 in 8091b8a
I added more logs to know why the code is stucking in this loop, please use the artifacts created here and rerun the deploy command again and share the logs with us. could you also set the environment variable |
I ran |
isn't that "else" badly indented? |
@simoroma, the following snippet is from the logs you sent
The problem is aws-sam-cli/samcli/lib/deploy/deployer.py Line 491 in 3952ff6
so I believe the problem is the time in WSL is not in sync with the actual time, and it is after it by around 3 mins, and this cause that SAM CLI stucks. Regarding why things got rollback, it is still not clear from the logs why it is rolling back, but may be after we fix the first problem, we can find more logs to get the second problem. |
No |
@moelasmar Good catch! Now the SAM terminates! Don't worry about the roll backs. I haven't set up roles properly. I had this issue also when Cloud Formation stacks completed correctly. |
Thanks @simoroma, I will try to see if my change will not impact other usages, and commit to SAM CLI. |
Draft PR in the works: #5852 |
I am getting the same problem as @simoroma, is there a possibility that a new update broke it again? I have already tried to remove SAM completely and reinstall it, but i have had no success so far. |
Patch is released in v1.100.0. Closing |
SAM deploy does not show if Cloudformation completes
Description:
sam deploy --guided
gets stuck. It does not refresh.The text was updated successfully, but these errors were encountered: