Using external cloud PostgreSQL instance

I am using primarily the Frappe_Docker Single Server example:
frappe_docker/docs/single-server-example.md at main · frappe/frappe_docker · GitHub to create a custom compose file with external PostgreSQL (GCP PostgreSQL in this case).

Will share the documentation.

The database is successfully migrated to the cloud and the docker containers are also running, traefik and app DNS are mapped, and traefik DNS is resolving but app (ERPNext) domain is showing 404 not found (same in localhost curl and browser).

What to look for?

After making modifications in docker compose files, i am able to get ERPNext installed using external PostgreSQL. ERPNext App is being installed and the app is available through domain. But if installing the HRMS app using docker compose below:

docker compose --project-name erpnext-one -f ~/gitops/erpnext-one.yaml exec backend \
bench new-site \
--db-type postgres \
--db-host {{host}} \
--db-port 5432 \
--db-name {{db_name}} \
--db-password {{password}} \
--db-root-username {{username}} \
--admin-password {{password}} \
--install-app erpnext \
--install-app payments \
--install-app hrms \
{{domain_name}}

i am getting this error:

Installing hrms…
Updating DocTypes for hrms : [========================================] 100%
Setting up Frappe HR…

Patching Existing Data…
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1161, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1082, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 788, in invoke
return __callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 105, in new_site
_new_site(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 117, in _new_site
install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 326, in install_app
frappe.get_attr(after_install)()
File “/home/frappe/frappe-bench/apps/hrms/hrms/install.py”, line 9, in after_install
setup()
File “/home/frappe/frappe-bench/apps/hrms/hrms/setup.py”, line 23, in after_install
run_post_install_patches()
File “/home/frappe/frappe-bench/apps/hrms/hrms/setup.py”, line 568, in run_post_install_patches
frappe.get_attr(f"hrms.patches.post_install.{patch_name}.execute")()
File “/home/frappe/frappe-bench/apps/hrms/hrms/patches/post_install/move_payroll_setting_separately_from_hr_settings.py”, line 9, in execute
data = frappe.db.sql(
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/database.py”, line 220, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 252, in sql
traceback.print_stack()
‘Error in query:\ncolumn “HR Settings” does not exist\nLINE 4: doctype = “HR Settings”\n ^\n’
Installation for Frappe HR app failed due to an error. Please try re-installing the app or report the issue on Sign in to GitHub · GitHub if not resolved.
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1161, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1082, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 788, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 105, in new_site
_new_site(
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 117, in _new_site
install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 326, in install_app
frappe.get_attr(after_install)()
File “/home/frappe/frappe-bench/apps/hrms/hrms/install.py”, line 21, in after_install
raise e
File “/home/frappe/frappe-bench/apps/hrms/hrms/install.py”, line 9, in after_install
setup()
File “/home/frappe/frappe-bench/apps/hrms/hrms/setup.py”, line 23, in after_install
run_post_install_patches()
File “/home/frappe/frappe-bench/apps/hrms/hrms/setup.py”, line 568, in run_post_install_patches
frappe.get_attr(f"hrms.patches.post_install.{patch_name}.execute")()
File “/home/frappe/frappe-bench/apps/hrms/hrms/patches/post_install/move_payroll_setting_separately_from_hr_settings.py”, line 9, in execute
data = frappe.db.sql(
^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/database.py”, line 220, in sql
return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 230, in sql
self._cursor.execute(query, values)
psycopg2.errors.UndefinedColumn: column “HR Settings” does not exist
LINE 4: doctype = “HR Settings”


Relevant issues:
https://github.com/frappe/hrms/issues/1814


Any idea on the resolution?