Update issue on 8.5

Hi

I was trying to update erpnext today from 8.5 to latest.

but when I use bench update command it gives me below error.

self.set_backup_file_name()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 63, in set_backup_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 121, in now_datetime
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 144, in convert_utc_to_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 138, in get_time_zone
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 get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 132, 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 872, in get_system_setting
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 get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 871, in _load_system_settings
return self.get_singles_dict(“System Settings”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 545, in get_singles_dict
tabSingles where doctype=%s"“”, doctype))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 123, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 69, in connect
use_unicode=True, charset=‘utf8mb4’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 86, in Connect
return Connection(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 204, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, “Access denied for user ‘3aac30ef9633302a’@‘localhost’ (using password: YES)”)

The error appears while performing backup before upgrade where mysql user ‘3aac30ef9633302a’@‘localhost’ is not able to authenticate, but I found there is no such user, so I have created one but that doesn’t helped.

then I found this username and password is located on sites/site2name/site_config.json

{
“db_name”: “3aac30ef9633302a”,
“db_password”: " "
}

I am using multiple sited based on dns name on the same server.

Now what could be the issue ? because of unfinished update the erp is not functioning proper please let me know your suggestion.

If possible you can try to reset the dB password via mysql and update the password in the site config file and see if it solves your issue.

Hi @Pawan

I got the resolution, it was not about the miss configuration of username and password of the existing site, when I checked the site folder and mysql databases, and reviewed it, then I found there is one extra site which is there in the site folder but not in the mysql database, and that site was incomplete and it was not required also, so I removed that folder, after that the update went successfully.

anyway thanks for the help @Pawan.

but it seems it was too early to post the problem here before full review.

Thanks guys!!!

1 Like

Thanks a lot for describing the steps you took, @deepak727. I faced the same problem and fixed it with a help of your description.
Is there any way to determine which site corresponds to which database?

Okay, I’ve found the answer — the name of database is a SHA1 hash value of site name.