question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Py3] after migrating to python3, cannot access site by domain name

See original GitHub issue

getting blank page, tracelog:

18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/autodoc.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/autodoc.cpython-35.pyc', reloading
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/frappe/frappe/www/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/frappe/frappe/www/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/frappe/frappe/www/__pycache__/printview.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/frappe/frappe/www/__pycache__/printview.cpython-35.pyc', reloading
18:25:18 web.1            | 172.19.0.1 - - [28/Feb/2018 18:25:18] "GET / HTTP/1.1" 301 -
18:25:18 web.1            | INFO:werkzeug:172.19.0.1 - - [28/Feb/2018 18:25:18] "GET / HTTP/1.1" 301 -
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/__pycache__/utils.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/__pycache__/utils.cpython-35.pyc', reloading
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/doctype/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/doctype/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/doctype/shopping_cart_settings/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/doctype/shopping_cart_settings/__pycache__/__init__.cpython-35.pyc', reloading
18:25:18 web.1            |  * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/doctype/shopping_cart_settings/__pycache__/shopping_cart_settings.cpython-35.pyc', reloading
18:25:18 web.1            | INFO:werkzeug: * Detected change in '/home/frappe/frappe-bench/apps/erpnext/erpnext/shopping_cart/doctype/shopping_cart_settings/__pycache__/shopping_cart_settings.cpython-35.pyc', reloading

while accessing trough ip, getting an error:

schermata 2018-02-28 alle 18 29 30

tracelog:

18:27:49 web.1            | Traceback (most recent call last):
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/middlewares.py", line 15, in __call__
18:27:49 web.1            |     return super(StaticDataMiddleware, self).__call__(environ, start_response)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/wsgi.py", line 766, in __call__
18:27:49 web.1            |     return self.app(environ, start_response)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/wsgi.py", line 766, in __call__
18:27:49 web.1            |     return self.app(environ, start_response)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/local.py", line 228, in application
18:27:49 web.1            |     return ClosingIterator(app(environ, start_response), self.cleanup)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/wrappers.py", line 308, in application
18:27:49 web.1            |     resp = f(*args[:-2] + (request,))
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 88, in application
18:27:49 web.1            |     response = handle_exception(e)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 194, in handle_exception
18:27:49 web.1            |     http_status_code=http_status_code)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 72, in render
18:27:49 web.1            |     data = render_page(path)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 149, in render_page
18:27:49 web.1            |     return build(path)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 156, in build
18:27:49 web.1            |     return build_page(path)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 169, in build_page
18:27:49 web.1            |     context = get_context(path)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py", line 28, in get_context
18:27:49 web.1            |     context = build_context(context)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py", line 77, in build_context
18:27:49 web.1            |     context.update(get_website_settings())
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/website/doctype/website_settings/website_settings.py", line 77, in get_website_settings
18:27:49 web.1            |     {"label": _("My Account"), "url": "/me"},
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 56, in _
18:27:49 web.1            |     return get_full_dict(lang).get(msg) or msg
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 189, in get_full_dict
18:27:49 web.1            |     frappe.local.lang_full_dict = load_lang(lang)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 215, in load_lang
18:27:49 web.1            |     out.update(get_translation_dict_from_file(path, lang, app) or {})
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 231, in get_translation_dict_from_file
18:27:49 web.1            |     csv_content = read_csv_file(path)
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 550, in read_csv_file
18:27:49 web.1            |     newdata = [[text_type(val, 'utf-8') for val in row] for row in data]
18:27:49 web.1            |   File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 550, in <listcomp>
18:27:49 web.1            |     newdata = [[text_type(val, 'utf-8') for val in row] for row in data]
18:27:49 web.1            | _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)

Edit: migrating env back to python2, still not possible to access site by domain name, accessing using ip rise an error:

schermata 2018-02-28 alle 19 06 36

tracelog:

19:03:42 schedule.1       | Traceback (most recent call last):
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 73, in enqueue_events_for_all_sites
19:03:42 schedule.1       |     enqueue_events_for_site(site=site, queued_jobs=jobs_per_site[site])
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 80, in enqueue_events_for_site
19:03:42 schedule.1       |     frappe.init(site=site)
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 158, in init
19:03:42 schedule.1       |     setup_module_map()
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 864, in setup_module_map
19:03:42 schedule.1       |     local.app_modules = _cache.get_value("app_modules")
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 69, in get_value
19:03:42 schedule.1       |     val = pickle.loads(val)
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dill/dill.py", line 299, in loads
19:03:42 schedule.1       |     return load(file)
19:03:42 schedule.1       |   File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/dill/dill.py", line 288, in load
19:03:42 schedule.1       |     obj = pik.load()
19:03:42 schedule.1       |   File "/usr/lib/python2.7/pickle.py", line 864, in load
19:03:42 schedule.1       |     dispatch[key](self)
19:03:42 schedule.1       |   File "/usr/lib/python2.7/pickle.py", line 892, in load_proto
19:03:42 schedule.1       |     raise ValueError, "unsupported pickle protocol: %d" % proto
19:03:42 schedule.1       | ValueError: unsupported pickle protocol: 3

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
achillesrasquinhacommented, Mar 20, 2018

Fixed! Also if you’ve got pickling issues, I’d suggest you a bench clear-cache Or maybe a FLUSHALL would work within redis-cli too. Does pretty much the same.

Brave enough, remove dump.rdb

0reactions
ahmadpakcommented, Dec 4, 2020

@achillesrasquinha I had to restart the server. redid-cli FLUSHALL did not work for me. But thanks it gave me the idea

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Cannot call web site Django with sub domain name
I used to develop ASP.NET and deploy on IIS Server, there is no problem with this issue. This is my configuration both in...
Read more >
Common migration problems — Supporting Python 3
The import fixer will look at your imports and look at your local modules and packages, and if the import is local, it...
Read more >
Porting Python 2 Code to Python 3 — Python 3.11.1 ...
This guide is meant to help you figure out how best to support both Python 2 & 3 simultaneously. If you are looking...
Read more >
Why is the Migration to Python 3 Taking So Long?
After many years of hard work towards that goal from the core committers, and surrounding community of libraries, Python 2 is finally at...
Read more >
Python 2.7 to 3.X Migration Guide - STX Next
Anything lower than Python 3.5 would be ill-advised, since it is already the ... Even if you just started thinking about migrating to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found