ValueError: unsupported pickle protocol: 3


I am facing the issue “Internal Server Error”.

When I checked the web.error.log it throws the error “ValueError: unsupported pickle protocol: 3”.

The site goes down and automatically gets up live again after some time span.

I think this is due to python libraries which are getting mismatched, because on the same server i am having setup which contains python 3.5 libraries which never goes down.

Kindly advice.

To pinpoint the problem please post the full traceback plus erpnext version info thanks!

“The pickle module implements binary protocols for serializing and de-serializing a Python object structure.”

@clarkej This is happeing for both the version “erpnext 10.1.36, frappe 10.1.35” also " erpnext 11.1.49,
frappe 11.1.44 ".

this is the same traceback for the both above version setups and both the setup uses python 2.7 libraries.

File "~/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "~/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "~/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/", line 231, in application
    return ClosingIterator(app(environ, start_response), self.cleanup)
  File "~/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/wrappers/", line 237, in application
    resp = f(*args[:-2] + (request,))
  File "~/frappe-bench/apps/frappe/frappe/", line 87, in application
    response = handle_exception(e)
  File "~/frappe-bench/apps/frappe/frappe/", line 193, in handle_exception
  File "~/frappe-bench/apps/frappe/frappe/website/", line 39, in render
    data = render_page('404')
  File "~/frappe-bench/apps/frappe/frappe/website/", line 158, in render_page
    return build(path)
  File "~/frappe-bench/apps/frappe/frappe/website/", line 165, in build
    return build_page(path)
  File "~/frappe-bench/apps/frappe/frappe/website/", line 178, in build_page
    context = get_context(path)
  File "~/frappe-bench/apps/frappe/frappe/website/", line 28, in get_context
    context = build_context(context)
  File "~/frappe-bench/apps/frappe/frappe/website/", line 75, in build_context
  File "~/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/", line 76, in get_website_settings
    {"label": _("My Account"), "url": "/me"},
  File "~/frappe-bench/apps/frappe/frappe/", line 71, in _
    return get_full_dict(lang).get(msg) or non_translated_msg
  File "~/frappe-bench/apps/frappe/frappe/", line 190, in get_full_dict
    frappe.local.lang_full_dict = load_lang(lang)
  File "~/frappe-bench/apps/frappe/frappe/", line 211, in load_lang
    out = frappe.cache().hget("lang_full_dict", lang, shared=True)
  File "~/frappe-bench/apps/frappe/frappe/utils/", line 177, in hget
    value = pickle.loads(value)
ValueError: unsupported pickle protocol: 3

Have you tried switching to Python 3.6?

Reference ValueError: unsupported pickle protocol: 3, python2 pickle can not load the file dumped by python 3 pickle? - Stack Overflow

You probably running 2 different setups at a time.
Try closing one setup and run bench clear-cache.
Hope this will work. It worked for me.

1 Like