A question about DNS-based multitenancy

When I use DNS-based multitenancy to manage ERPNext sites, after creating a new site, I am ready to initialize ERPNext with the administrator. However, when I click login, it always prompts “Something went wrong,” and then it reports “Internal Server Error.”

Only after executing the command bench update --patch --no-backup can I log in normally.

What is the reason for this?

App version:
frappe 15.46.0
erpnext 15.40.0

Try running bench migrate right after creating a new site. This applies migrations and patches immediately, reducing the chance of login issues.

Thank you very much! This is the truth!