frappe / frappe_docker

Docker images for production and development setups of the Frappe framework and ERPNext
MIT License
1.52k stars 1.4k forks source link

custom apps installation error #1393

Closed saru2020 closed 6 months ago

saru2020 commented 6 months ago

Description of the issue

on my Mac, I'm following the steps laid out here for custom apps installation and I'm facing the below error:

Context information (for bug reports)

Steps to reproduce the issue

following the steps laid out here for custom apps installation

Observed result

installation fails by erroring out

Expected result

docker image with custom apps should be built/created successfully.

Stacktrace / full error message if available

436.1 Found existing apps updating states...
436.1 WARN: restart failed: Couldn't find supervisorctl in PATH
436.1 A directory for the application 'frappe' already exists. Do you want to continue and overwrite it? [y/N]: Traceback (most recent call last):
436.1   File "/usr/local/lib/python3.11/site-packages/bench/commands/make.py", line 75, in init
436.1     init(
436.1   File "/usr/local/lib/python3.11/site-packages/bench/utils/render.py", line 105, in wrapper_fn
436.1     return fn(*args, **kwargs)
436.1            ^^^^^^^^^^^^^^^^^^^
436.1   File "/usr/local/lib/python3.11/site-packages/bench/utils/system.py", line 98, in init
436.1     install_apps_from_path(apps_path, bench_path=path)
436.1   File "/usr/local/lib/python3.11/site-packages/bench/app.py", line 1030, in install_apps_from_path
436.1     get_app(
436.1   File "/usr/local/lib/python3.11/site-packages/bench/app.py", line 761, in get_app
436.1     or click.confirm(
436.1        ^^^^^^^^^^^^^^
436.1   File "/usr/local/lib/python3.11/site-packages/click/termui.py", line 235, in confirm
436.1     raise Abort() from None
436.1 click.exceptions.Abort
436.1 
436.1 ERROR: There was a problem while creating /home/frappe/frappe-bench
436.1 Do you want to rollback these changes? [y/N]: 
------
Containerfile:117
--------------------
 116 |     ARG FRAPPE_PATH=https://github.com/frappe/frappe
 117 | >>> RUN export APP_INSTALL_ARGS="" && \
 118 | >>>   if [ -n "${APPS_JSON_BASE64}" ]; then \
 119 | >>>     export APP_INSTALL_ARGS="--apps_path=/opt/frappe/apps.json"; \
 120 | >>>   fi && \
 121 | >>>   bench init ${APP_INSTALL_ARGS}\
 122 | >>>     --frappe-branch=${FRAPPE_BRANCH} \
 123 | >>>     --frappe-path=${FRAPPE_PATH} \
 124 | >>>     --no-procfile \
 125 | >>>     --no-backups \
 126 | >>>     --skip-redis-config-generation \
 127 | >>>     --verbose \
 128 | >>>     /home/frappe/frappe-bench && \
 129 | >>>   cd /home/frappe/frappe-bench && \
 130 | >>>   echo "{}" > sites/common_site_config.json && \
 131 | >>>   find apps -mindepth 1 -path "*/.git" | xargs rm -fr
 132 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c export APP_INSTALL_ARGS=\"\" &&   if [ -n \"${APPS_JSON_BASE64}\" ]; then     export APP_INSTALL_ARGS=\"--apps_path=/opt/frappe/apps.json\";   fi &&   bench init ${APP_INSTALL_ARGS}    --frappe-branch=${FRAPPE_BRANCH}     --frappe-path=${FRAPPE_PATH}     --no-procfile     --no-backups     --skip-redis-config-generation     --verbose     /home/frappe/frappe-bench &&   cd /home/frappe/frappe-bench &&   echo \"{}\" > sites/common_site_config.json &&   find apps -mindepth 1 -path \"*/.git\" | xargs rm -fr" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/mz889b2h7j20hbrnfpqkouxn5
saru2020 commented 6 months ago

I just realised that the issue was caused because I had frappe app also included in the apps.json which was causing a reinstall and hence the above issue. So I removed it from apps.json file and the docker image was built successfully 👍