owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.36k stars 2.06k forks source link

Creating a CalDAV-collection with VEVENT, VTODO and VJOURNAL from DAVx5 fails with SQL error #40537

Closed patrickunterwegs closed 1 year ago

patrickunterwegs commented 1 year ago

ownCloud: 10.x DB: MariaDB 10.10 (attention: the problem cannot be reproduced on SQLite!)

When creating a new CalDAV-collection in DAVx5 with all three components activated (VEVENT, VTODO and VJOURNAL), the creation fails with an SQL error: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'components' at row 1

The problem seems to be the table "oc_calendars" with the column "components" which is limited to 20 chars. But when adding a new collection with all three components, the string "VEVENT,VTODO,VJOURNAL" would be stored in that field which has just 1 char too much for the field to take the whole string.

Altering the table/field to accept 21 or more chars solves the problem.

Steps to reproduce

Precondition:

Expected behaviour

The collection should be created with VJOURNAL, VTODO and VEVENT support

Actual behaviour

The described error occurs

Possible solution

In my opinion the problem is clear and the solution should also be pretty clear, which is just updating/defaulting the field length of oc_calendar.components to 21 or more.

Thank you!

phil-davis commented 1 year ago

This migration reduced the components column to only 20 characters: https://github.com/owncloud/core/pull/27846/files#r1049474105

The original table column had a 255 char limit.

I wonder why it was reduced?

patrickunterwegs commented 1 year ago

Thanks @phil-davis for the check. Are there any updates on this? I think that change should be reverted after all, or if it has to be reduced, the field should be reduced to 21 or a bit more!

phil-davis commented 1 year ago

PR #40563 is in progress.

obifur commented 2 months ago

Just for the record: I was facing a similar issue also with baikal 0.93 and SQLite. When I created a new calender through davx5 and activated notes, it just won't work. Then I found out that you simply have to login into baikal as admin and you can enable notes..