No such file or directory: '/site_config.json

I am trying to install erpnext (latest version) docker images. While starting the docker, I am encountering error of FileNotFoundException


erpnext@ubuntu-s-1vcpu-2gb-intel-blr1-01:/srv/erpnext/frappe_docker$ more .env
ERPNEXT_VERSION=latest
FRAPPE_VERSION=latest
MARIADB_HOST=mariadb
MYSQL_ROOT_PASSWORD=admin
SITES=your.domain.com
LETSENCRYPT_EMAIL=your.email@your.domain.com

erpnext@ubuntu-s-1vcpu-2gb-intel-blr1-01:/srv/erpnext/frappe_docker$ sudo docker exec -it -e “SITE_NAME=$SITE_NAME” -e “DB_ROOT_USER=$DB_ROOT_USER” -e “MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD” -e “ADMIN_PASSWORD=$ADMIN_PASSWORD” -e “INSTALL_APPS=erpnext” university-joint_erpnext-python_1 docker-entrypoint.sh new
Attempt 1 to connect to mariadb:3306
Attempt 1 to connect to redis-queue:6379
Attempt 1 to connect to redis-cache:6379
Attempt 1 to connect to redis-socketio:6379
Connections OK
Created user _da39a3ee5e6b4b0d
Created database _da39a3ee5e6b4b0d
Granted privileges to user _da39a3ee5e6b4b0d and database _da39a3ee5e6b4b0d
Starting database import…
Imported from database /home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/framework_mariadb.sql

Installing frappe…
Updating DocTypes for frappe : [========================================] 100%
Updating country info : [========================================] 100%

Installing erpnext…
Updating DocTypes for erpnext : [========================================] 100%
Updating customizations for Address
Updating customizations for Contact
*** Scheduler is disabled ***
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 88, in main
site_config = get_site_config(site_name)
File “/home/frappe/frappe-bench/commands/utils.py”, line 97, in get_site_config
with open(‘{site_name}/site_config.json’.format(site_name=site_name)) as site_config_file:
FileNotFoundError: [Errno 2] No such file or directory: ‘/site_config.json’

Could you please help.

Did you go through the docs? Why is volume missing -v? check frappe_docker/site-operations.md at main · frappe/frappe_docker · GitHub

Did you install all the services using docker-compose? Show output of docker ps if you have already started the services. There should be multiple containers running. Check logs of any container if it is failing.

Docker tests are passing. Travis CI - Test and Deploy with Confidence
I tried play with docker now, It worked as expected.

Thanks for reply Revant.

Please see below the screenshot

erpnext@ubuntu-s-1vcpu-2gb-intel-blr1-01:/srv/erpnext/frappe_docker/installation$ sudo docker run -e “SITE_NAME=$SITE_NAME” -e “DB_ROOT_USER=$DB_ROOT_USER” -e “MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD” -e “ADMIN_PASSWORD=$ADMIN_PASSWORD” -e “INSTALL_APPS=erpnext” -v university-joint_sites-vol:/home/frappe/frappe-bench/sites --network webproxy frappe/erpnext-worker:edge
Attempt 1 to connect to mariadb:3306
Attempt 1 to connect to redis-queue:6379
Attempt 1 to connect to redis-cache:6379
Attempt 1 to connect to redis-socketio:6379
Connections OK
[2021-04-02 11:20:47 +0000] [10] [INFO] Starting gunicorn 19.10.0
[2021-04-02 11:20:47 +0000] [10] [INFO] Listening at: http://0.0.0.0:8000 (10)
[2021-04-02 11:20:47 +0000] [10] [INFO] Using worker: gthread
[2021-04-02 11:20:47 +0000] [13] [INFO] Booting worker with pid: 13
[2021-04-02 11:20:47 +0000] [14] [INFO] Booting worker with pid: 14

I am not able to access site: http://university-joint.IP Address:8000/app/home

I have opened the firewall as well

22,25,80,143,443,3306,8000/tcp ALLOW Anywhere

with this docker setup only dns base multi tenancy is supported.

Still, I am not able to access site. Now I have added dns

erpnext@ubuntu-s-1vcpu-2gb-intel-blr1-01:/srv/erpnext/frappe_docker$ more .env
ERPNEXT_VERSION=edge
FRAPPE_VERSION=edge
MARIADB_HOST=mariadb
MYSQL_ROOT_PASSWORD=admin
SITES=erp-dev.universityjoint.com,erp-prod.universityjoint.com
LETSENCRYPT_EMAIL=skyers@universityjoint.com

