Erpnext: AWS RDS new-site error

Created on 22 Nov 2018  路  4Comments  路  Source: frappe/erpnext

AWS RDS does not allow GRANT SUPER privilege so the GRANT ALL does not work when creating new site.

When run sudo bench new-site erpnext the following error shows up.

Is there anyway to work around this issue? I'm thinking install the new site on local Database then copy the database to RDS, then change Strappe to point to new DB?

  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 72, in create_database_and_user
    dbman.grant_all_privileges(db_name, db_name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py", line 538, in grant_all_privileges
    user, host))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 176, in sql
    self._cursor.execute(query)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 516, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 727, in _read_query_result
    result.read()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1066, in read
    first_packet = self.connection._read_packet()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 683, in _read_packet
    packet.check_error()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1044, u"Access denied for user 'root'@'%' to database '76cf18db07302d32'")
to validate

Most helpful comment

Hi @Olawale1,

RDS is just a normal database running on a different server, so there are only a few things to do:

  1. Configure the database parameters according to Frappe's requirements (depends on the mariadb version and can be found in the easy install script or in several posts on the forum).
  2. Add the db_host parameter in site_config.json with the address of your rds instance.

That's all!

All 4 comments

Hi @berniezhao11,

We are using RDS for our ERPNext instances and never faced this issue.

On which version are you ?

In any case, you should never use sudo to create a new site. If that's the case you have an overall problem with your frappe bench folder permissions in Linux that should be resolved first.

Will request you to post this query on https://discuss.erpnext.com. If this bug is validated, then we can reopen issue.

Hi @chdecultot

Could you please give some insight into how you set this up? I actually posted this request on the forum:

https://discuss.erpnext.com/t/how-to-use-aws-rds-for-erpnext/43258

Thanks

Hi @Olawale1,

RDS is just a normal database running on a different server, so there are only a few things to do:

  1. Configure the database parameters according to Frappe's requirements (depends on the mariadb version and can be found in the easy install script or in several posts on the forum).
  2. Add the db_host parameter in site_config.json with the address of your rds instance.

That's all!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heyakyra picture heyakyra  路  4Comments

deantheiceman picture deantheiceman  路  4Comments

giuseppelamatrice picture giuseppelamatrice  路  3Comments

GSLabIt picture GSLabIt  路  4Comments

setsero71 picture setsero71  路  3Comments