nextcloud / nextcloud/calendar
Import of ICS file with two entries (Deutsche Bahn Ticket, outward and return) partially fails, needs two imports
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
- Try to import ICS file from Deutsche Bahn Ticket with two entries (outward and return journey)
- Nextcloud says: "Import partially failed. Imported 1 out of 2."
- Only one of the entries got imported
- (as a workaround, importing a second time will also "partially fail", but it will fail with the other one, so that works to import both)
Expected behavior
Nextcloud should correctly import the ICS file with two events.
Actual behaviour
Error message, only one event gets imported
Calendar app version
4.7.4
CalDAV-clients used
No response
Browser
Firefox 126.0
Client operating system
Gentoo Linux
Server operating system
Gentoo Linux
Web server
Apache
Database engine version
SQlite
PHP engine version
Other
Nextcloud version
29.0.1
Updated from an older installed version or fresh install
Updated from an older version
List of activated apps
Enabled:
- activity: 2.21.1
- calendar: 4.7.10
- circles: 29.0.0-dev
- cloud_federation_api: 1.12.0
- comments: 1.19.0
- contacts: 6.0.0
- contactsinteraction: 1.10.0
- dashboard: 7.9.0
- dav: 1.30.1
- federatedfilesharing: 1.19.0
- federation: 1.19.0
- files: 2.1.0
- files_downloadlimit: 2.0.0
- files_pdfviewer: 2.10.0
- files_reminders: 1.2.0
- files_sharing: 1.21.0
- files_trashbin: 1.19.0
- files_versions: 1.22.0
- firstrunwizard: 2.18.0
- logreader: 2.14.0
- lookup_server_connector: 1.17.0
- mail: 3.7.2
- nextcloud_announcements: 1.18.0
- notes: 4.10.0
- notifications: 2.17.0
- oauth2: 1.17.0
- password_policy: 1.19.0
- photos: 2.5.0
- privacy: 1.13.0
- provisioning_api: 1.19.0
- recommendations: 2.1.0
- related_resources: 1.4.0
- richdocuments: 8.4.3
- serverinfo: 1.19.0
- settings: 1.12.0
- sharebymail: 1.19.0
- spreed: 19.0.4
- support: 1.12.0
- survey_client: 1.17.0
- systemtags: 1.19.0
- text: 3.10.1
- theming: 2.4.0
- twofactor_backupcodes: 1.18.0
- updatenotification: 1.19.1
- user_status: 1.9.0
- viewer: 2.3.0
- weather_status: 1.9.0
- workflowengine: 2.11.0
Disabled:
- admin_audit: 1.19.0
- bruteforcesettings: 2.9.0
- encryption: 2.17.0
- files_external: 1.21.0
- suspicious_login: 7.0.0
- twofactor_totp: 11.0.0-dev
- user_ldap: 1.20.0
Nextcloud configuration
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "sqlite3",
"version": "29.0.3.4",
"overwrite.cli.url": "http:\/\/localhost",
"installed": true
}
}
Web server error log
127.0.0.1 - - [08/Jul/2024:11:47:59 +0200] "PUT /remote.php/dav/calendars/root/personal/A81DD1E0-F427-47E8-8755-C31BBB861712.ics HTTP/1.1" 500 293
127.0.0.1 - - [08/Jul/2024:11:47:59 +0200] "PUT /remote.php/dav/calendars/root/personal/5237AED2-F2B1-41AB-BB9C-986A9DF0BA3F.ics HTTP/1.1" 201 -
127.0.0.1 - - [08/Jul/2024:11:47:59 +0200] "PROPFIND /remote.php/dav/calendars/root/personal/5237AED2-F2B1-41AB-BB9C-986A9DF0BA3F.ics HTTP/1.1" 207 1542
Log file
{"reqId":"Zou0dvQ4P1jyDuubFCMTiQAAAAA","level":3,"time":"2024-07-08T09:42:14+00:00","remoteAddr":"127.0.0.1","user":"root","app":"webdav","method":"PUT","url":"/remote.php/dav/calendars/root/personal/AEBB505C-48EC-43FE-9708-282DB97E6D65.ics","message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0","version":"29.0.3.4","exception":{"Exception":"OC\\DB\\Exceptions\\DbalException","Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked","Code":5,"Trace":[{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":328,"function":"wrap","class":"OC\\DB\\Exceptions\\DbalException","type":"::"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1297,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OCA\\DAV\\CalDAV\\{closure}","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1248,"function":"atomic","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/CalDAV/Calendar.php","line":199,"function":"createCalendarObject","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"Sabre\\CalDAV\\Calendar","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/remote.php","line":172,"args":["/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/localhost/htdocs/lib/private/DB/Exceptions/DbalException.php","Line":71,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\LockWaitTimeoutException","Message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked","Code":5,"Trace":[{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1943,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\SQLite\\ExceptionConverter","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1885,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1213,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/Connection.php","line":373,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":393,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1297,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OCA\\DAV\\CalDAV\\{closure}","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1248,"function":"atomic","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/CalDAV/Calendar.php","line":199,"function":"createCalendarObject","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"Sabre\\CalDAV\\Calendar","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/remote.php","line":172,"args":["/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Driver/API/SQLite/ExceptionConverter.php","Line":32,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[HY000]: General error: 5 database is locked","Code":5,"Trace":[{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":132,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1207,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/Connection.php","line":373,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":393,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1297,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OCA\\DAV\\CalDAV\\{closure}","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1248,"function":"atomic","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/CalDAV/Calendar.php","line":199,"function":"createCalendarObject","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"Sabre\\CalDAV\\Calendar","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/remote.php","line":172,"args":["/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":28,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[HY000]: General error: 5 database is locked","Code":"HY000","Trace":[{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","line":130,"function":"execute","class":"PDOStatement","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connection.php","line":1207,"function":"execute","class":"Doctrine\\DBAL\\Driver\\PDO\\Statement","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/Connection.php","line":373,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":393,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":280,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/private/DB/QueryBuilder/QueryBuilder.php","line":326,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1297,"function":"executeStatement","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->"},{"file":"/var/www/localhost/htdocs/lib/public/AppFramework/Db/TTransactional.php","line":63,"function":"OCA\\DAV\\CalDAV\\{closure}","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/apps/dav/lib/CalDAV/CalDavBackend.php","line":1248,"function":"atomic","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/CalDAV/Calendar.php","line":199,"function":"createCalendarObject","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"Sabre\\CalDAV\\Calendar","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/lib/Server.php","line":379,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/localhost/htdocs/remote.php","line":172,"args":["/var/www/localhost/htdocs/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/localhost/htdocs/3rdparty/doctrine/dbal/src/Driver/PDO/Statement.php","Line":130}}},"message":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked","exception":{},"CustomMessage":"An exception occurred while executing a query: SQLSTATE[HY000]: General error: 5 database is locked"}}
Browser log
XHRPUT
http://localhost/remote.php/dav/calendars/root/personal/DCF3BAC7-EE8A-4C53-864F-128AA6873F9D.ics
[HTTP/1.1 500 Internal Server Error 48ms]
Error:
A dist.js:2
F dist.js:2
T dist.js:2
onreadystatechange dist.js:2
request dist.js:2
request dist.js:2
put dist.js:2
createObject dist.js:2
createVObject dist.js:2
importEventsIntoCalendar calendars.js:1166
i index.js:23
r index.js:23
a index.js:47
a index.js:39
a index.js:53
a index.js:52
importEventsIntoCalendar calendars.js:1161
_ vuex.esm.js:851
dispatch vuex.esm.js:516
dispatch vuex.esm.js:406
importCalendar SettingsImportSection.vue:231
VueJS 4
importCalendar ImportScreen.vue:80
VueJS 4
click NcButton.mjs:198
VueJS 33
calendars.js:1169:14
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 with apps/dav/lib/CalDAV/CalDavBackend.php around line 1297 and the transaction path through lib/public/AppFramework/Db/TTransactional.php. Reproduce the two-event Deutsche Bahn ICS import using SQLite and inspect the reported database-locked failure. Done means both events import successfully without a 500 response or partial-import result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, sqlite
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100