metadata.json Permission problems when doing sam deploy #3717
Labels
blocked/more-info-needed
More info is needed from the requester. If no response in 14 days, it will become stale.
stage/bug-repro
The issue/bug needs to be reproduced
Description:
I'm getting permission errors for metadata.json file when using sam deploy:
Traceback (most recent call last):
File "/usr/bin/sam", line 8, in
sys.exit(cli())
File "/usr/lib/python3.9/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/samcli/lib/cli_validation/image_repository_validation.py", line 92, in wrapped
return func(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/samcli/lib/telemetry/metric.py", line 151, in wrapped
metric = Metric(metric_name)
File "/usr/lib/python3.9/site-packages/samcli/lib/telemetry/metric.py", line 318, in init
self._add_common_metric_attributes()
File "/usr/lib/python3.9/site-packages/samcli/lib/telemetry/metric.py", line 341, in _add_common_metric_attributes
self._data["installationId"] = self._gc.installation_id
File "/usr/lib/python3.9/site-packages/samcli/cli/global_config.py", line 351, in installation_id
self.set_value(DefaultEntry.INSTALLATION_ID, value)
File "/usr/lib/python3.9/site-packages/samcli/cli/global_config.py", line 273, in set_value
self._set_value(config_entry, value, is_flag, flush)
File "/usr/lib/python3.9/site-packages/samcli/cli/global_config.py", line 294, in _set_value
self._write_config()
File "/usr/lib/python3.9/site-packages/samcli/cli/global_config.py", line 325, in _write_config
self.config_path.write_text(json_str)
File "/usr/lib/python3.9/pathlib.py", line 1275, in write_text
with self.open(mode='w', encoding=encoding, errors=errors) as f:
File "/usr/lib/python3.9/pathlib.py", line 1242, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/usr/lib/python3.9/pathlib.py", line 1110, in _opener
return self._accessor.open(self, flags, mode)
PermissionError: [Errno 13] Permission denied: '/home/samdeploy/.aws-sam/metadata.json'
Steps to reproduce:
we have dotnet core 3.1 lambda function, docker file use alphine 3.13, It is not happen if we aws-sam-cli 1.33.0.
But if we update to aws-sam-cli >= 1.34, it failed with same error:
PermissionError: [Errno 13] Permission denied: '/home/samdeploy/.aws-sam/metadata.json'
For workaround, we force to use
aws-sam-cli==1.33.0
for dotnetcore3.1Recently, we are update dotnetcore3.1 to dotnet 6. In order to build and deploy dotnet 6 lambda function, we must update sam cli to 1.40.1(Alphine updated to 3.14), but not able to deploy due to permission error for metadata.json
Observed result:
Expected result:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.40.1Add --debug flag to command you are running
The text was updated successfully, but these errors were encountered: