You are here: Home / ERPNext Self-hosted on Debian 11 Bullseye

ERPNext Self-hosted on Debian 11 Bullseye

by Hawke Robinson last modified Jun 05, 2022 09:38 AM
ERPNext technically is better supported on Debian 10, but since that is getting a bit old in support I'm trying to make it work on Debian 11 so I can remain on there as long as possible, this does mean some tweaks have to be performed to get it all working and dialed in. This page summarizes the tweaks I have found, and will be updated periodically as new ones come up.

As mentioned in earlier postings, due to unfortunate directions in increasingly mercenary and non-opensource-spirit attitudes taken by the the opensource versions of Odoo and Plone, after decades of using Plone, and a decade of using Odoo and Odoo's predecessors, I have to abandon them completely, and for all the companies I advise and support.

In the quest to find a viable replacement, I am evaluating ERPNext to see if it has matured enough from my last evaluation a few years ago (when it did not pass). It appears to have come a long way. We'll also see how the opensource community attitude and whether they are succumbing to similar anit-opensource mercenary attitudes killing the geese that laid the golden eggs, or if they "get it" and follow more "true" opensource attitudes. That will become clear over time as support and feature requests are made.  I have been involved with software development and online since I was about 8 years old (since 1979), and always active in opensource communities.

I am evaluating in development (DEV), staging (STG), and production (PRD) environments for an actual active non-profit interanational company needing to replace both Plone (4.x and 5.x) and Odoo (12, 13, & 14) servers looking for a better all-in-one solution, hopefully ERPNext can address their needs.

 

 

 

Error: AttributeError: 'HTMLParser' object has no attribute 'unescape'

 

Every time I try to use any of the tools that post web page content I’m getting error: "AttributeError: 'HTMLParser' object has no attribute 'unescape'"

 

 

So far we see this happens with: Blog Post, Help Article, Web Page, and TODO. This prevents being able to post any of these items, and indeed being able to finish setting up the site.

We are new to ERPNext, we’re trying to migrate away from Odoo and Plone, and hoping that ERPNext might be a good solution, it looks promising in the online demos/trials, now if we could just get it fully working on our own servers. :slight_smile:

This is a fresh install of ERPNext on Debian 11 (we are required to use this IS version, we may not downgrade to Ubuntu or older versions of Debian lower than 11).
OS Version: Debian 11 Bullseye

uname -a
Linux erpnext-stg-deb11 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux

ERPNext version:

(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench/erpnext$ bench version
erpnext 12.30.1
frappe 12.27.0

Python version:

(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench/erpnext$ python --version
Python 3.9.2

Pip version:

pip --version
pip 22.1.2 from /srv/bench3/lib/python3.9/site-packages/pip (python 3.9)

Bench version:

(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench$ bench --version
5.8.1
(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench$ node --version
v14.19.3
(bench3) erpnext@erpnext-stg-deb11:/srv/erpnext-bench$ npm --version
6.14.17

console shows:
16:36:47 web.1 | 127.0.0.1 - - [03/Jun/2022 16:36:47] "POST /api/method/[frappe.desk.form.save](http://frappe.desk.form.save/).savedocs HTTP/1.0" 500 - 16:36:47 web.1 | INFO:werkzeug:127.0.0.1 - - [03/Jun/2022 16:36:47] "POST /api/method/[frappe.desk.form.save](http://frappe.desk.form.save/).savedocs HTTP/1.0" 500 - at that time.

Browser (on console shows on client side Debian 11 Firefox 96.0.1):

XHRPOSThttp://[hostname/api/method/frappe.desk.form.save.savedocs](http://hostname/api/method/frappe.desk.form.save.savedocs)
[HTTP/1.1 500 INTERNAL SERVER ERROR 206ms]

Traceback (most recent call last):
File "/srv/bench3/erpnext/apps/frappe/frappe/desk/form/[save.py](http://save.py/)", line 21, in savedocs
[doc.save](http://doc.save/)()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 273, in save
return self._save(*args, **kwargs)
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 296, in _save
self.insert()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 260, in insert
[self.run](http://self.run/)_post_save_methods()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 950, in run_post_save_methods
update_global_search(self)
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 247, in update_global_search
content.append(get_formatted_value(doc.get(field.fieldname), field))
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 348, in get_formatted_value
value = h.unescape([frappe.safe](http://frappe.safe/)_decode(value))
AttributeError: 'HTMLParser' object has no attribute 'unescape'
request.js:387:14
Traceback (most recent call last):
File "/srv/bench3/erpnext/apps/frappe/frappe/[app.py](http://app.py/)", line 67, in application
response = frappe.api.handle()
File "/srv/bench3/erpnext/apps/frappe/frappe/[api.py](http://api.py/)", line 59, in handle
return frappe.handler.handle()
File "/srv/bench3/erpnext/apps/frappe/frappe/[handler.py](http://handler.py/)", line 24, in handle
data = execute_cmd(cmd)
File "/srv/bench3/erpnext/apps/frappe/frappe/[handler.py](http://handler.py/)", line 64, in execute_cmd
return [frappe.call](http://frappe.call/)(method, **frappe.form_dict)
File "/srv/bench3/erpnext/apps/frappe/frappe/**init**.py", line 1105, in call
return fn(*args, **newargs)
File "/srv/bench3/erpnext/apps/frappe/frappe/desk/form/[save.py](http://save.py/)", line 21, in savedocs
[doc.save](http://doc.save/)()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 273, in save
return self._save(*args, **kwargs)
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 296, in _save
self.insert()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 260, in insert
[self.run](http://self.run/)_post_save_methods()
File "/srv/bench3/erpnext/apps/frappe/frappe/model/[document.py](http://document.py/)", line 950, in run_post_save_methods
update_global_search(self)
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 247, in update_global_search
content.append(get_formatted_value(doc.get(field.fieldname), field))
File "/srv/bench3/erpnext/apps/frappe/frappe/utils/global_[search.py](http://search.py/)", line 348, in get_formatted_value
value = h.unescape([frappe.safe](http://frappe.safe/)_decode(value))
AttributeError: 'HTMLParser' object has no attribute 'unescape'
request.js:387:14

 

I posted in ERPNext forum: https://discuss.erpnext.com/t/attributeerror-htmlparser-object-has-no-attribute-unescape-every-time-try-to-use-any-web-page-tools/90594 to see what they have to say, and how their attitude and approach compares to opensource standards.

Looking elsewhere, on other platforms it looks like may be related to ERPNext's code call based on older version calls and our version of Python or Pip version being too new (3.9.2).
It may require us changing our Python or related tool version, or else having to manually hack the ERPNext code to accept the newer call because in python 3.9.0 HTMLParser.unescape was deprecated, and the replacement is to replace (at least in coursera, don't know yet if same in erpnext):
"h = html_parser.HTMLParser()
with
h = html
"
and
"also commenting out this line:

from six.moves import html_parser"

https://github.com/coursera-dl/coursera-dl/issues/778

https://stackoverflow.com/questions/65640476/pip3-on-python3-9-fails-on-htmlparser-object-has-no-attribute-unescape

https://github.com/PySimpleGUI/PySimpleGUI/issues/4119

Waiting to see what the erpnext folks say first before taking on our either downgrading or hacking.

 

 

 

Navigation