How to remove '--quiet' from "bench get-app erpnext"?

We have written a script to automate installing ERPNext the way we need it, but it has several of defects.

The first issue is that we have to run it twice!

This line hangs completely the on 1st run but executes without problem the 2nd time:

bench get-app erpnext --overwrite --branch ${TARGET_ERPNEXT_VERSION};

First run looks like this…

Getting erpnext
$ git clone https://github.com/frappe/erpnext.git --branch version-13 --depth 1 --origin upstream
Cloning into 'erpnext'...
Ignoring dependencies of erpnext. To install dependencies use --resolve-deps
Installing erpnext
$ /home/adm/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/adm/frappe-bench/apps/erpnext 

client_loop: send disconnect: Broken pipe

Second run looks like this …

INFO: App moved from apps/erpnext to archived/apps/erpnext-2022-11-30
Getting erpnext
$ git clone https://github.com/frappe/erpnext.git --branch version-13 --depth 1 --origin upstream
Cloning into 'erpnext'...
Ignoring dependencies of erpnext. To install dependencies use --resolve-deps
Installing erpnext
$ /home/adm/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/adm/frappe-bench/apps/erpnext 
$ yarn install
yarn install v1.22.19
yarn install v1.22.19
[1/4] Resolving packages...
   "                       "                       "                       "                       "                      
   "                       "                       "                       "                       "                      

I need to see what is going on in the failing line /home/adm/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/adm/frappe-bench/apps/erpnext so I need to remove the --quiet.

Unfortunately the command has no --verbose switch:

Usage: bench get-app [OPTIONS] [NAME]... GIT_URL

  Clone an app from the internet or filesystem and set it up in your bench

Options:
  --branch TEXT   branch to checkout
  --overwrite
  --skip-assets   Do not build assets
  --soft-link     Create a soft link to git repo instead of clone.
  --init-bench    Initialize Bench if not in one
  --resolve-deps  Resolve dependencies before installing app
  --help          Show this message and exit.

How can I get a --verbose view of bench get-app?


Note:

adm@serpht:~/frappe-bench$ bench --version
5.15.1
adm@serpht:~/frappe-bench$ bench version
erpnext 13.42.2
frappe 13.36.2
adm@serpht:~/frappe-bench$

I need to see what is going on in the failing line /home/adm/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/adm/frappe-bench/apps/erpnext

Would adding -vv to pip install help at all?

1 Like

Thanks for the suggestion, but I would have to try to find that line in the code for bench.

Ugh!

I have found the issue.

It has nothing to do with the ‘bench get-app’ call.

I have a bash script on my workstation that copies several scripts to the target host for the installation procedure.

One of the scripts (doIt.sh) is used to call the others. So the script on my workstation activates those scripts via ssh

Example:

prepareServer_0.sh

# set up tasks
ssh ${ADMIN}@${SERVER} "./doIt.sh prepareServer_1.sh";
# other tasks
ssh ${ADMIN}@${SERVER} "./doIt.sh prepareServer_2.sh";
# more tasks

“prepareServer_2” calls bench get-app after many previous steps.

Apparently it times out!

So now, Instead of …

ssh ${ADMIN}@${SERVER} "./doIt.sh prepareServer_2.sh";

… I do …

ssh  -o ServerAliveInterval=30 -o ServerAliveCountMax=20 ${ADMIN}@${SERVER} "./doIt.sh prepareServer_2.sh";

Those switches tell SSH to send a heart beat signal every thirty seconds for ten minutes after the last client side activity.

Now, even though bench get-app takes long time, it does not time out.