Bug 332410

Summary: Changes to events and tasks made in KOrganizer don't sync to Google Calendar and Tasks
Product: [Frameworks and Libraries] libkgapi Reporter: José Troncoso <jstroncoso>
Component: GeneralAssignee: Daniel Vrátil <dvratil>
Status: VERIFIED FIXED    
Severity: normal CC: cfeck, daniel.eimer, dozab2000, florian.lindner, gordon, jonnymo, kdebugs, me, nmset, panard, sebastian.niemeyer, t.kijas
Priority: NOR    
Version: 2.1.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description José Troncoso 2014-03-21 17:00:03 UTC
When I move an event or task to a different date, I get error messages and the change doesn't sync on Google Calendar and Tasks (libKGAPI vesrion is 2.1.0).

Reproducible: Always

Steps to Reproduce:
1. Open KOrganizer
2. Move a Google event to a different date
3. Move a Google task to a different date
Actual Results:  
When I move the event, I get the following error message and the change doesn't sync on Google Calendar and Tasks:
Calendarios y tareas de Google (jstroncoso@gmail.com): Bad request.

When I move the task, I get the following two error messages and the change doesn't sync on Google Calendar and Tasks:
Calendarios y tareas de Google (jstroncoso@gmail.com): Invalid item payload.
Calendarios y tareas de Google (jstroncoso@gmail.com): Bad request.

Expected Results:  
No error messages and changes synced on Google server.

The following output is sent to the console when I move the event:
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::EventModifyJob::start: ("Authorization: Bearer ya29.1.AADtN_UUCv1u9u9X5x9_jdZ0hPOn-EXhpEWIHHaA98srUpqBIPqVI41GcVE2Bn3Tk3W7veii", "GData-Version: 3")
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::enqueueRequest: Queued  QUrl( "https://www.googleapis.com/calendar/v3/calendars/vci2oap96um4oe0luhsd7tpeco@group.calendar.google.com/events/krerslgp4dtkqg8cpkqb8v7hhc" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_dispatchTimeout: Dispatching request to  QUrl( "https://www.googleapis.com/calendar/v3/calendars/vci2oap96um4oe0luhsd7tpeco@group.calendar.google.com/events/krerslgp4dtkqg8cpkqb8v7hhc" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_dispatchTimeout: "{ "description" : "", "end" : { "date" : "2014-03-30" }, "id" : "krerslgp4dtkqg8cpkqb8v7hhc", "location" : "", "reminders" : { "overrides" : [  ], "useDefault" : false }, "start" : { "date" : "2014-03-29" }, "status" : "confirmed", "summary" : "Festa da Reconquista de Vigo", "transparency" : "opaque", "type" : "calendar#event" }"
akonadi_googlecalendar_resource_0(2288)/kio (Scheduler) KIO::SchedulerPrivate::doJob: KIO::SimpleJob(0x1da3500)
akonadi_googlecalendar_resource_0(2288)/kio (Slave) KIO::Slave::createSlave: createSlave "https" for KUrl("https://www.googleapis.com/calendar/v3/calendars/vci2oap96um4oe0luhsd7tpeco@group.calendar.google.com/events/krerslgp4dtkqg8cpkqb8v7hhc")
akonadi_googlecalendar_resource_0(2288)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-pepe/akonadi_googlecalendar_resource_0Vs2288.slave-socket"
akonadi_googlecalendar_resource_0(2288)/kio (KIOJob) KIO::TransferJob::slotFinished: KUrl("https://www.googleapis.com/calendar/v3/calendars/vci2oap96um4oe0luhsd7tpeco@group.calendar.google.com/events/krerslgp4dtkqg8cpkqb8v7hhc")
akonadi_googlecalendar_resource_0(2288)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished: KIO::TransferJob(0x1da3500) KIO::Slave(0x1d96030)
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Received reply from  QUrl( "https://www.googleapis.com/calendar/v3/calendars/vci2oap96um4oe0luhsd7tpeco@group.calendar.google.com/events/krerslgp4dtkqg8cpkqb8v7hhc" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_replyReceived: "{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Missing end time."
   }
  ],
  "code": 400,
  "message": "Missing end time."
 }
}
"
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Bad request, Google replied ' "{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Missing end time."
   }
  ],
  "code": 400,
  "message": "Missing end time."
 }
}
" ' 
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::emitFinished:

