ValueError: unsupported pickle protocol: 3

Hello,

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