Also,
I have executed below commands
to install bench:
sudo docker run frappe/bench:latest init
to connect the bench with network:
sudo docker network connect erp-dev_default awesome_archimedes
to enable dns multitenant
sudo docker exec -it awesome_archimedes bench config dns_multitenant on
to add new-site

erpnext@ubuntu-s-1vcpu-2gb-intel-blr1-01:~$ sudo docker exec -it awesome_archimedes bench new-site erp-dev
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench

WARN: Command not being executed in bench directory
Usage: bench [OPTIONS] COMMAND [ARGS]…
Try “bench --help” for help.

Error: No such command “new-site”.

so I have executed the new-app command
erpnext@ubuntu-s-1vcpu-2gb-intel-blr1-01:~$ sudo docker exec -it awesome_archimedes bench new-app erp-dev
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: pip install frappe-bench

WARN: Command not being executed in bench directory

sudo docker exec -it awesome_archimedes bench setup nginx

sudo docker exec -it erp-dev_erpnext-nginx_1 service nginx reload

still I am NOT able to access the webpage at http://erp-dev.universityjoint.com:8000/app

I am able to ping new DNS and droplet IP
image

after running below command:

sudo docker exec -it awesome_archimedes bench init frappe-bench && cd frappe-bench

Error

/bin/sh: 1: redis-server: not found
Command ‘redis-server --version’ returned non-zero exit status 127.
ERROR: There was a problem while creating frappe-bench

I am running following commands:

sudo docker exec -it awesome_archimedes bash “-c” “cd ./frappe-bench && bench new-site erp-dev”

and getting below errors:

Traceback (most recent call last):
File “/usr/lib/python3.7/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.7/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 101, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 41, in new_site
db_port=db_port, new_site=True)
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 39, in setup_database
if force or (db_name not in dbman.get_database_list()):
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py”, line 60, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 121, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 74, in connect
self._conn = self.get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 90, in get_connection
local_infile = frappe.conf.local_infile)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/init.py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 325, in init
self.connect()
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 630, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘127.0.0.1’ ([Errno 111] Connection refused)”)

I have added permission:

Logs at mariadb container:

Version: ‘10.3.28-MariaDB-1:10.3.28+maria~focal’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 mariadb.org binary distribution
2021-04-08 3:18:36 14 [Warning] Access denied for user ‘_da39a3ee5e6b4b0d’@‘172.20.0.13’ (using password: YES)
2021-04-08 3:18:36 15 [Warning] ‘proxies_priv’ entry ‘@% root@f8c547eb2378’ ignored in --skip-name-resolve mode.
2021-04-08 3:18:36 16 [Warning] Aborted connection 16 to db: ‘_da39a3ee5e6b4b0d’ user: ‘_da39a3ee5e6b4b0d’ host: ‘172.20.0.13’ (Got an error reading communication packets)
2021-04-08 3:20:29 18 [Warning] Aborted connection 18 to db: ‘_da39a3ee5e6b4b0d’ user: ‘_da39a3ee5e6b4b0d’ host: ‘172.20.0.13’ (Got an error reading communication packets)
2021-04-08 3:34:29 21 [Warning] Aborted connection 21 to db: ‘unconnected’ user: ‘root’ host: ‘172.20.0.13’ (Got an error reading communication packets)
2021-04-08 3:52:09 24 [Warning] Aborted connection 24 to db: ‘unconnected’ user: ‘root’ host: ‘172.20.0.13’ (Got an error reading communication packets)

so I have provided the access but still same error:

mysql -uroot -padmin -Bse “GRANT ALL PRIVILEGES ON . TO ‘root’@‘127.%.%.%’ IDENTIFIED BY ‘admin’ WITH GRANT OPTION;”
mysql -uroot -padmin -Bse “GRANT ALL PRIVILEGES ON . TO ‘root’@‘localhost’ IDENTIFIED BY ‘admin’ WITH GRANT OPTION;”
mysql -uroot -padmin -Bse “GRANT ALL PRIVILEGES ON . TO ‘root’@‘192.168.%.%’ IDENTIFIED BY ‘admin’ WITH GRANT OPTION;”
mysql -uroot -padmin -Bse “GRANT ALL PRIVILEGES ON . TO ‘root’@‘206.189.139.74’ IDENTIFIED BY ‘admin’ WITH GRANT OPTION;”
mysql -uroot -padmin -Bse “GRANT ALL PRIVILEGES ON . TO ‘root’@‘172.20.0.13’ IDENTIFIED BY ‘admin’ WITH GRANT OPTION;”

Please help @revant_one

I really can’t help much.

I’m out of luck.

bench new-app cannot be executed in production images.

I’ll repeat, bench is not installed in production images. Bench is only available for docker development setup.