aluxnimm / outlookcaldavsynchronizer

Sync Outlook with Google, SOGo, Nextcloud or any other CalDAV/CardDAV server
GNU Affero General Public License v3.0
899 stars 95 forks source link

WebDavClientException: Response status code does not indicate success: '403' ('Forbidden') #416

Open romale opened 3 months ago

romale commented 3 months ago

Hi, first of all, thanks for the very useful utility. Zimbra 8.8.15 Outlook CalDav Synchronizer 4.4.1

Zimbra shared calendar between two users that has calendar read/write access. Some time (several times per day) they have error:

<?xml version="1.0" encoding="utf-16"?>
<SynchronizationReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ProfileName>Public Calendar</ProfileName>
  <ProfileId>746a23f0-7019-4f38-b173-c1446adbd238</ProfileId>
  <StartTime>2024-03-12T06:10:49.6923161Z</StartTime>
  <ADelta>Unchanged: 137 , Added: 0 , Deleted 0 ,  Changed 1</ADelta>
  <BDelta>Unchanged: 138 , Added: 0 , Deleted 0 ,  Changed 0</BDelta>
  <AJobsInfo>Create 0 , Update 0 , Delete 0</AJobsInfo>
  <BJobsInfo>Create 0 , Update 1 , Delete 0</BJobsInfo>
  <LoadErrors />
  <EntitySynchronizationReports>
    <EntitySynchronizationReport>
      <MappingErrors />
      <MappingWarnings />
      <AId>000000007D881EBDB9711D4B8AF8FDF5CC7A49C90700B41ECDBD69058F40A8F75A62EF6310E30000000000150000B41ECDBD69058F40A8F75A62EF6310E3000000008BBF0000</AId>
      <BId>/dav/calendar-owner%40example.com/Calendar/e65bf7ab-13d2-4d12-9b81-3f7bf3c047f6.ics</BId>
      <ExceptionThatLeadToAbortion>CalDavSynchronizer.DataAccess.WebDavClientException: Response status code does not indicate success: '403' ('Forbidden'). Message:

   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;EnsureSuccessStatusCode&gt;d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;ExecuteWebDavRequest&gt;d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.HttpClientBasedClient.WebDavClient.&lt;ExecuteWebDavRequestAndReturnResponseHeaders&gt;d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.DataAccess.CalDavDataAccess.&lt;TryUpdateEntity&gt;d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CalDavSynchronizer.Implementation.CalDavRepository`1.&lt;TryUpdate&gt;d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at CalDavSynchronizer.Implementation.CalDavRepository`1.&lt;TryUpdate&gt;d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at GenSync.EntityRepositories.BatchEntityRepositoryAdapter`4.&lt;PerformOperations&gt;d__3.MoveNext()</ExceptionThatLeadToAbortion>
      <Operation>UpdateInB</Operation>
    </EntitySynchronizationReport>
  </EntitySynchronizationReports>
  <ConsiderExceptionThatLeadToAbortionAsWarning>false</ConsiderExceptionThatLeadToAbortionAsWarning>
  <Duration>00:00:00.4800529</Duration>
</SynchronizationReport>

On server side log (nginx and zimbra):

10.11.10.166:54554 - calendar-owner [12/Mar/2024:09:10:50 +0300]  "PUT https://email.example.com/dav/calendar-owner%40example.com/Calendar/e65bf7ab-13d2-4d12-9b81-3f7bf3c047f6.ics HTTP/1.1" 403 135 "-" "CalDavSynchronizer/4.4" "10.11.1.5:8443" "10.11.1.5:443"

2024-03-12 09:10:50,602 INFO  [qtp252651381-2818666:https://email.example.com/dav/calendar-owner%40example.com/Calendar/e65bf7ab-13d2-4d12-9b81-3f7bf3c047f6.ics] [aname=calendar-owner@example.com;oip=10.11.10.166;port=53274;ua=CalDavSynchronizer/4.4;] dav - sending http error 403 because: Changing ORGANIZER of an appointment is not allowed: old='calendar-owner@example.com' new='user@example.com'
ethorn commented 1 month ago

I had the same problem. For me it worked after I did this: