nextcloud / nextcloud/server

Truncate calendar subscriptions display name to 100 chars before saving it

Open
#54,859 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 32-feedback bug feature: caldav
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

PDOException: SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(100)
#19 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php(130): PDOStatement::execute
#18 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php(130): Doctrine\DBAL\Driver\PDO\Statement::execute
#17 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1212): Doctrine\DBAL\Connection::executeStatement
#16 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php(292): Doctrine\DBAL\Connections\PrimaryReadReplicaConnection::executeStatement
#15 /var/www/nc/nextcloud/lib/private/DB/Connection.php(462): OC\DB\Connection::executeStatement
#14 /var/www/nc/nextcloud/lib/private/DB/ConnectionAdapter.php(67): OC\DB\ConnectionAdapter::executeStatement
#13 /var/www/nc/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(306): OC\DB\QueryBuilder\QueryBuilder::executeStatement
#12 /dav/lib/CalDAV/CalDavBackend.php(2689): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#11 /var/www/nc/nextcloud/lib/public/AppFramework/Db/TTransactional.php(45): OCA\DAV\CalDAV\CalDavBackend::atomic
#10 /dav/lib/CalDAV/CalDavBackend.php(2681): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#9 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(288): Sabre\DAV\PropPatch::doCallBackMultiProp
#8 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(227): Sabre\DAV\PropPatch::commit
#7 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(1264): Sabre\DAV\Server::updateProperties
#6 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(373): Sabre\DAV\CorePlugin::httpPropPatch
#5 /var/www/nc/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\Server::emit
#4 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server::invokeMethod
#3 /dav/lib/Connector/Sabre/Server.php(49): OCA\DAV\Connector\Sabre\Server::start
#2 /dav/lib/Server.php(375): OCA\DAV\Server::exec
#1 /dav/appinfo/v2/remote.php(19): require_once
#0 /var/www/nc/nextcloud/remote.php(146): null

Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(100)
#19 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php(24): Doctrine\DBAL\Driver\PDO\Exception::new
#18 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php(132): Doctrine\DBAL\Driver\PDO\Statement::execute
#17 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1212): Doctrine\DBAL\Connection::executeStatement
#16 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php(292): Doctrine\DBAL\Connections\PrimaryReadReplicaConnection::executeStatement
#15 /var/www/nc/nextcloud/lib/private/DB/Connection.php(462): OC\DB\Connection::executeStatement
#14 /var/www/nc/nextcloud/lib/private/DB/ConnectionAdapter.php(67): OC\DB\ConnectionAdapter::executeStatement
#13 /var/www/nc/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(306): OC\DB\QueryBuilder\QueryBuilder::executeStatement
#12 /dav/lib/CalDAV/CalDavBackend.php(2689): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#11 /var/www/nc/nextcloud/lib/public/AppFramework/Db/TTransactional.php(45): OCA\DAV\CalDAV\CalDavBackend::atomic
#10 /dav/lib/CalDAV/CalDavBackend.php(2681): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#9 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(288): Sabre\DAV\PropPatch::doCallBackMultiProp
#8 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(227): Sabre\DAV\PropPatch::commit
#7 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(1264): Sabre\DAV\Server::updateProperties
#6 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(373): Sabre\DAV\CorePlugin::httpPropPatch
#5 /var/www/nc/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\Server::emit
#4 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server::invokeMethod
#3 /dav/lib/Connector/Sabre/Server.php(49): OCA\DAV\Connector\Sabre\Server::start
#2 /dav/lib/Server.php(375): OCA\DAV\Server::exec
#1 /dav/appinfo/v2/remote.php(19): require_once
#0 /var/www/nc/nextcloud/remote.php(146): null

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(100)
#20 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php(87): Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter::convert
#19 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1976): Doctrine\DBAL\Connection::handleDriverException
#18 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1918): Doctrine\DBAL\Connection::convertExceptionDuringQuery
#17 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1218): Doctrine\DBAL\Connection::executeStatement
#16 /var/www/nc/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php(292): Doctrine\DBAL\Connections\PrimaryReadReplicaConnection::executeStatement
#15 /var/www/nc/nextcloud/lib/private/DB/Connection.php(462): OC\DB\Connection::executeStatement
#14 /var/www/nc/nextcloud/lib/private/DB/ConnectionAdapter.php(67): OC\DB\ConnectionAdapter::executeStatement
#13 /var/www/nc/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(306): OC\DB\QueryBuilder\QueryBuilder::executeStatement
#12 /dav/lib/CalDAV/CalDavBackend.php(2689): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#11 /var/www/nc/nextcloud/lib/public/AppFramework/Db/TTransactional.php(45): OCA\DAV\CalDAV\CalDavBackend::atomic
#10 /dav/lib/CalDAV/CalDavBackend.php(2681): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#9 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(288): Sabre\DAV\PropPatch::doCallBackMultiProp
#8 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(227): Sabre\DAV\PropPatch::commit
#7 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(1264): Sabre\DAV\Server::updateProperties
#6 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(373): Sabre\DAV\CorePlugin::httpPropPatch
#5 /var/www/nc/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\Server::emit
#4 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server::invokeMethod
#3 /dav/lib/Connector/Sabre/Server.php(49): OCA\DAV\Connector\Sabre\Server::start
#2 /dav/lib/Server.php(375): OCA\DAV\Server::exec
#1 /dav/appinfo/v2/remote.php(19): require_once
#0 /var/www/nc/nextcloud/remote.php(146): null

OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 7 ERREUR:  valeur trop longue pour le type character varying(100)
#15 /var/www/nc/nextcloud/lib/private/DB/Exceptions/DbalException.php(56): OC\DB\Exceptions\DbalException::wrap
#14 /var/www/nc/nextcloud/lib/private/DB/ConnectionAdapter.php(69): OC\DB\ConnectionAdapter::executeStatement
#13 /var/www/nc/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(306): OC\DB\QueryBuilder\QueryBuilder::executeStatement
#12 /dav/lib/CalDAV/CalDavBackend.php(2689): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#11 /var/www/nc/nextcloud/lib/public/AppFramework/Db/TTransactional.php(45): OCA\DAV\CalDAV\CalDavBackend::atomic
#10 /dav/lib/CalDAV/CalDavBackend.php(2681): OCA\DAV\CalDAV\CalDavBackend::OCA\DAV\CalDAV\{closure}
#9 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(288): Sabre\DAV\PropPatch::doCallBackMultiProp
#8 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/PropPatch.php(227): Sabre\DAV\PropPatch::commit
#7 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(1264): Sabre\DAV\Server::updateProperties
#6 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(373): Sabre\DAV\CorePlugin::httpPropPatch
#5 /var/www/nc/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\Server::emit
#4 /var/www/nc/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server::invokeMethod
#3 /dav/lib/Connector/Sabre/Server.php(49): OCA\DAV\Connector\Sabre\Server::start
#2 /dav/lib/Server.php(375): OCA\DAV\Server::exec
#1 /dav/appinfo/v2/remote.php(19): require_once
#0 /var/www/nc/nextcloud/remote.php(146): null

Related to: https://github.com/nextcloud/server/issues/50847

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dav/lib/CalDAV/CalDavBackend.php around the persistence path at lines 2681-2689 shown in the trace, and inspect how calendar subscription display names are saved. Reproduce the long-name case if possible and verify that names over 100 characters are saved without the PostgreSQL length error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, postgresql
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.