The following output is sent to the console when I move the task:
akonadi_googlecalendar_resource_0(2288)/kio (Slave) KIO::Slave::kill: killing slave pid 3051 ( "https://www.googleapis.com" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::TaskMoveJob::Private::processNextTask: ("Authorization: Bearer ya29.1.AADtN_UUCv1u9u9X5x9_jdZ0hPOn-EXhpEWIHHaA98srUpqBIPqVI41GcVE2Bn3Tk3W7veii")
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::enqueueRequest: Queued  QUrl( "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy/move" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_dispatchTimeout: Dispatching request to  QUrl( "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy/move" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_dispatchTimeout: ""
akonadi_googlecalendar_resource_0(2288)/kio (Scheduler) KIO::SchedulerPrivate::doJob: KIO::SimpleJob(0x1d998c0)
akonadi_googlecalendar_resource_0(2288)/kio (Slave) KIO::Slave::createSlave: createSlave "https" for KUrl("https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy/move")
akonadi_googlecalendar_resource_0(2288)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-pepe/akonadi_googlecalendar_resource_0nt2288.slave-socket"
akonadi_googlecalendar_resource_0(2288)/kio (KIOJob) KIO::TransferJob::slotFinished: KUrl("https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy/move")
akonadi_googlecalendar_resource_0(2288)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished: KIO::TransferJob(0x1d998c0) KIO::Slave(0x1dd4770)
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Received reply from  QUrl( "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy/move" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_replyReceived: "{
 "kind": "tasks#task",
 "id": "MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy",
 "etag": "\"yQuz3iwILoVDIM9RQAaVkkwlXiI/NjM3NzUwNDY5\"",
 "title": "Revisar FutureLearn ",
 "updated": "2014-03-21T07:39:34.000Z",
 "selfLink": "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy",
 "position": "00000000000119308178",
 "status": "needsAction",
 "due": "2014-03-21T00:00:00.000Z"
}
"
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::emitFinished:
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::TaskModifyJob::start: ("Authorization: Bearer ya29.1.AADtN_UUCv1u9u9X5x9_jdZ0hPOn-EXhpEWIHHaA98srUpqBIPqVI41GcVE2Bn3Tk3W7veii")
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::enqueueRequest: Queued  QUrl( "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_dispatchTimeout: Dispatching request to  QUrl( "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_dispatchTimeout: "{ "due" : "2014-03-23T00:00:00.000Z", "id" : "MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy", "kind" : "tasks#task", "notes" : "", "status" : "needsAction", "title" : "Revisar FutureLearn" }"
akonadi_googlecalendar_resource_0(2288)/kio (Scheduler) KIO::SchedulerPrivate::doJob: KIO::SimpleJob(0x1cd0140)
akonadi_googlecalendar_resource_0(2288)/kio (KIOJob) KIO::TransferJob::slotFinished: KUrl("https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy")
akonadi_googlecalendar_resource_0(2288)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished: KIO::TransferJob(0x1cd0140) KIO::Slave(0x1dd4770)
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Received reply from  QUrl( "https://www.googleapis.com/tasks/v1/lists/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDow/tasks/MDk4Mjk0NTkyMTk3MzczODgwNzM6MDoxNTAwMTY0NzMy" )
akonadi_googlecalendar_resource_0(2288)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_replyReceived: "{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}
"
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Bad request, Google replied ' "{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid Value"
   }
  ],
  "code": 400,
  "message": "Invalid Value"
 }
}
" ' 
akonadi_googlecalendar_resource_0(2288)/LibKGAPI KGAPI2::Job::emitFinished:
Comment 1 Gordon 2014-06-14 18:48:29 UTC
I want to confirm that the Korganizer calendar will not sync edits to Google. That is, it appears to successfully sync new events to Google, however, after that, any changes made in Korganizer's calendar do not sync to Google.  Deletions and new events successfully sync but edits do not sync.  Also, as an FYI, if you watch the Akonadi Resource Configuration it does show the synchronization in process, however, all edits to any Korganizer events are never synced to Google. 

As a side note, I am not getting any error messages on my display as has been reported by José Troncoso.
Comment 2 Gordon 2014-06-14 19:45:21 UTC
I have been more thoroughly testing my installation and I have found the same problem with KAddressBook.  That is, additions and deletions of contacts in KAddressBook are synced to Google, however, edits are not.  So, this is a problem for both KOrganizer's calendar and KAddressBook where edited entries are not synced to Google.
Comment 3 José Troncoso 2014-06-16 14:27:30 UTC
I've just made a fresh installation of KDE 4.13.2 on Arch Linux on Virtual Box, and I keep getting same error on editing an event.

This is the output to the console when creating the event. No problem here; the event has both a start time and an end time:

