Here is how I set up my db to work with RDS.
Note: res-combined-ca-bundle.pem is the public key for RDS found here:
https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem.
driver_args = { 'ssl':{ 'ca':
'applications/ads/private/ssl/rds-combined-ca-bundle.pem'} }
db_auth =
'mysql://username:[email protected]:3306/mydbname'
if settings.aws_lambda:
from gluon.dal import InDBMigrator
adapter_args = dict(migrator=InDBMigrator)
pool_size = 0
else:
adapter_args = dict()
pool_size = 8
db = DAL(db_auth,
pool_size=pool_size,
migrate_enabled=False,
migrate = False,
adapter_args=adapter_args,
lazy_tables=True,
driver_args = driver_args,
fake_migrate=True )
On Tuesday, September 17, 2019 at 7:24:03 AM UTC-5, Jaime Sempere wrote:
>
> Hi Mike,
>
> I've been following your recipe, but I have an 'read-only file system
> issue' (I think is due that I did not set up a database and web2py is
> trying to create the datatables files)
>
>
> So, can you give me some clues about it? Also, how should i set up and
> configure my rds to work with web2py? I have not noticed anything about it
> on the recipe.
>
> Check my log error from Zappa:
>
> [1568721920013] [ERROR] 2019-09-17T12:05:20.12Z
> 75fc21f1-e92e-4c80-ada1-a3e042112bf3 Traceback (most recent call last):
> File "/var/task/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
> File "/var/task/applications/zerca_maps/models/db.py", line 179, in
> <module>
> Field('registered', 'boolean', default=False),
> File "/var/task/gluon/packages/dal/pydal/base.py", line 590, in
> define_table
> table = self.lazy_define_table(tablename, *fields, **kwargs)
> File "/var/task/gluon/packages/dal/pydal/base.py", line 624, in
> lazy_define_table
> polymodel=polymodel)
> File "/var/task/gluon/packages/dal/pydal/adapters/base.py", line 798, in
> create_table
> return self.migrator.create_table(*args, **kwargs)
> File "/var/task/gluon/packages/dal/pydal/migrator.py", line 318, in
> create_table
> fake_migrate=fake_migrate
> File "/var/task/gluon/packages/dal/pydal/migrator.py", line 463, in
> migrate_table
> self.save_dbt(table, sql_fields_current)
> File "/var/task/gluon/packages/dal/pydal/migrator.py", line 472, in
> save_dbt
> tfile = self.file_open(table._dbt, 'wb')
> File "/var/task/gluon/packages/dal/pydal/migrator.py", line 495, in
> file_open
> fileobj = portalocker.LockedFile(filename, mode)
> File "/var/task/gluon/packages/dal/pydal/contrib/portalocker.py", line
> 185, in __init__
> self.file = open_file(filename, mode.replace('w', 'a'))
> File "/var/task/gluon/packages/dal/pydal/contrib/portalocker.py", line
> 170, in open_file
> f = open(filename, mode)
> IOError: [Errno 30] Read-only file system:
> '/var/task/applications/zerca_maps/databases/c
> *8b669d15150d7109e5f7ab36744a5b7_retailers.table*'
>
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/b59803be-a852-4588-be71-aae20de9d339%40googlegroups.com.