Bug 487497 - remoteId isn't large enough to store long remote calendars URLs
Summary: remoteId isn't large enough to store long remote calendars URLs
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: DAV Resource (show other bugs)
Version: 6.0.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-24 20:12 UTC by Matthieu L.
Modified: 2024-05-24 20:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthieu L. 2024-05-24 20:12:50 UTC
SUMMARY
When trying to add a ical resource with a long remote url, it will fail with the error 
org.kde.pim.akonadiserver:   DB error:  "Data too long for column 'remoteId' at row 1"

This happens because the CollectionTable's remoteId field is a varbinary(255), and in my case the url is 328 characters long.

STEPS TO REPRODUCE
1. From a akonadi client (Merkuro Calendar in my case), create a new "ical calendar file" calendar resource, setting it's url to something really long (for example "https://example.com/mycal.ical?eHMwUHXeaNzcAyEgAHCmYuiQGNOoHUOLvrVJTqcyqIKKZqgROoPtdhBJJkqzxOvfljNfprzmrbdhdNThGVhKwUOXNArqrTmQYEZwaFxmfKWhzayWiuzDHVHNsokPVoNxvVlpqiExFShIZfqbJHmOmBQbSGUuiyIEAcCNeGGsyaZnFhRxSwvHnyCXHdKKcMNfugzwGnFSncEXKGTBDyMOUbqMkKzlsodXswfQgczcTFLzulwEVmpfNhZfMuLriYsLOztSpUNsfELRFOgSFvqYRERJHgiMWijPTAnqjYeIDONQ")
2. Observe the akondani server output

OBSERVED RESULT
The calendar isn't added, failing with the following errors:
>org.kde.pim.akonadiserver: DATABASE ERROR:
>org.kde.pim.akonadiserver:   Error code: "1406"
>org.kde.pim.akonadiserver:   DB error:  "Data too long for column 'remoteId' at row 1"
>org.kde.pim.akonadiserver:   Error text: "Data too long for column 'remoteId' at row 1 QMYSQL: Unable to execute statement"
>org.kde.pim.akonadiserver:   Values: QList(QVariant(QString, "https://example.com/mycal.ical?eHMwUHXeaNzcAyEgAHCmYuiQGNOoHUOLvrVJTqcyqIKKZqgROoPtdhBJJkqzxOvfljNfprzmrbdhdNThGVhKwUOXNArqrTmQYEZwaFxmfKWhzayWiuzDHVHNsokPVoNxvVlpqiExFShIZfqbJHmOmBQbSGUuiyIEAcCNeGGsyaZnFhRxSwvHnyCXHdKKcMNfugzwGnFSncEXKGTBDyMOUbqMkKzlsodXswfQgczcTFLzulwEVmpfNhZfMuLriYsLOztSpUNsfELRFOgSFvqYRERJHgiMWijPTAnqjYeIDONQ"), QVariant(QString, ""), QVariant(QString, "TESTCAL"), QVariant(qlonglong, 6), QVariant(bool, true), QVariant(int, 2), QVariant(int, 2), QVariant(int, 2), QVariant(bool, false), QVariant(int, 60), QVariant(int, -1), QVariant(bool, false), QVariant(QString, ""), QVariant(bool, false))
>org.kde.pim.akonadiserver:   Query: "INSERT INTO CollectionTable (remoteId, remoteRevision, name, resourceId, enabled, syncPref, displayPref, indexPref, cachePolicyInherit, cachePolicyCheckInterval, cachePolicyCacheTimeout, cachePolicySyncOnDemand, cachePolicyLocalParts, isVirtual) VALUES (:0, :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13)"
>org.kde.pim.akonadiserver: Error during insertion into table "CollectionTable" "Data too long for column 'remoteId' at row 1 QMYSQL: Unable to execute statement"
>org.kde.pim.akonadiserver: Failed to append Collection "TESTCAL" in resource "akonadi_ical_resource_1"
>org.kde.pim.akonadiserver: Error while handling command CreateCollection on connection akonadi_ical_resource_1 (0x559d0ac45430)

EXPECTED RESULT
The calendar is added and works


SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
This seems really similar to https://bugs.kde.org/show_bug.cgi?id=394839 , although with a different table