ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Internal Server Error- AttributeError


#1

Hello,

I have this error when I try to “bench build” in mode production.
I try to launch “bench restart” but I have this error :

[2019-01-09 08:48:28 +0000] [23144] [ERROR] Error handling request /login
Traceback (most recent call last):
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py”, line 135, in handle
self.handle_request(listener, req, client, addr)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py”, line 176, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/werkzeug/local.py”, line 228, in application
return ClosingIterator(app(environ, start_response), self.cleanup)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py”, line 308, in application
resp = f(*args[:-2] + (request,))
File “/opt/bench/erpnext/apps/frappe/frappe/app.py”, line 81, in application
response = handle_exception(e)
File “/opt/bench/erpnext/apps/frappe/frappe/app.py”, line 188, in handle_exception
http_status_code=http_status_code)
File “/opt/bench/erpnext/apps/frappe/frappe/website/render.py”, line 75, in render
data = render_page(path)
File “/opt/bench/erpnext/apps/frappe/frappe/website/render.py”, line 158, in render_page
return build(path)
File “/opt/bench/erpnext/apps/frappe/frappe/website/render.py”, line 165, in build
return build_page(path)
File “/opt/bench/erpnext/apps/frappe/frappe/website/render.py”, line 181, in build_page
html = frappe.render_template(context.source, context)
File “/opt/bench/erpnext/apps/frappe/frappe/utils/jinja.py”, line 75, in render_template
return get_jenv().from_string(template).render(context)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “”, line 1, in top-level template code
File “/opt/bench/erpnext/apps/frappe/frappe/./templates/web.html”, line 6, in top-level template code
{%- if page_or_generator==“Generator” %}source-type=“Generator” data-doctype="{{ doctype }}"{% endif %}
File “/opt/bench/erpnext/apps/frappe/frappe/./templates/base.html”, line 17, in top-level template code
{%- block head -%}
File “/opt/bench/erpnext/apps/frappe/frappe/./templates/base.html”, line 23, in block “head”

File “/opt/bench/erpnext/apps/frappe/frappe/website/utils.py”, line 187, in abs_url
if path.startswith(‘http://’) or path.startswith(‘https://’):
AttributeError: ‘tuple’ object has no attribute 'startswith’

I search diffent solution in different Topic but all cmd of the community who try to resolve this problem doesn’t work with my error.

Help me,
Thx.


#2

Perhaps this link will help