Bug 328976 - Importing an exported VCS file fails when merging into an existing calendar (at least with caldav backend)
Summary: Importing an exported VCS file fails when merging into an existing calendar (...
Status: RESOLVED WORKSFORME
Alias: None
Product: korganizer
Classification: Applications
Component: import/export (show other bugs)
Version: 5.6.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 386540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-18 18:49 UTC by Achim Bohnet
Modified: 2022-05-17 11:35 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New Error text in 5.4.3 (7.71 KB, image/png)
2017-04-19 18:45 UTC, Achim Bohnet
Details
vcs example file (363 bytes, text/calendar)
2017-08-30 12:44 UTC, Achim Bohnet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2013-12-18 18:49:02 UTC
importing vcs file fails when merged into existing calendar fails with:

     an error occurred: The ical file to merge is empty

Note: it  complains about an empty ical file, not empty vcs file.

Using ical format instead of vcs format works: export as ical, import, merge -> 11 incidenes were imported successfully.

Reproducible: Always

Steps to Reproduce:
1. export an caldav (owncloud) calendar that is not empty as vCalendar
2. import Calendar, select the exported vcs file
3. in the dialog select 'merge into existings calendar'
-> Errormsg: an error occurred: The ical file to merge is empty
Actual Results:  
Errormsg: an error occurred: The ical file to merge is empty

Expected Results:  
Dialog that lets you choose the target calendar as in the ical case
Comment 1 Sergio Martins 2013-12-18 21:44:10 UTC
I had a look and vcal importing is broken.

kdepimlibs/kcalcore/vcalformat.cpp:
bool VCalFormat::load( const Calendar::Ptr &calendar, const QString &fileName )

this is returning false for some reason.
Comment 2 Achim Bohnet 2013-12-21 00:21:29 UTC
As one isn't not asked in which calendar to merge the vcal file (in ical case I get a  dialog to choose the calendar),  the Calendar::Ptr can't be invalid at this point, right?
Comment 3 Denis Kurz 2016-09-24 18:45:23 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of korganizer (version 5.0 or later, as part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 4 Denis Kurz 2017-01-07 22:38:28 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.
Comment 5 Rob Hutton 2017-04-19 14:59:43 UTC
Confirmed that it still exists in 5.3.0
Comment 6 Achim Bohnet 2017-04-19 18:45:33 UTC
Created attachment 105102 [details]
New Error text in 5.4.3

I can confirm it with korganizer 5.4.3 (in kde neon user), with a new error msg about permission.
But those should be fine:

$ ls -l vcalout.vcs
-rw-rw-r-- 1 ach ach 144838 Apr 19 20:35 vcalout.vcs
Comment 7 Achim Bohnet 2017-07-02 10:23:11 UTC
Verified with 5.5.2 KDE Neon.  Again: new error message when import -> 'Import Calendar...' the vcalout.vcs + 'Merge into existing calendar':

  An error occurred: Failed to load ical file, check permissions


Weired!  Importing a vcs and it complains about ical.  Either the error msg
is confusing or only ical calendars can be imported.   But then menu item should be 'import ICAL Calendar' and vcs files should no be shown in the file dialog.
Comment 8 Achim Bohnet 2017-07-02 10:29:23 UTC
In 5.5.2 with

$ ls -l vcalout.vcs 
-rw-rw-r-- 1 allee allee 134286 Jul  2 12:14 vcalout.vcs

when I click on vcalout.vcs in dolphin and in choose 'merge into existing calendar' in the dialog that pops ups I get a different error msg:

    An error occurred: Failed to load ical file, check permissions

And in ~/.xsession-errors I get:


kdeinit5: Got EXT_EXEC '/usr/bin/korganizer' from launcher.
kdeinit5: preparing to launch '/usr/bin/korganizer'
QXcbConnection: XCB error: 3 (BadWindow), sequence: 15317, resource id: 123731968, major code: 18 (ChangeProperty), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 15321, resource id: 123731969, major code: 18 (ChangeProperty), minor code: 0
"Failed to load ical file, check permissions."
kdeinit5: PID 19837 terminated.
QXcbConnection: XCB error: 3 (BadWindow), sequence: 15940, resource id: 123731978, major code: 18 (ChangeProperty), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 3488, resource id: 31457640, major code: 40 (TranslateCoords), minor code: 0
Creating the cache for:  "/home/allee/vcalout.vcs"
Already in database?  true
      First update :  QDateTime(2017-07-02 12:22:34.000 CEST Qt::TimeSpec(LocalTime))
       Last update :  QDateTime(2017-07-02 12:25:16.000 CEST Qt::TimeSpec(LocalTime))
After the adjustment
     Current score :  1
      First update :  QDateTime(2017-07-02 12:22:34.000 CEST Qt::TimeSpec(LocalTime))
       Last update :  QDateTime(2017-07-02 12:25:16.000 CEST Qt::TimeSpec(LocalTime))
Interval length is  0
         New score :  2
ResourceScoreUpdated: "9ff87ac3-1799-466d-8a23-dacab1a1d8fe" "org.kde.korganizer" "/home/allee/vcalout.vcs"
Comment 9 Allen Winter 2017-08-28 16:48:20 UTC
I don't have an ownCloud calendar.
Can someone create an example vcs file that fails to import.

add that example file as an attachment to this bug report.

I do find it strange that anyone would use vcs format these days. we barely still support vcs in KOrganizer.  we no longer will maintain the very low-level vcs parser. but anyway, I'm willing to take a look if someone provides an example.
Comment 10 Achim Bohnet 2017-08-29 11:21:18 UTC
Hi Allen,  korganizer crashes on all (3) my machines at the moment 
https://bugs.kde.org/show_bug.cgi?id=384075 .  So I can't export anything :-(

AFAIR I selected a simple Event exported it and tried to import it again.
Nothing special with the event.   As soon as korganizer works again, I
append an event.

Thx
Achim
Comment 11 Allen Winter 2017-08-29 13:21:21 UTC
I thought this was about importing a vcs event that was exported from ownCloud?
so can't you get me an ownCloud exported vcs event?

don't worry about the korganizer import side -- that's where the debugging comes in
Comment 12 Achim Bohnet 2017-08-29 14:12:42 UTC
Ups, misleading report :-(

I connected with caldav resource to owncloud but export & import I did with korganizer:  korganizer could not import it's own exported format.
Comment 13 Achim Bohnet 2017-08-30 12:44:06 UTC
Created attachment 107589 [details]
vcs example file

reproduced again with KDE Neon Stable (korganizer 5.6.* bugfix branch): Bug still there.

Further: I've deleted all but the first event from the vcalout.vcs created by korganizer (attached) and tried to File -> Import -> Import calendar -> [merge into existing calendar] and bug:

   An error occurred: Failed to load ical file, check permissions

korganizer writes to konsole:

   org.kde.pim.kcalcore: Exception while importing:7
   "Failed to load ical file, check permissions"


Permission of the file are 664 (according to the default umask)
Comment 14 gjditchfield 2022-03-25 23:21:45 UTC
The error message saying "Failed to load ical file, check permissions" is very misleading.
The attached vcs example file is not a valid vCalendar file:  it lacks a final 'END:VCALENDAR' line.
When I add one, KOrganizer 5.19.3 imports the file successfully.

Does anyone have a different vCalendar file that causes import errors?
Comment 15 gjditchfield 2022-03-26 15:55:27 UTC
Git commit da978a432c2b0fd37f4c1562120adc4ad94e043c by Glen Ditchfield, on behalf of Glen Ditchfield.
Committed on 26/03/2022 at 01:28.
Pushed by gditchfield into branch 'master'.

Print more information about errors when loading vCalendars

M  +7    -0    src/vcalformat.cpp

https://invent.kde.org/frameworks/kcalendarcore/commit/da978a432c2b0fd37f4c1562120adc4ad94e043c
Comment 16 gjditchfield 2022-04-03 19:33:50 UTC
Git commit a1dc439862a3c0170540869ac3f1e79c4d05f8e3 by Glen Ditchfield.
Committed on 03/04/2022 at 19:33.
Pushed by gditchfield into branch 'master'.

Adjust the error messages for failed imports

@winterz

M  +6    -4    src/icalimporter.cpp

https://invent.kde.org/pim/akonadi-calendar/commit/a1dc439862a3c0170540869ac3f1e79c4d05f8e3
Comment 17 gjditchfield 2022-04-08 15:51:07 UTC
*** Bug 386540 has been marked as a duplicate of this bug. ***
Comment 18 Bug Janitor Service 2022-04-23 04:35:01 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 19 Bug Janitor Service 2022-05-08 04:34:58 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 20 Bug Janitor Service 2022-05-17 11:34:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcalendarcore/-/merge_requests/100
Comment 21 Bug Janitor Service 2022-05-17 11:35:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/akonadi-calendar/-/merge_requests/13