Installing a new site in EKS ( aws kubernetes ) is not working with managed aws-mariadb ( aws rds )

Installing a new site in EKS ( aws kubernetes ) is not working with managed aws-mariadb ( aws rds )

  1. we have created a AWS-RDS Mariadb
  2. made it accessable from the kubernetes cluster
  3. I can install erpnext
  4. while adding page, it is showing error.
# as soon as I try to add a page: the kubernets-job is not able to setup the database

## currently I am facing an issue create a site with frappe

Traceback (most recent call last):
File "/home/frappe/frappe-bench/commands/new.py", line 118, in
main()
File "/home/frappe/frappe-bench/commands/new.py", line 70, in main
db_port=db_port,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 72, in _new_site
no_mariadb_socket=no_mariadb_socket,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 106, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py", line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose, no_mariadb_socket=no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 45, in setup_database
raise Exception("Database %s already exists" % (db_name,))
Exception: Database _1815dc08a1d96d5d already exists

# even if I drop the database I still get some errors

Connections OK
Created user _1815dc08a1d96d5d
Created database _1815dc08a1d96d5d
Traceback (most recent call last):
File "/home/frappe/frappe-bench/commands/new.py", line 118, in
main()
File "/home/frappe/frappe-bench/commands/new.py", line 70, in main
db_port=db_port,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 72, in _new_site
no_mariadb_socket=no_mariadb_socket,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 106, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py", line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose, no_mariadb_socket=no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 55, in setup_database
dbman.grant_all_privileges(db_name, db_name)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 53, in grant_all_privileges
self.db.sql("GRANT ALL PRIVILEGES ON %s.* TO '%s'@'%s';" % (target, user, host))
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 153, in sql
self._cursor.execute(query)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1044, "Access denied for user 'root'@'%' to database '_1815dc08a1d96d5d'")

Module

other

Version

ErpNext Version : 13.12.1

nginxImage:
  repository: frappe/erpnext-nginx
  tag: v13.12.1
  pullPolicy: IfNotPresent
  # nginxConfig: |
  #   # custom /etc/nginx/conf.d/default.conf

pythonImage:
  repository: frappe/erpnext-worker
  tag: v13.12.1
  pullPolicy: IfNotPresent

socketIOImage:
  repository: frappe/frappe-socketio
  tag: v13.12.1
  pullPolicy: IfNotPresent

redis:
  image:
    repository: bitnami/redis
    tag: 5.0.10-debian-10-r105
    pullPolicy: IfNotPresent

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

as soon as I try to add a page: the kubernets-job is not able to setup the database

currently I am facing an issue create a site with frappe

Traceback (most recent call last):
File "/home/frappe/frappe-bench/commands/new.py", line 118, in
main()
File "/home/frappe/frappe-bench/commands/new.py", line 70, in main
db_port=db_port,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 72, in _new_site
no_mariadb_socket=no_mariadb_socket,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 106, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py", line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose, no_mariadb_socket=no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 45, in setup_database
raise Exception("Database %s already exists" % (db_name,))
Exception: Database _1815dc08a1d96d5d already exists

even if I drop the database I still get some errors

Connections OK
Created user _1815dc08a1d96d5d
Created database _1815dc08a1d96d5d
Traceback (most recent call last):
File "/home/frappe/frappe-bench/commands/new.py", line 118, in
main()
File "/home/frappe/frappe-bench/commands/new.py", line 70, in main
db_port=db_port,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 72, in _new_site
no_mariadb_socket=no_mariadb_socket,
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 106, in install_db
setup_database(force, source_sql, verbose, no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/init.py", line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose, no_mariadb_socket=no_mariadb_socket)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 55, in setup_database
dbman.grant_all_privileges(db_name, db_name)
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 53, in grant_all_privileges
self.db.sql("GRANT ALL PRIVILEGES ON %s.* TO '%s'@'%s';" % (target, user, host))
File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 153, in sql
self._cursor.execute(query)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1044, "Access denied for user 'root'@'%' to database '_1815dc08a1d96d5d'")

you’ve to edit common_site_config.json for RDS to work

refer this wiki https://github.com/frappe/frappe/wiki/Using-Frappe-with-Amazon-RDS-(or-any-other-DBaaS)

also, refer this on how to edit files in volumes: https://helm.erpnext.com/faq.html#how-do-i-edit-files-and-directories-on-sites-volume

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.