akonadi_googlecalendar_resource_1(748)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Received reply from  QUrl( "https://www.googleapis.com/calendar/v3/calendars/jstroncoso@gmail.com/events" )
akonadi_googlecalendar_resource_1(748)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_replyReceived: "{
 "kind": "calendar#event",
 "etag": "\"lALbFE98s88NEFGE7rntyxNtHBY/MjgwNTgzODA3Mzc0MDAwMA\"",
 "id": "fbiua9g8bc3rim7hj6n8fge1o8",
 "status": "confirmed",
 "htmlLink": "https://www.google.com/calendar/event?eid=ZmJpdWE5ZzhiYzNyaW03aGo2bjhmZ2UxbzgganN0cm9uY29zb0Bt",
 "created": "2014-06-16T11:43:56.000Z",
 "updated": "2014-06-16T11:43:56.943Z",
 "summary": "Test event",
 "creator": {
  "email": "jstroncoso@gmail.com",
  "displayName": "José A. F. Troncoso",
  "self": true
 },
 "organizer": {
  "email": "jstroncoso@gmail.com",
  "displayName": "José A. F. Troncoso",
  "self": true
 },
 "start": {
  "dateTime": "2014-06-19T12:00:00+02:00",
  "timeZone": "Europe/Madrid"
 },
 "end": {
  "dateTime": "2014-06-19T13:00:00+02:00",
  "timeZone": "Europe/Madrid"
 },
 "iCalUID": "fbiua9g8bc3rim7hj6n8fge1o8@google.com",
 "sequence": 0,
 "reminders": {
  "useDefault": false
 }
}

This is the output to the console when I drag the event on to the next day. This is the problem; the edit fails reporting a missing end time. This error happens every time I change an event or a task. 

akonadi_googlecalendar_resource_1(748)/LibKGAPI (raw data) KGAPI2::EventModifyJob::start: ("Authorization: Bearer ya29.LgCN7F4uoeTgISAAAAC2CubA1G4nKBrMXqXyv4Z_Djp8pmBvM_UTMJCe0MPyJA", "GData-Version: 3")
akonadi_googlecalendar_resource_1(748)/LibKGAPI KGAPI2::Job::enqueueRequest: Queued  QUrl( "https://www.googleapis.com/calendar/v3/calendars/jstroncoso@gmail.com/events/fbiua9g8bc3rim7hj6n8fge1o8" )
akonadi_googlecalendar_resource_1(748)/LibKGAPI KGAPI2::Job::Private::_k_dispatchTimeout: Dispatching request to  QUrl( "https://www.googleapis.com/calendar/v3/calendars/jstroncoso@gmail.com/events/fbiua9g8bc3rim7hj6n8fge1o8" )
akonadi_googlecalendar_resource_1(748)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_dispatchTimeout: "{ "description" : "", "end" : { "dateTime" : "2014-06-20T13:00:00+02:00", "timeZone" : "Europe/Madrid" }, "id" : "fbiua9g8bc3rim7hj6n8fge1o8", "location" : "", "reminders" : { "overrides" : [  ], "useDefault" : false }, "start" : { "dateTime" : "2014-06-20T12:00:00+02:00", "timeZone" : "Europe/Madrid" }, "status" : "confirmed", "summary" : "Test event", "transparency" : "opaque", "type" : "calendar#event" }"
akonadi_googlecalendar_resource_1(748)/kio (Scheduler) KIO::SchedulerPrivate::doJob: KIO::SimpleJob(0xa2becf0)
akonadi_googlecalendar_resource_1(748)/kio (KIOJob) KIO::TransferJob::slotFinished: KUrl("https://www.googleapis.com/calendar/v3/calendars/jstroncoso@gmail.com/events/fbiua9g8bc3rim7hj6n8fge1o8")
akonadi_googlecalendar_resource_1(748)/kio (Scheduler) KIO::SchedulerPrivate::jobFinished: KIO::TransferJob(0xa2becf0) KIO::Slave(0xa1da8e0)
akonadi_googlecalendar_resource_1(748)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Received reply from  QUrl( "https://www.googleapis.com/calendar/v3/calendars/jstroncoso@gmail.com/events/fbiua9g8bc3rim7hj6n8fge1o8" )
akonadi_googlecalendar_resource_1(748)/LibKGAPI (raw data) KGAPI2::Job::Private::_k_replyReceived: "{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Missing end time."
   }
  ],
  "code": 400,
  "message": "Missing end time."
 }
}
"
akonadi_googlecalendar_resource_1(748)/LibKGAPI KGAPI2::Job::Private::_k_replyReceived: Bad request, Google replied ' "{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Missing end time."
   }
  ],
  "code": 400,
  "message": "Missing end time."
 }
}
" ' 
akonadi_googlecalendar_resource_1(748)/LibKGAPI KGAPI2::Job::emitFinished:
Comment 4 José Troncoso 2014-07-28 07:19:57 UTC
The problem continues with the recent KDE 4.13.3 release and verion 2.1.1 of libkgapi. I have found a somewhat awkward workaround, though:

