2

My API was working perfectly fine with AWS lambda using Zappa. But I need spacy for my code to run. The moment I install spacy==2.0.13 and update the zappa dev , the api stops working. It gives 502 error. Kindly help me regarding this. I have already increased the memory size to 3008.

Following is returned as the response body:

{'message': 'An uncaught exception happened while servicing this request. You can investigate this with the zappa tail command.', 'traceback': ['Traceback (most recent call last):\\n', '  File \"/var/task/handler.py\", line 531, in handler\\n    with Response.from_app(self.wsgi_app, environ) as response:\\n', '  File \"/var/task/werkzeug/wrappers/base_response.py\", line 287, in from_app\\n    return cls(*_run_wsgi_app(app, environ, buffered))\\n', '  File \"/var/task/werkzeug/wrappers/base_response.py\", line 26, in _run_wsgi_app\\n    return _run_wsgi_app(*args)\\n', '  File \"/var/task/werkzeug/test.py\", line 1119, in run_wsgi_app\\n    app_rv = app(environ, start_response)\\n', \"TypeError: 'NoneType' object is not callable\\n\"]}

Log from Zappa tail :

File "/var/task/handler.py", line 602, in lambda_handler
 return LambdaHandler.lambda_handler(event, context)
 File "/var/task/handler.py", line 245, in lambda_handler
 handler = cls()
 File "/var/task/handler.py", line 102, in __init__
 self.load_remote_project_archive(project_archive_path)
 File "/var/task/handler.py", line 174, in load_remote_project_archive
 t.extractall(project_folder)
 File "/var/lang/lib/python3.6/tarfile.py", line 2010, in extractall
 numeric_owner=numeric_owner)
 File "/var/lang/lib/python3.6/tarfile.py", line 2052, in extract
 numeric_owner=numeric_owner)
 File "/var/lang/lib/python3.6/tarfile.py", line 2122, in _extract_member
 self.makefile(tarinfo, targetpath)
 File "/var/lang/lib/python3.6/tarfile.py", line 2171, in makefile
 copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
 File "/var/lang/lib/python3.6/tarfile.py", line 252, in copyfileobj
 dst.write(buf)

Log from Cloudwatch Console:

[Errno 28] No space left on device: OSError
Traceback (most recent call last):
 File "/var/task/handler.py", line 602, in lambda_handler
   return LambdaHandler.lambda_handler(event, context)
 File "/var/task/handler.py", line 245, in lambda_handler
   handler = cls()
 File "/var/task/handler.py", line 102, in __init__
   self.load_remote_project_archive(project_archive_path)
 File "/var/task/handler.py", line 174, in load_remote_project_archive
   t.extractall(project_folder)
 File "/var/lang/lib/python3.6/tarfile.py", line 2010, in extractall
   numeric_owner=numeric_owner)
 File "/var/lang/lib/python3.6/tarfile.py", line 2052, in extract
   numeric_owner=numeric_owner)
 File "/var/lang/lib/python3.6/tarfile.py", line 2122, in _extract_member
   self.makefile(tarinfo, targetpath)
 File "/var/lang/lib/python3.6/tarfile.py", line 2171, in makefile
   copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
 File "/var/lang/lib/python3.6/tarfile.py", line 252, in copyfileobj
   dst.write(buf)
OSError: [Errno 28] No space left on device
Niladri Paul
  • 101
  • 2
  • 11

1 Answers1

1

Your error is that there is no space left on the lambda function. SpaCy requires quite a lot of space. Therefore, follow the following suggestions:

AWS Lambda No Space Left on Device error

Rene B.
  • 6,557
  • 7
  • 46
  • 72