Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Data too long for column 'stock_queue' (backport #40436) #40451

Merged

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 14, 2024

Getting below error during site migration

File "/home/frappe/frappe-bench/apps/frappe/frappe/database/schema.py", line 44, in sync
    self.alter()
      self = <frappe.database.mariadb.schema.MariaDBTable object at 0x7f75420c2d40>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/schema.py", line 113, in alter
    frappe.db.sql(query)
      self = <frappe.database.mariadb.schema.MariaDBTable object at 0x7f75420c2d40>
      col = <frappe.database.schema.DbColumn object at 0x7f75420c3af0>
      add_column_query = ['ADD COLUMN `is_adjustment_entry` int(1) not null default 0']
      modify_column_query = ['MODIFY `stock_value_difference` decimal(21,9) not null default 0', 'MODIFY `qty_after_transaction` decimal(21,9) not null default 0', 'MODIFY `stock_queue` text', 'MODIFY `incoming_rate` decimal(21,9) not null default 0', 'MODIFY `valuation_rate` decimal(21,9) not null default 0', 'MODIFY `outgoing_rate` decimal(21,9) not null default 0', 'MODIFY `actual_qty` decimal(21,9) not null default 0', 'MODIFY `stock_value` decimal(21,9) not null default 0']
      add_index_query = []
      drop_index_query = ['DROP INDEX `voucher_type`']
      columns_to_modify = {<frappe.database.schema.DbColumn object at 0x7f75420c2650>, <frappe.database.schema.DbColumn object at 0x7f75420c2c80>, <frappe.database.schema.DbColumn object at 0x7f75420c2ef0>, <frappe.database.schema.DbColumn object at 0x7f75420c2d10>, <frappe.database.schema.DbColumn object at 0x7f75420c2140>, <frappe.database.schema.DbColumn object at 0x7f75420c2560>, <frappe.database.schema.DbColumn object at 0x7f75420c23b0>, <frappe.database.schema.DbColumn object at 0x7f75420c37c0>}
      current_column = {'name': 'voucher_type', 'type': 'varchar(140)', 'default': 'NULL', 'index': 1, 'unique': 0}
      unique_constraint_changed = False
      index_constraint_changed = True
      index_record = {'Table': 'tabStock Ledger Entry', 'Non_unique': 1, 'Key_name': 'voucher_type', 'Seq_in_index': 1, 'Column_name': 'voucher_type', 'Collation': 'A', 'Cardinality': 10, 'Sub_part': None, 'Packed': None, 'Null': 'YES', 'Index_type': 'BTREE', 'Comment': '', 'Index_comment': '', 'Ignored': 'NO'}
      query_parts = ['MODIFY `stock_value_difference` decimal(21,9) not null default 0', 'MODIFY `qty_after_transaction` decimal(21,9) not null default 0', 'MODIFY `stock_queue` text', 'MODIFY `incoming_rate` decimal(21,9) not null default 0', 'MODIFY `valuation_rate` decimal(21,9) not null default 0', 'MODIFY `outgoing_rate` decimal(21,9) not null default 0', 'MODIFY `actual_qty` decimal(21,9) not null default 0', 'MODIFY `stock_value` decimal(21,9) not null default 0']
      query_body = 'MODIFY `stock_value_difference` decimal(21,9) not null default 0, MODIFY `qty_after_transaction` decimal(21,9) not null default 0, MODIFY `stock_queue` text, MODIFY `incoming_rate` decimal(21,9) not null default 0, MODIFY `valuation_rate` decimal(21,9) not null default 0, MODIFY `outgoing_rate` decimal(21,9) not null default 0, MODIFY `actual_qty` decimal(21,9) not null default 0, MODIFY `stock_value` decimal(21,9) not null default 0'
      query = 'ALTER TABLE `tabStock Ledger Entry` MODIFY `stock_value_difference` decimal(21,9) not null default 0, MODIFY `qty_after_transaction` decimal(21,9) not null default 0, MODIFY `stock_queue` text, MODIFY `incoming_rate` decimal(21,9) not null default 0, MODIFY `valuation_rate` decimal(21,9) not null default 0, MODIFY `outgoing_rate` decimal(21,9) not null default 0, MODIFY `actual_qty` decimal(21,9) not null default 0, MODIFY `stock_value` decimal(21,9) not null default 0'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 244, in sql
    self._cursor.execute(query, values)
      self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f7543ddfb50>
      query = 'ALTER TABLE `tabStock Ledger Entry` MODIFY `stock_value_difference` decimal(21,9) not null default 0, MODIFY `qty_after_transaction` decimal(21,9) not null default 0, MODIFY `stock_queue` text, MODIFY `incoming_rate` decimal(21,9) not null default 0, MODIFY `valuation_rate` decimal(21,9) not null default 0, MODIFY `outgoing_rate` decimal(21,9) not null default 0, MODIFY `actual_qty` decimal(21,9) not null default 0, MODIFY `stock_value` decimal(21,9) not null default 0'
      values = None
      as_dict = 0
      as_list = 0
      formatted = 0
      debug = False
      ignore_ddl = 0
      as_utf8 = 0
      auto_commit = 0
      update = None
      explain = False
      run = True
      pluck = False
      as_iterator = False
      trace_id = None
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
      self = <pymysql.cursors.Cursor object at 0x7f754325a740>
      query = 'ALTER TABLE `tabStock Ledger Entry` MODIFY `stock_value_difference` decimal(21,9) not null default 0, MODIFY `qty_after_transaction` decimal(21,9) not null default 0, MODIFY `stock_queue` text, MODIFY `incoming_rate` decimal(21,9) not null default 0, MODIFY `valuation_rate` decimal(21,9) not null default 0, MODIFY `outgoing_rate` decimal(21,9) not null default 0, MODIFY `actual_qty` decimal(21,9) not null default 0, MODIFY `stock_value` decimal(21,9) not null default 0'
      args = None
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
      self = <pymysql.cursors.Cursor object at 0x7f754325a740>
      q = 'ALTER TABLE `tabStock Ledger Entry` MODIFY `stock_value_difference` decimal(21,9) not null default 0, MODIFY `qty_after_transaction` decimal(21,9) not null default 0, MODIFY `stock_queue` text, MODIFY `incoming_rate` decimal(21,9) not null default 0, MODIFY `valuation_rate` decimal(21,9) not null default 0, MODIFY `outgoing_rate` decimal(21,9) not null default 0, MODIFY `actual_qty` decimal(21,9) not null default 0, MODIFY `stock_value` decimal(21,9) not null default 0'
      conn = <pymysql.connections.Connection object at 0x7f754325a680>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
      self = <pymysql.connections.Connection object at 0x7f754325a680>
      sql = b'ALTER TABLE `tabStock Ledger Entry` MODIFY `stock_value_difference` decimal(21,9) not null default 0, MODIFY `qty_after_transaction` decimal(21,9) not null default 0, MODIFY `stock_queue` text, MODIFY `incoming_rate` decimal(21,9) not null default 0, MODIFY `valuation_rate` decimal(21,9) not null default 0, MODIFY `outgoing_rate` decimal(21,9) not null default 0, MODIFY `actual_qty` decimal(21,9) not null default 0, MODIFY `stock_value` decimal(21,9) not null default 0'
      unbuffered = False
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
      self = <pymysql.connections.Connection object at 0x7f754325a680>
      unbuffered = False
      result = <pymysql.connections.MySQLResult object at 0x7f75420c3040>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
      self = <pymysql.connections.MySQLResult object at 0x7f75420c3040>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
      self = <pymysql.connections.Connection object at 0x7f754325a680>
      packet_type = <class 'pymysql.protocol.MysqlPacket'>
      buff = bytearray(b"\xff~\x05#22001Data too long for column \'stock_queue\' at row 363195")
      packet_header = b'=\x00\x00\x01'
      btrl = 61
      btrh = 0
      packet_number = 1
      bytes_to_read = 61
      recv_data = b"\xff~\x05#22001Data too long for column 'stock_queue' at row 363195"
      packet = <pymysql.protocol.MysqlPacket object at 0x7f75420c26b0>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
      self = <pymysql.protocol.MysqlPacket object at 0x7f75420c26b0>
      errno = 1406
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
      data = b"\xff~\x05#22001Data too long for column 'stock_queue' at row 363195"
      errno = 1406
      errval = "Data too long for column 'stock_queue' at row 363195"
      errorclass = <class 'pymysql.err.DataError'>
pymysql.err.DataError: (1406, "Data too long for column 'stock_queue' at row 363195")
```<hr>This is an automatic backport of pull request #40436 done by [Mergify](https://mergify.com).

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Mar 14, 2024
@rohitwaghchaure rohitwaghchaure merged commit ba6b856 into version-15-hotfix Mar 14, 2024
11 of 12 checks passed
@rohitwaghchaure rohitwaghchaure deleted the mergify/bp/version-15-hotfix/pr-40436 branch March 14, 2024 06:19
frappe-pr-bot pushed a commit that referenced this pull request Mar 20, 2024
## [15.17.2](v15.17.1...v15.17.2) (2024-03-20)

### Bug Fixes

* achieved targets for sales partners ([1ac8887](1ac8887))
* advance journal fetching logic in Advances section ([bfa78aa](bfa78aa))
* attribute error on Bank Statement Import retry ([a0bf22c](a0bf22c))
* auto-update due date for invoices via data import ([9cdde50](9cdde50))
* balance qty in the stock ledger report (backport [#40506](#40506)) ([#40507](#40507)) ([69f442d](69f442d))
* currency symbol for Landed Cost Voucher Amount (backport [#40550](#40550)) ([#40554](#40554)) ([1c90797](1c90797))
* Data too long for column 'stock_queue' (backport [#40436](#40436)) ([#40451](#40451)) ([ba6b856](ba6b856))
* don't validate for currency, if account is unavailable ([5729ee5](5729ee5))
* flaky Accounts Receivable test case ([0bb4a7d](0bb4a7d))
* incorrect gross profit on the quotation (backport [#40438](#40438)) ([#40442](#40442)) ([ce2626e](ce2626e))
* index error on Exchange Rate Revaluation creation ([ebd967d](ebd967d))
* invalid exchange loss booking on invoice againts base accounts ([72c9cd5](72c9cd5))
* missing range for ageing summary ([dacc69c](dacc69c))
* not able to delete cancelled delivery note (backport [#40508](#40508)) ([#40510](#40510)) ([917a21b](917a21b))
* rate changing while making PR (negative discount) (backport [#40539](#40539)) ([#40540](#40540)) ([0bdda12](0bdda12))
* Remove custom queries for customer ([3133505](3133505))
* serial and batch for internal transfer (backport [#40467](#40467)) ([#40477](#40477)) ([61d59b3](61d59b3))
* show correct variance for durations with no vouchers ([bc78bc3](bc78bc3))
* stock reco negative batch (backport [#40533](#40533)) ([#40535](#40535)) ([7f1f780](7f1f780))
* stopped mr showing in the popup (backport [#40478](#40478)) ([#40480](#40480)) ([74b30a6](74b30a6))
* **Supplier Quotation Comparison:** group by options ([1e16d2c](1e16d2c))
* Taxes not getting updated on change ([75b610d](75b610d))
* **test:** manually filter rows and assert ([df13517](df13517))
* Update Existing Price List Rate not working (backport [#40333](#40333)) ([#40527](#40527)) ([44bbf4b](44bbf4b))
* use in_import flag for checking imported records ([8242a9c](8242a9c))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 15.17.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-tests This PR needs automated unit-tests. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants