MemoryError when creating lambda layer on cloud9

0

Debug log below:

ec2-user:~/environment/packaging $ aws lambda publish-layer-version --layer-name scraper  --zip-file fileb://lambda_layer.zip --compatible-runtimes python3.9 --debug
2023-02-05 14:20:32,951 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.19.112 Python/2.7.18 Linux/4.14.301-224.520.amzn2.x86_64 botocore/1.20.112
2023-02-05 14:20:32,952 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['lambda', 'publish-layer-version', '--layer-name', 'scraper', '--zip-file', 'fileb://lambda_layer.zip', '--compatible-runtimes', 'python3.9', '--debug']
2023-02-05 14:20:32,953 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x7fc97a14a1d0>
2023-02-05 14:20:32,953 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x7fc97b0356d0>
2023-02-05 14:20:32,954 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x7fc97b01ba50>
2023-02-05 14:20:32,955 - MainThread - botocore.utils - DEBUG - IMDS ENDPOINT: http://169.254.169.254/
2023-02-05 14:20:32,957 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x7fc97f17e0d0>
2023-02-05 14:20:32,963 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/site-packages/botocore/data/lambda/2015-03-31/service-2.json
2023-02-05 14:20:32,989 - MainThread - botocore.hooks - DEBUG - Event building-command-table.lambda: calling handler <function add_waiters at 0x7fc97a1570d0>
2023-02-05 14:20:32,997 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/site-packages/botocore/data/lambda/2015-03-31/waiters-2.json
2023-02-05 14:20:33,000 - MainThread - awscli.clidriver - DEBUG - OrderedDict([(u'layer-name', <awscli.arguments.CLIArgument object at 0x7fc979dab8d0>), (u'description', <awscli.arguments.CLIArgument object at 0x7fc979dab850>), (u'content', <awscli.arguments.CLIArgument object at 0x7fc979dab810>), (u'compatible-runtimes', <awscli.arguments.ListArgument object at 0x7fc979dab7d0>), (u'license-info', <awscli.arguments.CLIArgument object at 0x7fc979dab9d0>)])
2023-02-05 14:20:33,001 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.lambda.publish-layer-version: calling handler <function add_streaming_output_arg at 0x7fc97a14e9d0>
2023-02-05 14:20:33,001 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.lambda.publish-layer-version: calling handler <bound method ZipFileArgumentHoister.hoist of <awscli.customizations.awslambda.ZipFileArgumentHoister object at 0x7fc97a1224d0>>
2023-02-05 14:20:33,076 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.lambda.publish-layer-version: calling handler <function add_cli_input_json at 0x7fc97b021f50>
2023-02-05 14:20:33,077 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.lambda.publish-layer-version: calling handler <function unify_paging_params at 0x7fc97a1c7e50>
2023-02-05 14:20:33,088 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/site-packages/botocore/data/lambda/2015-03-31/paginators-1.json
2023-02-05 14:20:33,089 - MainThread - botocore.hooks - DEBUG - Event building-argument-table.lambda.publish-layer-version: calling handler <function add_generate_skeleton at 0x7fc97f125150>
2023-02-05 14:20:33,090 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.lambda.publish-layer-version: calling handler <bound method CliInputJSONArgument.override_required_args of <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x7fc979dab810>>
2023-02-05 14:20:33,090 - MainThread - botocore.hooks - DEBUG - Event before-building-argument-table-parser.lambda.publish-layer-version: calling handler <bound method GenerateCliSkeletonArgument.override_required_args of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7fc97a077d90>>
2023-02-05 14:20:33,093 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.layer-name: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,094 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.lambda.publish-layer-version: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fc97aff2bd0>
2023-02-05 14:20:33,094 - MainThread - awscli.arguments - DEBUG - Unpacked value of u'scraper' for parameter "layer_name": u'scraper'
2023-02-05 14:20:33,095 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.description: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,096 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.content: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,097 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.compatible-runtimes: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,098 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.lambda.publish-layer-version: calling handler <awscli.argprocess.ParamShorthandParser object at 0x7fc97aff2bd0>
2023-02-05 14:20:33,098 - MainThread - awscli.arguments - DEBUG - Unpacked value of [u'python3.9'] for parameter "compatible_runtimes": [u'python3.9']
2023-02-05 14:20:33,099 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.license-info: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,100 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.zip-file: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,705 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.cli-input-json: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,706 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.lambda.publish-layer-version.generate-cli-skeleton: calling handler <awscli.paramfile.URIArgumentHandler object at 0x7fc97a007c90>
2023-02-05 14:20:33,707 - MainThread - botocore.hooks - DEBUG - Event calling-command.lambda.publish-layer-version: calling handler <bound method CliInputJSONArgument.add_to_call_parameters of <awscli.customizations.cliinputjson.CliInputJSONArgument object at 0x7fc979dab810>>
2023-02-05 14:20:33,708 - MainThread - botocore.hooks - DEBUG - Event calling-command.lambda.publish-layer-version: calling handler <bound method GenerateCliSkeletonArgument.generate_json_skeleton of <awscli.customizations.generatecliskeleton.GenerateCliSkeletonArgument object at 0x7fc97a077d90>>
2023-02-05 14:20:33,709 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2023-02-05 14:20:33,710 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2023-02-05 14:20:33,710 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role-with-web-identity
2023-02-05 14:20:33,711 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: sso
2023-02-05 14:20:33,711 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2023-02-05 14:20:33,712 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2023-02-05 14:20:33,717 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/site-packages/botocore/data/endpoints.json
2023-02-05 14:20:33,779 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x7fc97c4535d0>
2023-02-05 14:20:33,784 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.lambda: calling handler <function add_generate_presigned_url at 0x7fc97c9607d0>
2023-02-05 14:20:33,788 - MainThread - botocore.endpoint - DEBUG - Setting lambda timeout as (60, 60)
2023-02-05 14:20:33,790 - MainThread - botocore.loaders - DEBUG - Loading JSON file: /usr/lib/python2.7/site-packages/botocore/data/_retry.json
2023-02-05 14:20:33,793 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: lambda
2023-02-05 14:20:33,795 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.lambda.PublishLayerVersion: calling handler <function generate_idempotent_uuid at 0x7fc97c455550>
2023-02-05 14:20:35,042 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 218, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 362, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 534, in __call__
    call_parameters, parsed_globals)
  File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 654, in invoke
    client, operation_name, parameters, parsed_globals)
  File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 666, in _make_client_call
    **parameters)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 386, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 678, in _make_api_call
    api_params, operation_model, context=request_context)
  File "/usr/lib/python2.7/site-packages/botocore/client.py", line 726, in _convert_to_request_dict
    api_params, operation_model)
  File "/usr/lib/python2.7/site-packages/botocore/validate.py", line 321, in serialize_to_request
    operation_model)
  File "/usr/lib/python2.7/site-packages/botocore/serialize.py", line 471, in serialize_to_request
    serialized, shape, shape_members)
  File "/usr/lib/python2.7/site-packages/botocore/serialize.py", line 523, in _serialize_payload
    partitioned['body_kwargs'], shape)
  File "/usr/lib/python2.7/site-packages/botocore/serialize.py", line 602, in _serialize_body_params
    return json.dumps(serialized_body).encode(self.DEFAULT_ENCODING)
MemoryError
2023-02-05 14:20:35,067 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

The zip file size is ~74MB, would this be an issue?

asked a year ago95 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions