Bug: sam local invoke - OSError #5480
Labels
area/local/invoke
sam local invoke command
blocked/close-if-inactive
Blocked for >14 days with no response, will be closed if still inactive after 7 days
blocked/more-info-needed
More info is needed from the requester. If no response in 14 days, it will become stale.
Description:
I am trying to locally invoke a lambda at the time of building image, I'm getting this Error. Recently I upgraded aws-sam-cli, after that only this type of error I'm getting, please help me.
Steps to reproduce:
This is the command, I'm using to invoke the lambda:
sam local invoke lambda_function -e invoke/payload.json
Observed result:
Local image was not found.
Building image...
Error: [Errno 5] Input/output error
Traceback:
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/decorators.py", line 93, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/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.90.0/libexec/lib/python3.11/site-packages/samcli/lib/telemetry/metric.py", line 149, in wrapped
return_value = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/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.90.0/libexec/lib/python3.11/site-packages/samcli/cli/main.py", line 95, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/commands/local/invoke/cli.py", line 100, in cli
do_cli(
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/commands/local/invoke/cli.py", line 206, in do_cli
context.local_lambda_runner.invoke(
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/commands/local/lib/local_lambda.py", line 144, in invoke
self.local_runtime.invoke(
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/lib/telemetry/metric.py", line 324, in wrapped_func
return_value = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/local/lambdafn/runtime.py", line 189, in invoke
container = self.create(function_config, debug_context, container_host, container_host_interface)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/local/lambdafn/runtime.py", line 85, in create
container = LambdaContainer(
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/local/docker/lambda_container.py", line 94, in init
image = LambdaContainer._get_image(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/local/docker/lambda_container.py", line 237, in _get_image
return lambda_image.build(runtime, packagetype, image, layers, architecture, function_name=function_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/local/docker/lambda_image.py", line 231, in build
self._build_image(
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/local/docker/lambda_image.py", line 328, in _build_image
with create_tarball(tar_paths, tar_filter=tar_filter) as tarballfile:
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in enter
return next(self.gen)
^^^^^^^^^^^^^^
File "/usr/local/Cellar/aws-sam-cli/1.90.0/libexec/lib/python3.11/site-packages/samcli/lib/utils/tar.py", line 34, in create_tarball
archive.add(path_on_system, arcname=path_in_tarball, filter=tar_filter)
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 2179, in add
self.add(os.path.join(name, f), os.path.join(arcname, f),
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 2179, in add
self.add(os.path.join(name, f), os.path.join(arcname, f),
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 2179, in add
self.add(os.path.join(name, f), os.path.join(arcname, f),
[Previous line repeated 1 more time]
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 2173, in add
self.addfile(tarinfo, f)
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 2201, in addfile
copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize)
File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tarfile.py", line 252, in copyfileobj
buf = src.read(bufsize)
^^^^^^^^^^^^^^^^^
Expected result:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.90.0The text was updated successfully, but these errors were encountered: