Adding a Caldav calendar not working ONLY in Zimbra

Questions, comments, and problems with Zimbra on Apple desktops & general CalDAV / CardDAV questions.
R4v3n
Posts: 3
Joined: Tue Jun 08, 2021 8:16 am

Adding a Caldav calendar not working ONLY in Zimbra

Postby R4v3n » Tue Jun 08, 2021 8:23 am

Hello folks,
I'm currently trying to add a Caldav calendar (hosted by 1and1/IONOS) in my Zimbra 9 OSE.
I can successfuly add this Caldav calendar in Thunderbird and the sync is perfectly working between Thunderbird and the 1and1 webmail calendar view.

I even can curl -u "user@domain.com:password" -X PROPFIND https://dav.mailxcha...v/CALENDARNAME without issue, even from my workstation or from my Ubuntu 18.04 VM hosting Zimbra.

But when I add this external calendar to Zimbra, nothing happens in the Zimbra web interface, and I got this stack trace in logs :

Code: Select all

com.zimbra.common.service.ServiceException: system failure: error importing CalDAV data
ExceptionId:ScheduledTask-1:1623137259086:42deea478071cff7
Code:service.FAILURE
at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:288)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:101)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:406)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:362)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:83)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:31)
at com.zimbra.common.util.TaskScheduler$TaskRunner.call(TaskScheduler.java:79)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: com.zimbra.cs.dav.DavException: DAV server returned an error: 401
at com.zimbra.cs.dav.client.WebDavClient.sendMultiResponseRequest(WebDavClient.java:117)
at com.zimbra.cs.dav.client.CalDavClient.login(CalDavClient.java:119)
at com.zimbra.cs.datasource.CalDavDataImport.getClient(CalDavDataImport.java:171)
at com.zimbra.cs.datasource.CalDavDataImport.syncFolders(CalDavDataImport.java:225)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:92)
... 10 more


So I got a 401 error, even if it's working with CURL and with Thunderbird. I even randomly got some 404 errors when zimbra is retrying to sync the calendar, but not every time.

I tried some differents syntax when adding the calendar to Zimbra, but everytime I got a 401 error.

What could be my error ? Is it my Zimbra who got a problem ?

Thanks a lot for your help !


jholder
Zimbra Employee
Zimbra Employee
Posts: 4724
Joined: Fri Sep 12, 2014 10:00 pm

Re: Adding a Caldav calendar not working ONLY in Zimbra

Postby jholder » Thu Jul 08, 2021 3:05 am

In your CURL you're passing authentication, but Zimbra is not. Make sure you pass a username and password in the URL:

http://(username):(password)@domain.com/caldav

401 means it doesn't like your password or username. So it's either wrong or not being sent. Probably not Zimbra.
R4v3n
Posts: 3
Joined: Tue Jun 08, 2021 8:16 am

Re: Adding a Caldav calendar not working ONLY in Zimbra

Postby R4v3n » Thu Jul 08, 2021 7:53 am

jholder wrote:In your CURL you're passing authentication, but Zimbra is not. Make sure you pass a username and password in the URL:

http://(username):(password)@domain.com/caldav

401 means it doesn't like your password or username. So it's either wrong or not being sent. Probably not Zimbra.

Thanks for answering.
I'll try this ASAP and will come back to give updates !
R4v3n
Posts: 3
Joined: Tue Jun 08, 2021 8:16 am

Re: Adding a Caldav calendar not working ONLY in Zimbra

Postby R4v3n » Fri Jul 09, 2021 10:05 am

jholder wrote:In your CURL you're passing authentication, but Zimbra is not. Make sure you pass a username and password in the URL:

http://(username):(password)@domain.com/caldav

401 means it doesn't like your password or username. So it's either wrong or not being sent. Probably not Zimbra.


jholder wrote:In your CURL you're passing authentication, but Zimbra is not. Make sure you pass a username and password in the URL:

http://(username):(password)@domain.com/caldav

401 means it doesn't like your password or username. So it's either wrong or not being sent. Probably not Zimbra.

So I tried different syntax but nothing works. I might be doing something wrong.
Note that my login is an email address, so it's always "user.name@domain.tld".

