nextcloud / nextcloud/calendar
webdav DbalException An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 332
- Avg merge
- 16h 13m
- Merged PRs (30d)
- 137
Description
Steps to reproduce
Updated to nextcloud 31.0.4
A few days ago.
Try to upload my calendar updated...
Expected behavior
No SQL error, for the calendar updates.
Actual behavior
[webdav] Fehler: An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1
PUT /remote.php/dav/calendars/xx/schichten/d9514d1f-60a0-4d55-ae12-c893ff193efd.ics
von 217.93.33.110 von xxum 22.04.2025, 08:01:48
{
"reqId": "bbGLwuKLJwZePqKKBAwC",
"level": 3,
"time": "2025-04-22T06:17:53+00:00",
"remoteAddr": "123.123.123.123",
"user": "XxXxX",
"app": "webdav",
"method": "PUT",
"url": "/remote.php/dav/calendars/XxXxX/schichten/d62afd30-38a0-44d5-b643-85278f9da09b.ics",
"message": "An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1",
"userAgent": "vdirsyncer/0.19.3",
"version": "31.0.4.1",
"exception": {
"Exception": "OC\\DB\\Exceptions\\DbalException",
"Message": "An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1",
"Code": 1406,
"Trace": [
{
"file": "/app/www/public/lib/private/DB/ConnectionAdapter.php",
"line": 69,
"function": "wrap",
"class": "OC\\DB\\Exceptions\\DbalException",
"type": "::"
},
{
"file": "/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 306,
"function": "executeStatement",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1547,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1488,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1295,
"function": "deleteCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1265,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/CalDAV/Calendar.php",
"line": 199,
"function": "createCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 1098,
"function": "createFile",
"class": "Sabre\\CalDAV\\Calendar",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 504,
"function": "createFile",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpPut",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
"line": 49,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Server.php",
"line": 398,
"function": "start",
"class": "OCA\\DAV\\Connector\\Sabre\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 21,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->"
},
{
"file": "/app/www/public/remote.php",
"line": 145,
"args": [
"/config/www/nextcloud/apps/dav/appinfo/v2/remote.php"
],
"function": "require_once"
}
],
"File": "/app/www/public/lib/private/DB/Exceptions/DbalException.php",
"Line": 56,
"Previous": {
"Exception": "Doctrine\\DBAL\\Exception\\DriverException",
"Message": "An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1",
"Code": 1406,
"Trace": [
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1976,
"function": "convert",
"class": "Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1918,
"function": "handleDriverException",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1218,
"function": "convertExceptionDuringQuery",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
"line": 292,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/Connection.php",
"line": 466,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/ConnectionAdapter.php",
"line": 67,
"function": "executeStatement",
"class": "OC\\DB\\Connection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 306,
"function": "executeStatement",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1547,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1488,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1295,
"function": "deleteCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1265,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/CalDAV/Calendar.php",
"line": 199,
"function": "createCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 1098,
"function": "createFile",
"class": "Sabre\\CalDAV\\Calendar",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 504,
"function": "createFile",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpPut",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
"line": 49,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Server.php",
"line": 398,
"function": "start",
"class": "OCA\\DAV\\Connector\\Sabre\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 21,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->"
},
{
"file": "/app/www/public/remote.php",
"line": 145,
"args": [
"/config/www/nextcloud/apps/dav/appinfo/v2/remote.php"
],
"function": "require_once"
}
],
"File": "/app/www/public/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php",
"Line": 118,
"Previous": {
"Exception": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
"Message": "SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1",
"Code": 1406,
"Trace": [
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"line": 132,
"function": "new",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Exception",
"type": "::"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1212,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
"line": 292,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/Connection.php",
"line": 466,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/ConnectionAdapter.php",
"line": 67,
"function": "executeStatement",
"class": "OC\\DB\\Connection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 306,
"function": "executeStatement",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1547,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1488,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1295,
"function": "deleteCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1265,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/CalDAV/Calendar.php",
"line": 199,
"function": "createCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 1098,
"function": "createFile",
"class": "Sabre\\CalDAV\\Calendar",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 504,
"function": "createFile",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpPut",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
"line": 49,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Server.php",
"line": 398,
"function": "start",
"class": "OCA\\DAV\\Connector\\Sabre\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 21,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->"
},
{
"file": "/app/www/public/remote.php",
"line": 145,
"args": [
"/config/www/nextcloud/apps/dav/appinfo/v2/remote.php"
],
"function": "require_once"
}
],
"File": "/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php",
"Line": 24,
"Previous": {
"Exception": "PDOException",
"Message": "SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1",
"Code": "22001",
"Trace": [
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"line": 130,
"function": "execute",
"class": "PDOStatement",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connection.php",
"line": 1212,
"function": "execute",
"class": "Doctrine\\DBAL\\Driver\\PDO\\Statement",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php",
"line": 292,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/Connection.php",
"line": 466,
"function": "executeStatement",
"class": "Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/ConnectionAdapter.php",
"line": 67,
"function": "executeStatement",
"class": "OC\\DB\\Connection",
"type": "->"
},
{
"file": "/app/www/public/lib/private/DB/QueryBuilder/QueryBuilder.php",
"line": 306,
"function": "executeStatement",
"class": "OC\\DB\\ConnectionAdapter",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1547,
"function": "executeStatement",
"class": "OC\\DB\\QueryBuilder\\QueryBuilder",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1488,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1295,
"function": "deleteCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/lib/public/AppFramework/Db/TTransactional.php",
"line": 45,
"function": "OCA\\DAV\\CalDAV\\{closure}",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/config/www/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php",
"line": 1265,
"function": "atomic",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/CalDAV/Calendar.php",
"line": 199,
"function": "createCalendarObject",
"class": "OCA\\DAV\\CalDAV\\CalDavBackend",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 1098,
"function": "createFile",
"class": "Sabre\\CalDAV\\Calendar",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 504,
"function": "createFile",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/app/www/public/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpPut",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->"
},
{
"file": "/app/www/public/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Connector/Sabre/Server.php",
"line": 49,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/lib/Server.php",
"line": 398,
"function": "start",
"class": "OCA\\DAV\\Connector\\Sabre\\Server",
"type": "->"
},
{
"file": "/config/www/nextcloud/apps/dav/appinfo/v2/remote.php",
"line": 21,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->"
},
{
"file": "/app/www/public/remote.php",
"line": 145,
"args": [
"/config/www/nextcloud/apps/dav/appinfo/v2/remote.php"
],
"function": "require_once"
}
],
"File": "/app/www/public/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php",
"Line": 130
}
}
},
"message": "An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1",
"exception": {
"query": "UPDATE `*PREFIX*calendarobjects` SET `deleted_at` = :dcValue1, `uri` = :dcValue2 WHERE (`calendarid` = :dcValue3) AND (`calendartype` = :dcValue4) AND (`uri` = :dcValue5)"
},
"CustomMessage": "An exception occurred while executing a query: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1"
},
"id": "68073491a4f09"
}
Problem is when I update my calendar with vdirsyncer. After I have loaded it from my company calendar and updated the Titles. It has worked the last year so I expect the bug in nextcloud.
Calendar app version
5.2.1
CalDAV-clients used
Thunderbird, ios Calendar, vdirsyncer, Davx5
Browser
No response
Client operating system
No response
Server operating system
No response
Web server
Nginx
Database engine version
MariaDB
PHP engine version
PHP 8.4
Nextcloud version
31.0.4
Updated from an older installed version or fresh install
Updated from an older version
List of activated apps
Nextcloud configuration
Web server error log
Log file
Browser log
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/dav/lib/CalDAV/CalDavBackend.php around lines 1265-1547, following the PUT request and the failing database operation shown in the trace. Reproduce the calendar update with the reported WebDAV request and verify that it completes without a data-too-long error for the uri column.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100