zun.common.exception pymysql.err.DataError 1406, “Data too long for column ‘exposed_ports‘ at row 1“

本文主要是介绍zun.common.exception pymysql.err.DataError 1406, “Data too long for column ‘exposed_ports‘ at row 1“,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

openstack中管理容器暴露范围端口,转换为单个端口,端口暴露包括 tcp和udp 协议,出现个数过多,数据过长,zun-api请求报错如下:

2021-10-21 19:14:49.926 2925 ERROR zun.common.exception [req-b037140d-79d6-4a91-9fcd-926321baf4b1 - - - - -] ab065d5e-faf3-4e28-b88b-551336ab3985:(pymysql.err.DataError) (1406, “Data too long for column ‘exposed_ports’ at row 1”)
[SQL: INSERT INTO container (created_at, updated_at, project_id, user_id, uuid, container_id, name, image, cpu, cpu_policy, cpuset, command, memory, status, status_reason, task_state, environment, workdir, ports, hostname, labels, meta, addresses, image_pull_policy, host, restart_policy, status_detail, interactive, tty, image_driver, websocket_url, websocket_token, security_groups, auto_remove, runtime, disk, auto_heal, capsule_id, started_at, privileged, healthcheck, exposed_ports, registry_id, container_type) VALUES (%(created_at)s, %(updated_at)s, %(project_id)s, %(user_id)s, %(uuid)s, %(container_id)s, %(name)s, %(image)s, %(cpu)s, %(cpu_policy)s, %(cpuset)s, %(command)s, %(memory)s, %(status)s, %(status_reason)s, %(task_state)s, %(environment)s, %(workdir)s, %(ports)s, %(hostname)s, %(labels)s, %(meta)s, %(addresses)s, %(image_pull_policy)s, %(host)s, %(restart_policy)s, %(status_detail)s, %(interactive)s, %(tty)s, %(image_driver)s, %(websocket_url)s, %(websocket_token)s, %(security_groups)s, %(auto_remove)s, %(runtime)s, %(disk)s, %(auto_heal)s, %(capsule_id)s, %(started_at)s, %(privileged)s, %(healthcheck)s, %(exposed_ports)s, %(registry_id)s, %(container_type)s)]
[parameters: {‘created_at’: datetime.datetime(2021, 10, 21, 11, 14, 49, 195735), ‘updated_at’: None, ‘project_id’: ‘cb5388a3555346d0b224b45a1fc0aa2e’, ‘user_id’: ‘8e949daa55634ef48777ecd989daa6ab’, ‘uuid’: ‘78a36eee-c370-4415-b473-4ad28425f94c’, ‘container_id’: None, ‘name’: ‘9be5e7ba0fb840ed9b36eed483c2af10’, ‘image’: ‘d30a9dbc-1f75-4179-8f66-cca641848277’, ‘cpu’: 2.0, ‘cpu_policy’: ‘shared’, ‘cpuset’: b’{}’, ‘command’: b’[]’, ‘memory’: ‘1024’, ‘status’: ‘Creating’, ‘status_reason’: None, ‘task_state’: None, ‘environment’: b’{“USERNAME”: “admin111”, “PASSWORD”: “ppp@ssw0rd”, “BASEPATH”: “/bbbbb001”, “HOOKJS”: “/obama.js”, “WEBPORT”: “4444/tcp”, “ssh_port”: “22/tcp”, “HTT … (4 characters truncated) … XY”: “6789/tcp”, “NAT_SERVER_TOKEN”: “e0ee37bf-1257-40fc-9682-0ac98e6f60b5”, “NAT_SERVER_ADDR”: “192.168.1.1”, “NAT_CLIENT_EXPOSE_PORT”: “5678-9999”}’, ‘workdir’: None, ‘ports’: b’[]’, ‘hostname’: ‘beef’, ‘labels’: b’{}’, ‘meta’: b’{}’, ‘addresses’: b’{}’, ‘image_pull_policy’: None, ‘host’: None, ‘restart_policy’: b’{}’, ‘status_detail’: None, ‘interactive’: 1, ‘tty’: 1, ‘image_driver’: ‘glance’, ‘websocket_url’: None, ‘websocket_token’: None, ‘security_groups’: b’[]’, ‘auto_remove’: 0, ‘runtime’: ‘runc’, ‘disk’: 5, ‘auto_heal’: 0, ‘capsule_id’: None, ‘started_at’: None, ‘privileged’: 1, ‘healthcheck’: b’{}’, ‘exposed_ports’: b’{“4444/tcp”: {}, “22/tcp”: {}, “6789/tcp”: {}, “5678/tcp”: {}, “5678/udp”: {}, “5679/tcp”: {}, “5679/udp”: {}, “5680/tcp”: {}, “5680/udp”: {}, "5681 … (138037 characters truncated) … : {}, “9995/udp”: {}, “9996/tcp”: {}, “9996/udp”: {}, “9997/tcp”: {}, “9997/udp”: {}, “9998/tcp”: {}, “9998/udp”: {}, “9999/tcp”: {}, “9999/udp”: {}}’, ‘registry_id’: None, ‘container_type’: 0}]
(Background on this error at: http://sqlalche.me/e/9h9h): oslo_db.exception.DBDataError: (pymysql.err.DataError) (1406, “Data too long for column ‘exposed_ports’ at row 1”)
[SQL: INSERT INTO container (created_at, updated_at, project_id, user_id, uuid, container_id, name, image, cpu, cpu_policy, cpuset, command, memory, status, status_reason, task_state, environment, workdir, ports, hostname, labels, meta, addresses, image_pull_policy, host, restart_policy, status_detail, interactive, tty, image_driver, websocket_url, websocket_token, security_groups, auto_remove, runtime, disk, auto_heal, capsule_id, started_at, privileged, healthcheck, exposed_ports, registry_id, container_type) VALUES (%(created_at)s, %(updated_at)s, %(project_id)s, %(user_id)s, %(uuid)s, %(container_id)s, %(name)s, %(image)s, %(cpu)s, %(cpu_policy)s, %(cpuset)s, %(command)s, %(memory)s, %(status)s, %(status_reason)s, %(task_state)s, %(environment)s, %(workdir)s, %(ports)s, %(hostname)s, %(labels)s, %(meta)s, %(addresses)s, %(image_pull_policy)s, %(host)s, %(restart_policy)s, %(status_detail)s, %(interactive)s, %(tty)s, %(image_driver)s, %(websocket_url)s, %(websocket_token)s, %(security_groups)s, %(auto_remove)s, %(runtime)s, %(disk)s, %(auto_heal)s, %(capsule_id)s, %(started_at)s, %(privileged)s, %(healthcheck)s, %(exposed_ports)s, %(registry_id)s, %(container_type)s)]
[parameters: {‘created_at’: datetime.datetime(2021, 10, 21, 11, 14, 49, 195735), ‘updated_at’: None, ‘project_id’: ‘cb5388a3555346d0b224b45a1fc0aa2e’, ‘user_id’: ‘8e949daa55634ef48777ecd989daa6ab’, ‘uuid’: ‘78a36eee-c370-4415-b473-4ad28425f94c’, ‘container_id’: None, ‘name’: ‘9be5e7ba0fb840ed9b36eed483c2af10’, ‘image’: ‘d30a9dbc-1f75-4179-8f66-cca641848277’, ‘cpu’: 2.0, ‘cpu_policy’: ‘shared’, ‘cpuset’: b’{}’, ‘command’: b’[]’, ‘memory’: ‘1024’, ‘status’: ‘Creating’, ‘status_reason’: None, ‘task_state’: None, ‘environment’: b’{“USERNAME”: “admin111”, “PASSWORD”: “ppp@ssw0rd”, “BASEPATH”: “/bbbbb001”, “HOOKJS”: “/obama.js”, “WEBPORT”: “4444/tcp”, “ssh_port”: “22/tcp”, “HTT … (4 characters truncated) … XY”: “6789/tcp”, “NAT_SERVER_TOKEN”: “e0ee37bf-1257-40fc-9682-0ac98e6f60b5”, “NAT_SERVER_ADDR”: “192.168.1.1”, “NAT_CLIENT_EXPOSE_PORT”: “5678-9999”}’, ‘workdir’: None, ‘ports’: b’[]’, ‘hostname’: ‘beef’, ‘labels’: b’{}’, ‘meta’: b’{}’, ‘addresses’: b’{}’, ‘image_pull_policy’: None, ‘host’: None, ‘restart_policy’: b’{}’, ‘status_detail’: None, ‘interactive’: 1, ‘tty’: 1, ‘image_driver’: ‘glance’, ‘websocket_url’: None, ‘websocket_token’: None, ‘security_groups’: b’[]’, ‘auto_remove’: 0, ‘runtime’: ‘runc’, ‘disk’: 5, ‘auto_heal’: 0, ‘capsule_id’: None, ‘started_at’: None, ‘privileged’: 1, ‘healthcheck’: b’{}’, ‘exposed_ports’: b’{“4444/tcp”: {}, “22/tcp”: {}, “6789/tcp”: {}, “5678/tcp”: {}, “5678/udp”: {}, “5679/tcp”: {}, “5679/udp”: {}, “5680/tcp”: {}, “5680/udp”: {}, "5681 … (138037 characters truncated) … : {}, “9995/udp”: {}, “9996/tcp”: {}, “9996/udp”: {}, “9997/tcp”: {}, “9997/udp”: {}, “9998/tcp”: {}, “9998/udp”: {}, “9999/tcp”: {}, “9999/udp”: {}}’, ‘registry_id’: None, ‘container_type’: 0}]
(Background on this error at: http://sqlalche.me/e/9h9h)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception Traceback (most recent call last):
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception cursor, statement, parameters, context
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/default.py”, line 552, in do_execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception cursor.execute(statement, parameters)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception result = self._query(query)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception conn.query(q)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 517, in query
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception result.read()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception first_packet = self.connection._read_packet()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception packet.check_error()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception err.raise_mysql_exception(self._data)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception raise errorclass(errno, errval)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception pymysql.err.DataError: (1406, “Data too long for column ‘exposed_ports’ at row 1”)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception The above exception was the direct cause of the following exception:
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception Traceback (most recent call last):
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/common/exception.py”, line 110, in wrapped
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return func(*args, **kwargs)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/api/validation/init.py”, line 55, in wrapper
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return func(*args, **kwargs)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/api/validation/init.py”, line 33, in wrapper
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return func(*args, **kwargs)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/api/controllers/v1/containers.py”, line 286, in post
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return self._do_post(run, **container_dict)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/api/controllers/v1/containers.py”, line 413, in _do_post
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception new_container.create(context)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/oslo_versionedobjects/base.py”, line 226, in wrapper
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return fn(self, *args, **kwargs)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/objects/container.py”, line 239, in create
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception db_container = dbapi.create_container(context, values)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/osprofiler/profiler.py”, line 160, in wrapper
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception result = f(*args, **kwargs)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/db/api.py”, line 80, in create_container
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return _get_dbdriver_instance().create_container(context, values)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/db/sqlalchemy/api.py”, line 204, in create_container
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception container.save()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/zun/db/sqlalchemy/models.py”, line 104, in save
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception super(ZunBase, self).save(session)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/oslo_db/sqlalchemy/models.py”, line 48, in save
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception session.flush()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/session.py”, line 2459, in flush
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception self._flush(objects)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/session.py”, line 2597, in _flush
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception transaction.rollback(_capture_exception=True)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/langhelpers.py”, line 68, in exit
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception compat.reraise(exc_type, exc_value, exc_tb)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py”, line 153, in reraise
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception raise value
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/session.py”, line 2557, in _flush
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception flush_context.execute()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py”, line 422, in execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception rec.execute(self)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/unitofwork.py”, line 589, in execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception uow,
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py”, line 245, in save_obj
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception insert,
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/orm/persistence.py”, line 1138, in _emit_insert_statements
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception statement, params
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py”, line 988, in execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return meth(self, multiparams, params)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/sql/elements.py”, line 287, in _execute_on_connection
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception return connection._execute_clauseelement(self, multiparams, params)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1107, in _execute_clauseelement
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception distilled_params,
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1253, in _execute_context
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception e, statement, parameters, cursor, context
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1471, in _handle_dbapi_exception
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception util.raise_from_cause(newraise, exc_info)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py”, line 398, in raise_from_cause
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception reraise(type(exception), exception, tb=exc_tb, cause=cause)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/util/compat.py”, line 152, in reraise
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception raise value.with_traceback(tb)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/base.py”, line 1249, in _execute_context
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception cursor, statement, parameters, context
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib64/python3.6/site-packages/sqlalchemy/engine/default.py”, line 552, in do_execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception cursor.execute(statement, parameters)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception result = self._query(query)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception conn.query(q)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 517, in query
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception result.read()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception first_packet = self.connection._read_packet()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception packet.check_error()
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception err.raise_mysql_exception(self._data)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception File “/usr/local/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception raise errorclass(errno, errval)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception oslo_db.exception.DBDataError: (pymysql.err.DataError) (1406, “Data too long for column ‘exposed_ports’ at row 1”)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception [SQL: INSERT INTO container (created_at, updated_at, project_id, user_id, uuid, container_id, name, image, cpu, cpu_policy, cpuset, command, memory, status, status_reason, task_state, environment, workdir, ports, hostname, labels, meta, addresses, image_pull_policy, host, restart_policy, status_detail, interactive, tty, image_driver, websocket_url, websocket_token, security_groups, auto_remove, runtime, disk, auto_heal, capsule_id, started_at, privileged, healthcheck, exposed_ports, registry_id, container_type) VALUES (%(created_at)s, %(updated_at)s, %(project_id)s, %(user_id)s, %(uuid)s, %(container_id)s, %(name)s, %(image)s, %(cpu)s, %(cpu_policy)s, %(cpuset)s, %(command)s, %(memory)s, %(status)s, %(status_reason)s, %(task_state)s, %(environment)s, %(workdir)s, %(ports)s, %(hostname)s, %(labels)s, %(meta)s, %(addresses)s, %(image_pull_policy)s, %(host)s, %(restart_policy)s, %(status_detail)s, %(interactive)s, %(tty)s, %(image_driver)s, %(websocket_url)s, %(websocket_token)s, %(security_groups)s, %(auto_remove)s, %(runtime)s, %(disk)s, %(auto_heal)s, %(capsule_id)s, %(started_at)s, %(privileged)s, %(healthcheck)s, %(exposed_ports)s, %(registry_id)s, %(container_type)s)]
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception [parameters: {‘created_at’: datetime.datetime(2021, 10, 21, 11, 14, 49, 195735), ‘updated_at’: None, ‘project_id’: ‘cb5388a3555346d0b224b45a1fc0aa2e’, ‘user_id’: ‘8e949daa55634ef48777ecd989daa6ab’, ‘uuid’: ‘78a36eee-c370-4415-b473-4ad28425f94c’, ‘container_id’: None, ‘name’: ‘9be5e7ba0fb840ed9b36eed483c2af10’, ‘image’: ‘d30a9dbc-1f75-4179-8f66-cca641848277’, ‘cpu’: 2.0, ‘cpu_policy’: ‘shared’, ‘cpuset’: b’{}’, ‘command’: b’[]’, ‘memory’: ‘1024’, ‘status’: ‘Creating’, ‘status_reason’: None, ‘task_state’: None, ‘environment’: b’{“USERNAME”: “admin111”, “PASSWORD”: “ppp@ssw0rd”, “BASEPATH”: “/bbbbb001”, “HOOKJS”: “/obama.js”, “WEBPORT”: “4444/tcp”, “ssh_port”: “22/tcp”, “HTT … (4 characters truncated) … XY”: “6789/tcp”, “NAT_SERVER_TOKEN”: “e0ee37bf-1257-40fc-9682-0ac98e6f60b5”, “NAT_SERVER_ADDR”: “192.168.1.1”, “NAT_CLIENT_EXPOSE_PORT”: “5678-9999”}’, ‘workdir’: None, ‘ports’: b’[]’, ‘hostname’: ‘beef’, ‘labels’: b’{}’, ‘meta’: b’{}’, ‘addresses’: b’{}’, ‘image_pull_policy’: None, ‘host’: None, ‘restart_policy’: b’{}’, ‘status_detail’: None, ‘interactive’: 1, ‘tty’: 1, ‘image_driver’: ‘glance’, ‘websocket_url’: None, ‘websocket_token’: None, ‘security_groups’: b’[]’, ‘auto_remove’: 0, ‘runtime’: ‘runc’, ‘disk’: 5, ‘auto_heal’: 0, ‘capsule_id’: None, ‘started_at’: None, ‘privileged’: 1, ‘healthcheck’: b’{}’, ‘exposed_ports’: b’{“4444/tcp”: {}, “22/tcp”: {}, “6789/tcp”: {}, “5678/tcp”: {}, “5678/udp”: {}, “5679/tcp”: {}, “5679/udp”: {}, “5680/tcp”: {}, “5680/udp”: {}, "5681 … (138037 characters truncated) … : {}, “9995/udp”: {}, “9996/tcp”: {}, “9996/udp”: {}, “9997/tcp”: {}, “9997/udp”: {}, “9998/tcp”: {}, “9998/udp”: {}, “9999/tcp”: {}, “9999/udp”: {}}’, ‘registry_id’: None, ‘container_type’: 0}]
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception (Background on this error at: http://sqlalche.me/e/9h9h)
2021-10-21 19:14:49.926 2925 ERROR zun.common.exception


解决方法:

一、查看数据库设计,限制数据长度,也就是限制端口暴露的个数或者端口的范围大小:

mysql -uroot -p
use zun;
show tables;
desc container;

在这里插入图片描述
可以看到 exposed_ports 字段类型为 text 类型,在mysql中不同类型支持的长度如下:

TINYTEXT 256 bytes
TEXT 65,535 bytes ~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
LONGTEXT 4,294,967,295 bytes ~4GB

因此,你可以手动修改对应的数据表字段类型,但是一般不建议这么做。
可以采用在应用层做限制,根据 text 字段的长度,可以计算出支持的端口个数或者范围。

二、把容器的端口暴露改为关联一个安全组,安全组中添加若干个安全组规则,从而避免容器调用直接提供的参数暴露长度限制。


人生总有那么几步路需要自己鼓起勇气走完~

这篇关于zun.common.exception pymysql.err.DataError 1406, “Data too long for column ‘exposed_ports‘ at row 1“的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/480909

相关文章

论文翻译:arxiv-2024 Benchmark Data Contamination of Large Language Models: A Survey

Benchmark Data Contamination of Large Language Models: A Survey https://arxiv.org/abs/2406.04244 大规模语言模型的基准数据污染:一项综述 文章目录 大规模语言模型的基准数据污染:一项综述摘要1 引言 摘要 大规模语言模型(LLMs),如GPT-4、Claude-3和Gemini的快

CentOS下mysql数据库data目录迁移

https://my.oschina.net/u/873762/blog/180388        公司新上线一个资讯网站,独立主机,raid5,lamp架构。由于资讯网是面向小行业,初步估计一两年内访问量压力不大,故,在做服务器系统搭建的时候,只是简单分出一个独立的data区作为数据库和网站程序的专区,其他按照linux的默认分区。apache,mysql,php均使用yum安装(也尝试

使用Spring Boot集成Spring Data JPA和单例模式构建库存管理系统

引言 在企业级应用开发中,数据库操作是非常重要的一环。Spring Data JPA提供了一种简化的方式来进行数据库交互,它使得开发者无需编写复杂的JPA代码就可以完成常见的CRUD操作。此外,设计模式如单例模式可以帮助我们更好地管理和控制对象的创建过程,从而提高系统的性能和可维护性。本文将展示如何结合Spring Boot、Spring Data JPA以及单例模式来构建一个基本的库存管理系统

15 组件的切换和对组件的data的使用

划重点 a 标签的使用事件修饰符组件的定义组件的切换:登录 / 注册 泡椒鱼头 :微辣 <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-

12C 新特性,MOVE DATAFILE 在线移动 包括system, 附带改名 NID ,cdb_data_files视图坏了

ALTER DATABASE MOVE DATAFILE  可以改名 可以move file,全部一个命令。 resue 可以重用,keep好像不生效!!! system照移动不误-------- SQL> select file_name, status, online_status from dba_data_files where tablespace_name='SYSTEM'

INDEX+SMALL+IF+ROW函数组合使用解…

很多人在Excel中用函数公式做查询的时候,都必然会遇到的一个大问题,那就是一对多的查找/查询公式应该怎么写?大多数人都是从VLOOKUP、INDEX+MATCH中入门的,纵然你把全部的多条件查找方法都学会了而且运用娴熟,如VLOOKUP和&、SUMPRODUCT、LOOKUP(1,0/....,但仍然只能对这种一对多的查询望洋兴叹。   这里讲的INDEX+SMALL+IF+ROW的函数组合,

SIGMOD-24概览Part7: Industry Session (Graph Data Management)

👇BG3: A Cost Effective and I/O Efficient Graph Database in ByteDance 🏛机构:字节 ➡️领域: Information systems → Data management systemsStorage management 📚摘要:介绍了字节新提出的ByteGraph 3.0(BG3)模型,用来处理大规模图结构数据 背景

java.sql.SQLException: No data found

Java代码如下: package com.accord.utils;import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import

FORM的ENCTYPE=multipart/form-data 时request.getParameter()值为null问题的解决

此情况发生于前台表单传送至后台java servlet处理: 问题:当Form需要FileUpload上传文件同时上传表单其他控件数据时,由于设置了ENCTYPE=”multipart/form-data” 属性,后台request.getParameter()获取的值为null 上传文件的参考代码:http://www.runoob.com/jsp/jsp-file-uploading.ht

Oracle Data Guard:Oracle数据库的高可用性和灾难恢复解决方案

在企业级数据库管理中,确保数据的高可用性和在灾难情况下的快速恢复是至关重要的。Oracle Data Guard是Oracle公司提供的一种强大的数据库高可用性解决方案,它通过在主数据库和至少一个备用数据库之间提供实时或近实时的数据保护来实现这一目标。本文将详细介绍如何在Oracle数据库中部署和使用Oracle Data Guard,包括其基本概念、配置步骤、管理技巧和实际应用示例。 1. O