First, please can you confirm I set it right in zimbra ? :
Adding an external caldav Calendar, I set up :
- Type : Caldav account
- Email Address : user.name@domain.tld
- Password : mypassword

And then I have to set the caldav server and I tried many possibilities like :
- https://dav.mailxchange.1and1.fr/caldav/mycalendarname (it produces the error in my first post)

- https://user.name@domain.tld:mypassword ... lendarname ( it produces the following error in logs ) :

2021-07-09 11:47:53,756 INFO [ScheduledTask-1] [name=user.name@domain.tld;mid=29;ds=1;] datasource - Requested import.
2021-07-09 11:47:53,756 INFO [ScheduledTask-1] [name=user.name@domain.tld;mid=29;ds=1;] datasource - Importing data for data source '1'
2021-07-09 11:47:55,211 INFO [ScheduledTask-1] [name=user.name@domain.tld;mid=29;ds=1;] datasource - Import completed for data source '1'
2021-07-09 11:47:55,211 WARN [ScheduledTask-1] [name=user.name@domain.tld;mid=29;ds=1;] datasource - Scheduled DataSource import failed.
com.zimbra.common.service.ServiceException: system failure: error importing CalDAV data
ExceptionId:ScheduledTask-1:1625824075209:65687881df861679
Code:service.FAILURE
at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:288)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:101)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:406)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:362)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:83)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:31)
at com.zimbra.common.util.TaskScheduler$TaskRunner.call(TaskScheduler.java:79)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: com.zimbra.cs.dav.DavException: DAV server returned an error: 404
at com.zimbra.cs.dav.client.WebDavClient.sendMultiResponseRequest(WebDavClient.java:117)
at com.zimbra.cs.dav.client.CalDavClient.login(CalDavClient.java:119)
at com.zimbra.cs.datasource.CalDavDataImport.getClient(CalDavDataImport.java:171)
at com.zimbra.cs.datasource.CalDavDataImport.syncFolders(CalDavDataImport.java:225)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:92)
... 10 more



- https://"user.name@domain.tld":"mypassword"@dav.mailxchange.1and1.fr/caldav/mycalendarname (it produces the following error in logs ) :

2021-07-09 11:51:38,876 WARN [ScheduledTask-3] [name=user.name@domain.tld;mid=29;ds=1;] scheduler - Exception during execution of task com.zimbra.cs.datasource.DataSourceTask:8d897702-f4f1-4c5b-a431-c298e61ef5cd:29
java.lang.IllegalArgumentException: Illegal character in authority at index 8: https://"user.name@domain.tld":443/principals/users/user.name@domain.tld
at java.base/java.net.URI.create(URI.java:906)
at org.apache.http.client.methods.HttpPut.<init>(HttpPut.java:65)
at com.zimbra.cs.dav.client.DavRequest$2.<init>(DavRequest.java:309)
at com.zimbra.cs.dav.client.DavRequest.getHttpMethod(DavRequest.java:309)
at com.zimbra.cs.dav.client.WebDavClient.execute(WebDavClient.java:255)
at com.zimbra.cs.dav.client.WebDavClient.executeFollowRedirect(WebDavClient.java:186)
at com.zimbra.cs.dav.client.WebDavClient.sendMultiResponseRequest(WebDavClient.java:114)
at com.zimbra.cs.dav.client.CalDavClient.login(CalDavClient.java:119)
at com.zimbra.cs.datasource.CalDavDataImport.getClient(CalDavDataImport.java:171)
at com.zimbra.cs.datasource.CalDavDataImport.syncFolders(CalDavDataImport.java:225)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:92)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:406)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:362)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:83)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:31)
at com.zimbra.common.util.TaskScheduler$TaskRunner.call(TaskScheduler.java:79)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.net.URISyntaxException: Illegal character in authority at index 8: https://"user.name@domain.tld":443/principals/users/user.name@domain.tld
at java.base/java.net.URI$Parser.fail(URI.java:2936)
at java.base/java.net.URI$Parser.parseAuthority(URI.java:3270)
at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3181)
at java.base/java.net.URI$Parser.parse(URI.java:3137)
at java.base/java.net.URI.<init>(URI.java:623)
at java.base/java.net.URI.create(URI.java:904)
... 20 more


