pymysql.err.OperationalError: (4091, "Unknown SEQUENCE: 'version_id_seq'")

Has anyone experienced this before? Seems to happen when I start creating new DocTypes.

Hello,
i get this error too after upgrade from v13 to v14 and restoring my v13 database. Looking for a solution too.

Try updating the Naming Rule to auto-increment or other options.

This is how I solved my problem just now.

Hope that helps.

1 Like

Thank you so much @Rufo_Gabrillo. I got this error gone after multiple re-installs of erpnext.
I guess your suggestion may be useful at next update. Thanks

FWIW we did resolve this: fix: autoincr status per doctype by ankush · Pull Request #21918 · frappe/frappe · GitHub

It was kind of a mix bag of edge cases and bad design:

  • Some old doctype having autoincrement primary key and some not.
  • Incorrectly configured permissions in mysql showing information schema values for other tables. (this is more of config problem than code though)

Both should be resolved in next update.

1 Like