-
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
Bug: aws-sam-cli version 1.80 unable to sync serverless application #5034
Comments
Thanks for opening this issue! I'll try to reproduce this on my side, thanks for providing the versions of SAM CLI you tried. |
Thanks for waiting, I'm not able to reproduce your behaviour where the SAM sync feature in the AWS Toolkit is unable to sync your project. I noticed that in your logs, SAM CLI is installed with homebrew with Python 3.11 references, can you try installing SAM CLI through our tap? This can be done by uninstalling the core version and installing the AWS specific version:
You can double check the tap and package name in our installation docs: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html |
I uninstalled sam and then re-installed from tap. Noticed that the newest
version is now 1.81:
AWS Toolkit was version 1.65-223. Then upgraded to 1.66-223. Error occurred
in both versions.
Same error occurred (screenshot and trace below)
We have a cohort of students across several platforms - Windows, MacOS,
MacOS with M1 chip and all are experiencing this error.
I wonder if it's an issue with our template.yml we are trying to deploy?
Attached
[image: image.png]
Full error trace:
```
Successfully packaged artifacts and wrote output template to file
/var/folders/cj/gmvvcrf964l8_fbr_tjb85s40000gn/T/tmpmq1f4946.
Execute the following command to deploy the packaged template
sam deploy --template-file
/var/folders/cj/gmvvcrf964l8_fbr_tjb85s40000gn/T/tmpmq1f4946 --stack-name
<YOUR STACK NAME>
Template haven't been changed since last deployment, skipping infra sync...
Queuing up code sync for the resources that require an update
Syncing Lambda Function DeleteExpenseFunction...
Syncing Lambda Function RetrieveExpensesByEmailFunction...
Syncing Lambda Function RemoveExpenseItemFromListFunction...
Syncing Lambda Function RetrieveExpenseFunction...
Syncing Lambda Function CreateExpenseListFunction...
Syncing Lambda Function UpdateExpenseFunction...
Syncing Lambda Function CreateExpenseFunction...
Syncing Lambda Function AddExpenseItemToListFunction...
Syncing Lambda Function RetrieveExpenseListsByEmailFunction...
Error: expected str, bytes or os.PathLike object, not NoneType
Traceback:
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/click/core.py",
line 1055, in main
rv = self.invoke(ctx)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/click/core.py",
line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/click/core.py",
line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/click/core.py",
line 760, in invoke
return __callback(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/click/decorators.py",
line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/click/core.py",
line 760, in invoke
return __callback(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py",
line 184, in wrapped
raise exception # pylint: disable=raising-bad-type
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py",
line 149, in wrapped
return_value = func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/event.py",
line 322, in wrapped
raise exception
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/event.py",
line 314, in wrapped
return_value = func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/cli_validation/image_repository_validation.py",
line 92, in wrapped
return func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py",
line 103, in wrapped
return func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/utils/version_checker.py",
line 42, in wrapped
actual_result = func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/cli/main.py",
line 92, in wrapper
return func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/commands/_utils/cdk_support_decorators.py",
line 39, in wrapped
return func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/commands/_utils/command_exception_handler.py",
line 93, in wrapper_command_exception_handler
raise ex
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/commands/_utils/command_exception_handler.py",
line 73, in wrapper_command_exception_handler
return func(*args, **kwargs)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/commands/sync/command.py",
line 212, in cli
do_cli(
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/commands/sync/command.py",
line 411, in do_cli
execute_code_sync(
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/commands/sync/command.py",
line 496, in execute_code_sync
executor.execute()
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/sync_flow_executor.py",
line 192, in execute
self._execute_step(executor, exception_handler)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/sync_flow_executor.py",
line 243, in _execute_step
if self._handle_result(sync_flow_future, exception_handler):
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/sync_flow_executor.py",
line 303, in _handle_result
exception_handler(exception)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/sync_flow_executor.py",
line 104, in default_exception_handler
raise exception
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/sync_flow_executor.py",
line 338, in _sync_flow_execute_wrapper
dependent_sync_flows = sync_flow.execute()
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/sync_flow.py",
line 383, in execute
self.gather_resources()
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/sync/flows/zip_function_sync_flow.py",
line 96, in gather_resources
self._zip_file = make_zip_with_lambda_permissions(zip_file_path,
self._artifact_folder)
File
"/usr/local/Cellar/aws-sam-cli/1.81.0/libexec/lib/python3.8/site-packages/samcli/lib/package/utils.py",
line 258, in make_zip_with_permissions
source_root = os.path.abspath(source_root)
File ***@***.***/3.8.16/Frameworks/Python.framework/Versions/3.8/lib/python3.8/posixpath.py",
line 374, in abspath
path = os.fspath(path)
An unexpected error was encountered while executing "sam sync".
Search for an existing issue:
https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20sync%20-%20TypeError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20sync%20-%20TypeError
```
Process finished with exit code 1
…On Wed, Apr 19, 2023 at 6:50 PM Lucas ***@***.***> wrote:
Thanks for waiting, I'm not able to reproduce your behaviour where the SAM
sync feature in the AWS Toolkit is unable to sync your project.
I noticed that in your logs, SAM CLI is installed with homebrew, can you
try installing SAM CLI through our tap? This can be done by uninstalling
the core version and installing the AWS specific version:
brew uninstall aws-sam-cli
brew install aws/tap/aws-sam-cli
You can double check the tap and package name in our installation docs:
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
<https://urldefense.com/v3/__https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html__;!!BeImMA!4oGTvHc3d47mpuyQjeu5M4MeGiXm7IUDSx_2F9Ng76GysKGnhVBaFuT_504t2gFJ8WBF3W8zen3pvKufV_cS8NldzRaEu8jm46dOCg$>
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/aws/aws-sam-cli/issues/5034*issuecomment-1515479643__;Iw!!BeImMA!4oGTvHc3d47mpuyQjeu5M4MeGiXm7IUDSx_2F9Ng76GysKGnhVBaFuT_504t2gFJ8WBF3W8zen3pvKufV_cS8NldzRaEu8hGQxh3-w$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AUJ7XOEQYQJHHX5MP4DRPNTXCBT3DANCNFSM6AAAAAAXCBH5W4__;!!BeImMA!4oGTvHc3d47mpuyQjeu5M4MeGiXm7IUDSx_2F9Ng76GysKGnhVBaFuT_504t2gFJ8WBF3W8zen3pvKufV_cS8NldzRaEu8iF61pfSg$>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Chi Nguyen-Rettig | SME Software Engineer*
47 S Meridian St, Indianapolis, IN 46204
| kenzie.academy
|
Hi, unfortunately I do not see the image you've attached in the reply. Is there a minimal project that you can provide where we can reproduce this behaviour (or just a template file and steps to reproduce)? |
Thank you so much for helping to chase this down. The image is just same contents as the pasted error. Did the template.yml file attach in last email? On Apr 21, 2023, at 4:12 PM, Lucas ***@***.***> wrote:
Hi, unfortunately I do not see the image you've attached in the reply. Is there a minimal project that you can provide where we can reproduce this behaviour (or just a template file and steps to reproduce)?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Looks like Github scrubs images and attachments from email replies, I don't see anything attached on your original reply |
@cnguyenrettig would you be able to provide a simple template that we can use to re-produce this issue? It seems like |
Pasted template.yml here. I believe it is depending on Application.zip:
|
Thanks for providing the template. For your regular deployment workflow, I assume you are not running |
Closing as this bug has now been fixed and released in version 1.86.0 of the CLI. Should anything new arise, please open a new issue. |
|
Description:
The newest versions of aws-sam-cli are unable to use the sync serverless application with the AWS toolkit.
This was true over versiosn 1.78, 1.79, and 1.80
AWS Toolkit version is: 1.65-223
aws-cli version: tried both:
Steps to reproduce:
Observed result:
Expected result:
Sync Serverless Application to load local changes to functional code to AWS
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS: macOS: 13.2.1 Ventura
sam --version
:SAM CLI, version 1.80.0
AWS region:
us-east-1
(base) Chis-MBP:ata-unit-three-project-cnguyenrettig chinguyen-rettig$ sam --info
{
"version": "1.80.0",
"system": {
"python": "3.11.3",
"os": "macOS-13.2.1-x86_64-i386-64bit"
},
"additional_dependencies": {
"docker_engine": "20.10.21",
"aws_cdk": "Not available",
"terraform": "Not available"
}
}
Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: