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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 8.4.0, 8.5.0, 8.5.2, 8.5.3, 8.5.6, 8.5.7, 8.5.9
    • Apps - Team Calendar

      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.

            [CONFSERVER-91450] Subscribing to third party calendars with username + password causes a 500 Error

            What a bug. Since our Confluence-update to the LTS 8.5.x we are suffering from this issue. 
            @Altassian: Please get to the next step and plan a bugfix, 

            Alex Weiss added a comment - What a bug. Since our Confluence-update to the LTS 8.5.x we are suffering from this issue.  @Altassian: Please get to the next step and plan a bugfix, 

            Cornelius Gillner added a comment - This blocks me from connecting OpsGenie and Confluence: https://confluence.atlassian.com/teamcal/subscribe-to-opsgenie-calendars-from-team-calendars-1026533150.html

            Jan Usnul added a comment -

            Hello,

            When this bug will be corrected? It has been reported more than year ago. 

            Also, I don't understand why the priority is set as Low. This is a feature that worked in previous version but you broke. It's obvious bug that should have high priority. In addition, what is the point of having a team calendar in Confluence, if the main function (gather data from 3rd party calendars) does not work and as a bonus you haven't created REST API for team calendar, so the workaround doesn't exist.

            Jan Usnul added a comment - Hello, When this bug will be corrected? It has been reported more than year ago.  Also, I don't understand why the priority is set as Low. This is a feature that worked in previous version but you broke. It's obvious bug that should have high priority. In addition, what is the point of having a team calendar in Confluence, if the main function (gather data from 3rd party calendars) does not work and as a bonus you haven't created REST API for team calendar, so the workaround doesn't exist.

              Unassigned Unassigned
              9af32a41284c Jake Lyell
              Affected customers:
              22 This affects my team
              Watchers:
              26 Start watching this issue

                Created:
                Updated: