Bench Udpate error

While trying to update the bench, getting this error.

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in 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 mai
n
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line
722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line
697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line
1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line
1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line
895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line
535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/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 _fun
c
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 294, in backup
odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backu
p_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, force=T
rue)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 166, in schedul
ed_backup
odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_fi
les=backup_path_files, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 176, in new_bac
odb.get_backup(older_than, ignore_files, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 48, in get_back
up
self.set_backup_file_name()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 63, in set_back
up_file_name
todays_date = now_datetime().strftime(’%Y%m%d
%H%M%S’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 122, in now_dateti
me
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 145, in convert_ut
c_to_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 139, in get_time_z
one
return frappe.cache().get_value(“time_zone”, _get_time_zone)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in ge
t_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 133, in get_time
zone
return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 871, in get_system_s
etting
return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in ge
t_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 870, in _load_system
settings
return self.get_singles_dict(“System Settings”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 555, in get_singles

dict
tabSingles where doctype=%s""", doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 136, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 86, in connect
charset=‘utf8mb4’, use_unicode = True, conv = conversions)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/init.py”
, line 90, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.
py”, line 699, in init
self.connect()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.
py”, line 936, in connect
self._request_authentication()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.
py”, line 1156, in _request_authentication
auth_packet = self._read_packet()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.
py”, line 1018, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.
py”, line 384, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, lin
e 107, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, u"Access denied for user ‘6d4b9452aef14153’@‘localhost’
(using password: YES)")
shreyasdk@vittierp:/home/frappe/frappe-bench$

Did you change anything in your site_config file?

No changes in the site_config file.

I had exactly the same problem when updating to Version 10. I didn’t know, why it happened, but I knew how to solve it. Probably not the best solution, but it’s working.

I changed the Host in the mysql user table from localhost to % and the Host in the mysql db table to %. Please note, if you don’t know exactly what that means, I can not suggest this as a solution.

After that changes, flushing the privileges via SQL query and restarting mysql, it worked.

2 Likes

Hi,
Your solution works. Thank you.
However the database will be inaccessible by Frappe, if we revert both ‘Host’ values back to ‘localhost’, after changing it to ‘%’ and successfully running ‘bench update’.
Therefore, same as you, I am now sure if this is the best solution.

Used the bench setup command. This did the entire reconfigure of the site and database.

Thank you all for the support.