Error will upgrading to ver 10.1.30

Dear all,

I have the below error while running bench update, any quick fix?

Backing up sites...
Patching sites...
Migrating proactglobal.com
Executing erpnext.patches.v10_0.set_qty_in_transactions_based_on_serial_no_input in proactglobal.com (1bd3e0294da19198)
Traceback (most recent call last):
  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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-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/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v10_0/set_qty_in_transactions_based_on_serial_no_input.py", line 12, in execute
    ss.save()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 305, in _save
    self.update_single(self.get_valid_dict())
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 411, in update_single
    values (%s, %s, %s)""", (self.doctype, field, value))
  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.DataError: (1406, u"Data too long for column 'field' at row 1")

try bench update --patch

Hello, still the same error appears. I’ll appreciate some more help please.

What does this “Data too long for column ‘field’ at row 1” mean?

Regards,
Ahmed

Ok, firstly the problem is occurred in this patch and this is its path erpnext/patches/v10_0/set_qty_in_transactions_based_on_serial_no_input.py in the execute function, so the error occurred when this function tries to save the stock setting doctype object instance which is ss the problem is a column of the stock setting table in database exceeds its size of bytes according to its share in the overall size of the row size, the theory says that “”" There is an hard limit on how much data can be stored in a single row of a mysql table, regardless of the number of columns or the individual column length “”" so because the columns of the stock setting table increased due to the last update as new features the column size exceed its permitted size, So Check if you have UTF8 charcters stored in the stock settings field like for example: ARABIC letters cause UTF8 characters need more memory space than others,

hope this helps

Dear Madi, thanks for your help. But I am afraid I still don’t know what to
do. It seems to me that it’s an issue with that latest serial related
patch. If it’s the case then I think it needs someone from the development
team to interfere, right?

Regards,
Ahmed

Yes may its because of this newly added field “set_qty_in_transactions_based_on_serial_no_input”
which is stored under field column as a value in the table tabSingles I think its name is quiet long @nabinhait do you have an idea what is happening ?

Pushed a fix in latest release.

1 Like

@ahmed_personal
here you go a new fixing patch is there

1 Like