[Release Notes] bench v5.2.0

This release brings,

  • Playbook fixes for Python 3.8 and Ubuntu 20.04 support
  • Improvements on user-level supervisor config setups
  • Logging commands and other info under logs/bench.log
  • Logging workers under development mode via the Procfile
  • Starting bench prefixless in development mode via bench start --no-prefix
  • Other fixes and enhancements

Update your existing non-editable bench CLI installation by

  $ pip install -U frappe-bench

Change Log:

  • fix: Update supervisord conf “better” (#1022)

  • fix(install.py): Check if Py3.5+ before installing distro (#1049)

  • fix: use remote_addr instead of user-defined header ip (#1024)

  • fix: don’t show warning message in developer mode (#1032)

  • fix: run backups every 6 hours, rather than every minute per 6 hours (#1030)

  • fix(playbooks): Use libssl1.1 for ubuntu >=18.04 (#1018)

  • fix: ubuntu 20.04 easy install hang half way (#1048)

  • fix: updated URL for MacOS guide (#1037)

  • travis: Separate builds for setup, install script and tests (#1036)

  • fix: Bump Nodejs v8 => v12 (#1043)

  • Revert “chore: dont run travis for docs updates” (#1034)

  • fix(install): Show Debian 10 is supported, update MariaDB defaults (#1046)

  • fix: maintain worker and worker.error logfile in dev mode (#1008)

  • fix: trailing slash deleting apps folder (#1021)

  • fix: populate bench.log via bench.utils.log (#1023)

  • docs: re-link installation docs (#1009)

  • feat: bench start --no-prefix (#1040)

  • feat(playbooks): wkthmltox for Ubuntu 20 (#1019)

Release Links:

10 Likes

‘’’

TASK [common : install pdf prerequisites for Ubuntu >= 18.04] **********************************************************
task path: /tmp/.bench/playbooks/roles/common/tasks/ubuntu.yml:33
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘echo ~root && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759” && echo ansible-tmp-1597794024.4962432-122632241746759=“echo /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759” ) && sleep 0’
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/packaging/os/apt.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1344731v0yji0/tmp9m956dud TO /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759/AnsiballZ_apt.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759/ /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759/AnsiballZ_apt.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759/AnsiballZ_apt.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1597794024.4962432-122632241746759/ > /dev/null 2>&1 && sleep 0’
The full traceback is:
File “/tmp/ansible_apt_payload_z0og0yuv/main.py”, line 434, in package_status
pkg = cache[pkgname]
File “/usr/lib/python3/dist-packages/apt/cache.py”, line 305, in getitem
raise KeyError(‘The cache has no package named %r’ % key)

fatal: [localhost]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“allow_unauthenticated”: false,
“autoclean”: false,
“autoremove”: false,
“cache_valid_time”: 0,
“deb”: null,
“default_release”: null,
“dpkg_options”: “force-confdef,force-confold”,
“force”: true,
“force_apt_get”: false,
“install_recommends”: null,
“only_upgrade”: false,
“package”: [
“libssl1.0-dev”
],
“pkg”: [
“libssl1.0-dev”
],
“policy_rc_d”: null,
“purge”: false,
“state”: “present”,
“update_cache”: null,
“upgrade”: null
}
},
“msg”: “No package matching ‘libssl1.0-dev’ is available”
}

PLAY RECAP *************************************************************************************************************
localhost : ok=5 changed=2 unreachable=0 failed=1 skipped=3 rescued=0 ignored=0

Traceback (most recent call last):
File “install.py”, line 472, in
install_bench(args)
File “install.py”, line 264, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 388, in run_playbook
success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.8/subprocess.py”, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=erpfrappe’]’ returned non-zero exit status 2.

Please update ubuntu.yml playbook's git

After update from bench 5.0.0 (Ubuntu 18)

bench restart

produces the following error\

(env) erpfrappe@ileco1-ml:~/frappe-bench$ bench restart
$ supervisorctl restart frappe:
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228

I noted that bench lets-encrypt installed python 2.7. This may be related

1 Like

Thanks! Any plans on fixing translation issues PR fixing the issue

Translations not working on custom apps.

1 Like

I would really like to hear from someone who is using translations on their own code. Can it be done? Is the documentation out of date?

I will be needing to use it and would hate to discover that it just doesn’t work and won’t ever be fixed.

I have seen this when doing:

supervisorctl reload;
supervisorctl restart all;

The fix, believe it or not, was:

supervisorctl reload;
sleep 10;
supervisorctl restart all;
1 Like
$ supervisorctl reload;
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
$

So, the answer given is not accurate sorry.

The problem here is supervisor now needs to be in the sudo group.

$ sudo supervisorctl reload;
Restarted supervisord
$ sudo supervisorctl restart all;
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-redis:frappe-bench-redis-queue: stopped
frappe-bench-redis:frappe-bench-redis-cache: stopped
frappe-bench-redis:frappe-bench-redis-socketio: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
frappe-bench-redis:frappe-bench-redis-queue: started
frappe-bench-redis:frappe-bench-redis-cache: started
frappe-bench-redis:frappe-bench-redis-socketio: started
$

The issue here is bench restart is not updated to use sudo.

~/frappe-bench$ bench restart
$ supervisorctl restart frappe:
error: <class 'socket.error'>, [Errno 13] Permission denied: file: /usr/lib/python2.7/socket.py line: 228
:~/frappe-bench$

Production mode is set to automatically run frappe, ERPNext workers when the linux server is turned on.

So, without sudo, the supervisorctl will fail.

I don’t like to go to the command line and reissue sudo supervisorctl commands every time the Ubuntu server is turned on for the day.

When you install frappe-bench do you do:

sudo pip3 install frappe-bench

or

pip3 install frappe-bench

???

It think pip3 install frappe-bench.
I will try sudo pip3 install frappe-bench

sudo runs anything as root, in that case you’re installing frappe-bench globally, to all users. Without sudo you’re installing for the user runing the command. Sometimes some packages required to be installed as root.

I ended up with a bunch of weird defects if I installed frappe-bench without sudo.

1 Like

Now the supervisor doesn’t need sudo anymore.
But some other commands still need it (the last I found is lets-encrypt) so I guess we still need to install bench with sudo. Otherwise, the bench not found error still occur.

1 Like

I guess some of the latest updates broke the code and I am getting the same error during a bench update --reset execution. Are we losing control of the code?