Error on Bench Update V13

I’m getting the following on bench update

root@ip-:/home/frappe/frappe-bench# bench update
Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.6/runpy.py”, line 109, in _get_module_details
import(pkg_name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 28, in
from .utils.jinja import (get_jenv, get_template, render_template, get_email_from_template, get_jloader)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/init.py”, line 23, in
from frappe.utils.html_utils import sanitize_html
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/html_utils.py”, line 4, in
from bleach_allowlist import bleach_allowlist
ModuleNotFoundError: No module named ‘bleach_allowlist’

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.6/dist-packages/bench/cli.py”, line 48, in cli
if sys.argv[1] in get_frappe_commands() + ["–site", “–verbose”, “–force”, “–profile”]:
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘list’

Any ideas to fix?

I’m getting the same error. I’ve installed bleach_allowlist from pypi, how did you go around it?

Hi iMoshi, I ended up re-installing from a new server instance of ERPNext and reloading the DB. Sorry, I had tried for a time to resolve, but had little success and a clean install was what I needed to get it up and going quickly.

Whoa, that’s unfortunate. What OS are you going with though? I’ve had trouble with Ubuntu 20.04, if I really have to format the whole thing I might as well go for 20.04, but gotta confirm if it’s all working fine :slight_smile:

The problem with bleach-allowlist is a Python and ERPNext one.

Until recently, the name of the 3rd party app was “bleach-whitelist”. The maintainers recently renamed it to “bleach-allowlist”

https://pypi.org/project/bleach-whitelist/


Because of the name change, both ERPNext prerequisites -and- code had to be modified. Looks like you tried bench update while the fix was not fully completed.

In my experience, the OS is almost never the problem (I’ve seen it happen twice). The root cause is usually an ERPNext-specific problem, or a PyPI or Node.js package dependency issue.

If you haven’t already, make sure you cleared the cache, and restart the web server. I sometimes even delete all the .pyc files, just to be safe.

Seems like the only possible solution due to this bleach-whitelist, installing it doesn’t help.