I am trying to migrate my Web2Py app from Heroku to AWS Lambda, using Zappa. I can get it to start running, but I'm running into errors because web2py is trying to write to the filesystem. I commented out
create_missing_app_folders() and create_missing_folders() from gluon/main.py, however, now I'm getting stuck with the DB trying to create tables. [ERROR] 2018-09-08T07:05:35.270Z 905ef1e6-b335-11e8-816d-07b31200db80 Traceback (most recent call last): File "/var/task/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/var/task/applications/ads/models/db.py", line 72, in <module> session.connect(request, response, db=db) File "C:\web2py\gluon\globals.py", line 946, in connect File "/var/task/gluon/packages/dal/pydal/base.py", line 587, in define_table table = self.lazy_define_table(tablename, *fields, **args) File "/var/task/gluon/packages/dal/pydal/base.py", line 621, in lazy_define_table polymodel=polymodel) File "/var/task/gluon/packages/dal/pydal/adapters/base.py", line 797, in create_table return self.migrator.create_table(*args, **kwargs) File "/var/task/gluon/packages/dal/pydal/migrator.py", line 275, in create_table query), table) File "/var/task/gluon/packages/dal/pydal/migrator.py", line 483, in log logfile = self.file_open(table._loggername, 'ab') File "/var/task/gluon/packages/dal/pydal/migrator.py", line 491, in file_open fileobj = portalocker.LockedFile(filename, mode) File "C:\web2py\gluon\packages\dal\pydal\contrib\portalocker.py", line 185, in __init__ File "C:\web2py\gluon\packages\dal\pydal\contrib\portalocker.py", line 170, in open_file IOError: [Errno 2] No such file or directory: '/var/task/applications/ads/databases/sql.log' Is this a never-ending rabbit hole or is there a way to tell web2py that it cannot write to the filesystem. I tried global_setttings.web2py_runtime_gae=True but that causes a bunch of other problems because GAE resources are not present. I'd love to get this on AWS Lambda because my application can have temporary 1000x spikes in traffic and Serverless lets me handle this without ops and without paying for idle server time in the evenings. If I can get this working I will post a deployment recipe. Thanks, -Mike -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