- https://user.name\@domain.tld:mypassword@dav.mailxchange.1and1.fr/caldav/mycalendarname (Trying to escape the @, it produces the following error in logs ) :

java.lang.IllegalArgumentException: Illegal character in authority at index 8: https://user.name\@domain.tld:443/principals/users/user.name@domain.tld

- user.name@domain.tld">https://(user.name@domain.tld):(mypassword)@dav.mailxchange.1and1.fr/caldav/mycalendarname (Trying to copy your exact suggestion, it produces the following error in logs ) :

com.zimbra.common.service.ServiceException: system failure: error importing CalDAV data
ExceptionId:ScheduledTask-7:1625824757535:65687881df861679
Code:service.FAILURE
at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:288)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:103)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:406)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:362)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:83)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:31)
at com.zimbra.common.util.TaskScheduler$TaskRunner.call(TaskScheduler.java:79)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.net.UnknownHostException: axessim.fr)
at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:798)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1489)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1348)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1282)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at com.zimbra.cs.dav.client.WebDavClient.executeMethod(WebDavClient.java:285)
at com.zimbra.cs.dav.client.WebDavClient.execute(WebDavClient.java:259)
at com.zimbra.cs.dav.client.WebDavClient.executeFollowRedirect(WebDavClient.java:186)
at com.zimbra.cs.dav.client.WebDavClient.sendMultiResponseRequest(WebDavClient.java:114)
at com.zimbra.cs.dav.client.CalDavClient.login(CalDavClient.java:119)
at com.zimbra.cs.datasource.CalDavDataImport.getClient(CalDavDataImport.java:171)
at com.zimbra.cs.datasource.CalDavDataImport.syncFolders(CalDavDataImport.java:225)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:92)
... 10 more


-- https://user.name%40domain.tld:mypasswo ... lendarname (Trying to change @ by %40, it produces the following error in logs ) :

com.zimbra.common.service.ServiceException: system failure: error importing CalDAV data
ExceptionId:ScheduledTask-1:1625824930353:65687881df861679
Code:service.FAILURE
at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:288)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:101)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:406)
at com.zimbra.cs.datasource.DataSourceManager.importData(DataSourceManager.java:362)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:83)
at com.zimbra.cs.datasource.DataSourceTask.call(DataSourceTask.java:31)
at com.zimbra.common.util.TaskScheduler$TaskRunner.call(TaskScheduler.java:79)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: com.zimbra.cs.dav.DavException: DAV server returned an error: 404
at com.zimbra.cs.dav.client.WebDavClient.sendMultiResponseRequest(WebDavClient.java:117)
at com.zimbra.cs.dav.client.CalDavClient.login(CalDavClient.java:119)
at com.zimbra.cs.datasource.CalDavDataImport.getClient(CalDavDataImport.java:171)
at com.zimbra.cs.datasource.CalDavDataImport.syncFolders(CalDavDataImport.java:225)
at com.zimbra.cs.datasource.CalDavDataImport.importData(CalDavDataImport.java:92)
... 10 more

So currently I'm don't know what to try. The fact is, I don't know exactly how zimbra send it and try to auth itself. But I guess it's the key to have the right syntax.
shadow-13
Posts: 1
Joined: Fri Nov 19, 2021 4:06 pm

Re: Adding a Caldav calendar not working ONLY in Zimbra

Postby shadow-13 » Fri Nov 19, 2021 4:21 pm

hello, i hope this info will help you:

zimbra have a hardcoded url for external caldav:

my connect string from "Add external calendar":
TYPE: CalDAV Account
Email address: burninhell@someaccount.com
Password: **********
CalDAV Server: http://server.example.com:21002/custom/ ... enjHBGdle/

tcpdump from zimbra server:
request: PROPFIND /principals/users/burninhell@someaccount.com HTTP/1.1
answer: HTTP/1.1 404 Not Found


As you can see no one external calendar not be able to work except your caldav url would be strongly match hardcoded request...

Sorry:)

Return to “CalDAV / CardDAV / iSync”

Who is online

Users browsing this forum: No registered users and 2 guests