Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-91450

Subscribing to third party calendars with username + password causes a 500 Error

XMLWordPrintable

      Issue Summary

      Trying to subscribe to a third party calendar in TeamCal causes a IllegalArgumentException: "Host name may not be null" error on the page. This was caused by upgrading from the deprecated "HttpRetreivalService" to "SAL".

      Steps to Reproduce

      1. Open Team Calendar
      2. Press "Subscribe by URL" button
      3. Enter a name, calendar URL, username, password and space
      4. Press "Subscribe"

      Expected Results

      User is subscribed to the calendar after username and password are authenticated

      Actual Results

      Error "Host name may not be null" appears at the top of the page, and the user isn't subscribed to the calendar

      The below exception is thrown in the logs:

      2023-09-07 13:58:22,502 ERROR [http-nio-6850-exec-3 url: /c850/rest/calendar-services/1.0/calendar/subcalendars.json; user: admin] [extra.calendar3.rest.AbstractResource] getResponseError Unable to save/update sub-calendar test cal 850
       -- url: /c850/rest/calendar-services/1.0/calendar/subcalendars.json | userName: admin | referer: http://localhost:6850/c850/calendar/mycalendar.action | traceId: 2cde35a676b29bd7
      java.lang.IllegalArgumentException: Host name may not be null
      	at org.apache.http.util.Args.containsNoBlanks(Args.java:81)
      	at org.apache.http.HttpHost.<init>(HttpHost.java:80)
      	at org.apache.http.HttpHost.<init>(HttpHost.java:135)
      	at com.atlassian.sal.core.net.HttpClientRequest.addBasicAuthentication(HttpClientRequest.java:136)
      	at com.atlassian.sal.core.net.HttpClientRequest.addBasicAuthentication(HttpClientRequest.java:52)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      	at com.sun.proxy.$Proxy3304.addBasicAuthentication(Unknown Source)
      	at com.atlassian.plugins.rest.module.jersey.JerseyRequest.addBasicAuthentication(JerseyRequest.java:36)
      	at com.atlassian.plugins.rest.module.jersey.JerseyRequest.addBasicAuthentication(JerseyRequest.java:21)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.atlassian.plugins.rest.module.ContextClassLoaderSwitchingProxy.invoke(ContextClassLoaderSwitchingProxy.java:22)
      	at com.sun.proxy.$Proxy3306.addBasicAuthentication(Unknown Source)
      	at com.atlassian.confluence.extra.calendar3.calendarstore.SubscriptionCalendarDataStore.validate(SubscriptionCalendarDataStore.java:196)
      	at com.atlassian.confluence.extra.calendar3.calendarstore.CalendarDataStoreCachingDecorator.validate(CalendarDataStoreCachingDecorator.java:111)
      	at com.atlassian.confluence.extra.calendar3.calendarstore.DelegatingCalendarDataStore.validate(DelegatingCalendarDataStore.java:72)
      	at com.atlassian.confluence.extra.calendar3.DefaultCalendarManager.validateSubCalendar(DefaultCalendarManager.java:336)
      	at com.atlassian.confluence.extra.calendar3.rest.resources.CalendarResource.updateSubCalendarInternal(CalendarResource.java:445)
      	at com.atlassian.confluence.extra.calendar3.rest.resources.CalendarResource.updateSubCalendar(CalendarResource.java:362) 

      Workaround

      Not entering a username and password for public calendars seems to allow subscription. If the calendar requires a username, it cannot be subscribed to.

              57d227d4f2de Aakash Jain (Inactive)
              9af32a41284c Jake Lyell
              Votes:
              23 Vote for this issue
              Watchers:
              29 Start watching this issue

                Created:
                Updated: