question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Naming series issue: Data too long for column 'name'

See original GitHub issue

Description of the issue

While saving documents with custom naming series, throwing below error: Data too long for column name

image

Context information (for bug reports)

Output of bench version

ERPNext: v13.35.2 (HEAD)
Frappe Framework: v13.35.1 (HEAD)

Steps to reproduce the issue

  1. Custom series for journal entry : JV-.YY.-.{code}…#### where code is data field in journal entry that has maximum of 4 characters
  2. Create journal entry with new series and code as for eg. DXB
  3. Error pymsql.err.DataError : (1406, “Data too long for column ‘name’ at row 1”)

Observed result

It is not a new series. There are already couple of documents saved with this series. Then after the latest release (13.35) the issue started

Expected result

Should be saved with next counter.

Additional information

When checked the code, the issue is in passing the key to get series in frappe/model/naming.py. elif doc and doc.get(e): part = (cstr(doc.get(e)) or “”).strip()

should be replaced with

elif doc and doc.get(e): part = doc.get(e)

As it is passing the entire dict causing data too long error

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ankushcommented, Jul 14, 2022

temporary fix remove duplicate dot in your naming series

JV-.YY.-.{code}..#### -> JV-.YY.-.{code}.####

0reactions
ankushcommented, Jul 14, 2022

Updating to 13.35.2 of framework should fix this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data too long for column error - Databricks Knowledge Base
Problem You are trying to insert a struct into a table, but you get a java.sql.SQLException: Data too long for column error.
Read more >
How to fix data too long for column - Stack Overflow
I've done some searching and I see the error is common for varchar, and people say to switch to longtext, however the project...
Read more >
Data too long for column error - Azure Databricks
If a column exceeds 4000 characters it is too big for the default datatype and returns an error.
Read more >
What is the MySQL error: “Data too long for column”?
The “Data too long for column” error occurs when you insert more data for a column that does not have the capability to...
Read more >
MySQL 8.0 Reference Manual :: 13.2.9 LOAD DATA Statement
Assignments in the SET clause should have only column names on the left hand side of assignment operators. You can use subqueries in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found