V10 to V11 update

Hi
i had updated v10 to V11 using developer version.
after update it’s giving me this error

" File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 233, in insert self.db_insert() File "/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 303, in db_insert ), list(d.values())) File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 166, in sql self._cursor.execute(query, values) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute result = self._query(query) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query conn.query(q) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result result.read() File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read first_packet = self.connection._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", line 107, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.IntegrityError: (1048, u"Column 'track_views' cannot be null")"

Try this command first:
bench migrate

In version 11, there are a new track_views feature
it’s because it’s changed they updated the JSON files added a new column

 "track_changes": 0,
 "track_seen": 0,
 ++ "track_views": 0 (Added this in new version)

so it should be a bug that it’s not initialized automatically to 0 during database migration if you performed it

so have you tried bench migrate to ensure that the database is migrated correctly? otherwise, you would either have to continue with a fresh new database or initialize your database manually.

Bench Commands Cheatsheet:
https://frappe.io/docs/user/en/bench/resources/bench-commands-cheatsheet.html

bench migrate Will read JSON files and make changes to the database accordingly

2 Likes

Hi
Thanks i had fix this by running fowling command

bench mariadb
alter table tabDocPerm modify column apply_user_permissions int(1) NULL default 0;
exit
bench update --patch

after this its working perfect .

Also if you have error for user permission you can run fowling

pymysql.err.IntegrityError: (1048, u"Column ‘apply_user_permissions’ cannot be null")

bench mariadb
alter table tabDocPerm modify column apply_user_permissions int(1) NULL default 0;
exit
bench update --patch

4 Likes