ERPNext Conference 2019* ERPNext.com Blog

Getting TypeError: a bytes-like object is required, not ‘list’ on switching from staging to master v11


#1

hi Team,

am now getting a new error which is

Migrating jaydcosmetics.co.ke
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
“main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 33, in migrate
frappe.model.sync.sync_all(verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 16, in sync_all
block_user(True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 118, in block_user
frappe.db.set_global(’__session_status’, block and ‘stop’ or None)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 719, in set_global
self.set_default(key, val, user)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 727, in set_default
frappe.defaults.set_default(key, val, parent, parenttype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py”, line 109, in set_default
add_default(key, value, parent)
File “/home/frappe/frappe-bench/apps/frappe/frappe/defaults.py”, line 120, in add_default
d.insert(ignore_permissions=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 210, in insert
self._set_defaults()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 585, in _set_defaults
new_doc = frappe.new_doc(self.doctype, as_dict=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 614, in new_doc
return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 20, in get_new_doc
frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 41, in make_new_doc
set_user_and_static_default_values(doc)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/create_new.py”, line 51, in set_user_and_static_default_values
user_permissions = get_user_permissions()
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user_permission/user_permission.py”, line 67, in get_user_permissions
fields=[‘allow’, ‘for_value’], filters=dict(user=user)):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1177, in get_all
return get_list(doctype, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1150, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 88, in execute
result = self.build_and_run()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 100, in build_and_run
args = self.prepare_args()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 119, in prepare_args
self.build_conditions()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 288, in build_conditions
self.build_filter_conditions(self.filters, self.conditions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 309, in build_filter_conditions
conditions.append(self.prepare_filter_condition(f))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 380, in prepare_filter_condition
value = ‘"{0}"’.format(frappe.db.escape(value, percent=False))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 904, in escape
s = text_type(pymysql.escape_string(s), “utf-8”).replace("", “\”)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/pymysql/converters.py”, line 73, in _escape_unicode
return value.translate(_escape_table)
TypeError: a bytes-like object is required, not ‘list’

this happened when I tried to switch from staging to master as directed above.

kindly help.


#2

kindly guys help with this


#3

I was able to solve this by by doing git pull, then git add . In apps folder.
Then in frappe folder do sudo chown -R frappe:frappe *.
Then I did the switch from staging to master [Release] Instructions for updating to/staying on v10/v11

Then do bench update.


#4

Hi there, sorry complete scrub. Can you help me with the ‘doing git pull, then git add’ part?


#5

Just do cd /home/frappe/frappe-bench/apps/frappe to switch to apps folder and frappe the run
git pull
git add . (include the dot at the end)

switch to cd /home/frappe/frappe-bench/apps/erpnext and run
git pull
git add . (include the dot at the end)