1. Edit a task or event on KAddressBook. (doesn't sync)
2. Cut it. (syncs)
3. Paste it again. (syncs)
Comment 5 José Troncoso 2014-08-27 07:55:01 UTC
With KDE 4.14.0 and libkgapi 2.2.0 things are getting a little better:

1. Tasks seem to sync fine when created, deleted and modified either way. However I still get the (false?) message "Invalid item payload".

2. Events don't seem to have improved: they sync correctly when created and deleted, but not when modified. Here when sync doesn't work I get the error message "Bad request".
Comment 6 Sebastian Niemeyer 2014-09-15 08:59:00 UTC
I can confirm this bug
Comment 7 Daniel Eimer 2014-09-22 05:44:08 UTC
+1
Comment 8 Jonny Mo 2014-10-27 08:34:46 UTC
I can confirm this bug
Comment 9 brice83 2014-10-28 10:18:58 UTC
same here, change a date of a calendar entry but it is not update on google
Comment 10 nmset 2014-11-11 19:21:30 UTC
I had a similar 'Bad request' error, when adding a new event. It turned out to be a badly configured time zone on my system. On the new event dialog, the combo box shown after clicking the blue 'Time zone' line was /etc/localtime, and not a real time zone.

The file /etc/localtime was a regular file and not a link. After deleting that file and linking to /usr/share/zoneinfo/Europe/Paris, events could be added flawlessly.

It may not fit to all who have reported above, worth trying however.
Comment 11 nmset 2014-11-11 19:22:13 UTC
I had a similar 'Bad request' error, when adding a new event. It turned out to be a badly configured time zone on my system. On the new event dialog, the combo box shown after clicking the blue 'Time zone' line was /etc/localtime, and not a real time zone.

The file /etc/localtime was a regular file and not a link. After deleting that file and linking to /usr/share/zoneinfo/Europe/Paris, events could be added flawlessly.

It may not fit to all who have reported above, worth trying however.
Comment 12 José Troncoso 2014-11-11 20:29:13 UTC
My time zone is correctly configured (/etc/localtime -> /usr/share/zoneinfo/Europe/Madrid). However something is wrong with time zones because when I create an event on my Android phone the time zone is set by default to Central European Standard Time, but when I open the event on Korganizer the time zone it shows is Africa/Ceuta. Then if I modify the event, the changes don't sync on Google Events.

On the other hand, task syncing seems to have been working fine for some time now.
Comment 13 Jonny Mo 2014-11-14 09:25:44 UTC
My time zone is correctly configured. Sometimes i can change an event successfully. Sometimes not. To reproduce the problem do the following:

Create the event -> it works
Change the date of the event -> it works
Change the date a second time -> 'Bad request'

Add or delete a event will always work. Also all operations against other cloud solutions like owncloud will work.
Comment 14 bastian löher 2014-11-18 13:14:17 UTC
I can confirm this bug with the exact same behaviour on

Linux version 3.17.3-1-ARCH (builduser@thomas) (gcc version 4.9.2 (GCC) ) #1 SMP PREEMPT Fri Nov 14 23:13:48 CET 2014

using

libkgapi 2.2.0-1
kdepim-runtime 4.14.2-1
kdepimlibs 4.14.2-1
Comment 15 Jonny Mo 2015-01-20 18:49:37 UTC
No more problems when editing an event. All changes seems to be synced.
Comment 16 Christoph Feck 2015-02-15 10:49:30 UTC
Can someone confirm it is now working in the latest release?
Comment 17 Gordon 2015-02-15 11:50:58 UTC
Yes.  This bug appears to be fixed for events and tasks.
Comment 18 Christoph Feck 2015-02-15 15:38:28 UTC
Thanks for the update, let's close this.
Comment 19 Tom Kijas 2016-01-10 21:58:15 UTC
Can you please reopen it? It is NOT fixed in KDE5.4.
Comment 20 José Troncoso 2016-01-12 08:33:09 UTC
+1
This bug has reappeared some time ago. Now I have KOrganizer 5.1, KDE Frameworks 5.17.0 and Qt 5.5.1, and changes to events and tasks made on the web or mobile never sync to KOrganizer.
Comment 21 Daniel Vrátil 2016-03-31 00:32:30 UTC
I think the problem with changes on server not syncing to KOrganizer is caused by bug 355908 which has been fixed and will be available next release of libkgapi.
Comment 22 Tom Kijas 2016-12-06 12:27:10 UTC
(In reply to Daniel Vrátil from comment #21)
> I think the problem with changes on server not syncing to KOrganizer is
> caused by bug 355908 which has been fixed and will be available next release
> of libkgapi.

Unfortunately it seems the bug is still (or may be again) there, because in KDE5.8.4 Korganizer 5.3.3 can't fetch events (& tasks) from google.
Communication in the other direction works.