Automated update scheduler bench enable-scheduler error

after following the tutorial in the “GitHub - tkosin/ERPNext-GCP-Installation: This repository is created for developing the documentation to deploy your ERPNext on Google Cloud Platform.”. i tried to run the command “bench enable-scheduler” but getting following error

File “/usr/lib/python2.7/runpy.py”, line 174, 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/erpnext/erpnext-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/erpnext/erpnext-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/erpnext/erpnext-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/commands/scheduler.py”, line 43, in enable_scheduler
frappe.utils.scheduler.enable_scheduler()
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/scheduler.py”, line 243, in enable_scheduler
toggle_scheduler(True)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/scheduler.py”, line 240, in toggle_scheduler
frappe.db.set_value(“System Settings”, None, “enable_scheduler”, 1 if enable else 0)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/database.py”, line 711, in set_value
modified = now()
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/data.py”, line 159, in now
return now_datetime().strftime(DATETIME_FORMAT)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/data.py”, line 126, in now_datetime
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/data.py”, line 149, in convert_utc_t
o_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/data.py”, line 143, in get_time_zone
return frappe.cache().get_value(“time_zone”, _get_time_zone)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 79, in get_v
alue
val = generator()
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/data.py”, line 137, in _get_time_zon
e
return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’ # Default to India ?!
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/database.py”, line 950, in get_system_sett
ing
return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 79, in get_v
alue
val = generator()
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/database.py”, line 949, in _load_system_se
ttings
return self.get_singles_dict(“System Settings”)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/database.py”, line 610, in get_singles_dic
t
“”“, doctype)
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/database.py”, line 165, in sql
self.connect()
File “/home/erpnext/erpnext-bench/apps/frappe/frappe/database.py”, line 115, in connect
charset=‘utf8mb4’, use_unicode = True, conv = conversions, local_infile = self.local_infile)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/init.py”, l
ine 94, in Connect
return Connection(*args, **kwargs)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”
, line 325, in init
self.connect()
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”
, line 599, in connect
self._request_authentication()
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”
, line 861, in _request_authentication
auth_packet = self._read_packet()
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”
, line 684, in _read_packet
packet.check_error()
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/protocol.py”, l
ine 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/erpnext/erpnext-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 1
09, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, u"Access denied for user ‘erpnext’@‘localhost’ (using passwo
rd: NO)”)

Hi welcome to ERPNext

A search on pymysql.err.OperationalError: (1045, u"Access denied for user will give you checks and advice to try like this Bench update i get this - pymysql.err.OperationalError: (1045, u"Access denied for user

was not helpful, because my error has password use as NO
pymysql.err.OperationalError: (1045, u"Access denied for user ‘erpnext’@‘localhost’ (using passwo
rd: NO)")

ok yes using password: NO means the user erpnext did not use a password to login

The problem is that user account does not have access privileges to connect to the database.

Here you will find troubleshooting tips https://dev.mysql.com/doc/mysql-security-excerpt/5.7/en/problems-connecting.html

If you get an Access denied error when trying to connect to the database with mysql -u user_name, you may have a problem with the user table. Check this by executing mysql -u root mysql and issuing this SQL statement:

SELECT * FROM user;

Given erpnext is the database name (synonymous with user in mysql) that you specified here:

bench new-site --db-name erpnext erp.site.io

Both the previous link and this one will help resolve your connect problem