Viewing Team Calendars for Confluence result in 500 error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

 

プラットフォームについて: Server、Data Center、および Cloud (状況に応じる) - この記事はアトラシアンのサーバーおよびデータセンター プラットフォーム向けに記載されていますが、Atlassian Cloud のお客様も記事の内容を利用できる可能性があります。この記事で説明されている手順の実施が役立つと考えられる場合、アトラシアン サポートにお問い合わせのうえ、この記事を紹介してください。

問題

When attempting to view Team Calendars for Confluence, users receive a 500 error as shown below:

atlassian-confluence.log に次のメッセージが出力される。

2015-07-26 02:31:28,532 ERROR [http-8080-exec-997] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service
 -- url: /confluence/rest/calendar-services/1.0/calendar/search/subcalendars/all | userName: admin | referer: http://localhost:8090/confluence/calendar/mycalendar.action
java.lang.NullPointerException
	at com.atlassian.confluence.extra.calendar3.rest.SubCalendarsResponseEntity$ExtendedSubCalendar$PermittedUserComparator.compare(SubCalendarsResponseEntity.java:574)
	at com.atlassian.confluence.extra.calendar3.rest.SubCalendarsResponseEntity$ExtendedSubCalendar$PermittedUserComparator.compare(SubCalendarsResponseEntity.java:569)
	at java.util.TimSort.binarySort(TimSort.java:265)
	at java.util.TimSort.sort(TimSort.java:190)
	at java.util.TimSort.sort(TimSort.java:173)
	at java.util.Arrays.sort(Arrays.java:659)
	at java.util.Collections.sort(Collections.java:217)
	at com.google.common.collect.ComparatorOrdering.sortedCopy(ComparatorOrdering.java:51)
	at com.atlassian.confluence.extra.calendar3.rest.SubCalendarsResponseEntity$ExtendedSubCalendar.getUsersPermittedToEdit(SubCalendarsResponseEntity.java:355)
	at com.atlassian.confluence.extra.calendar3.rest.SubCalendarsResponseEntity$ExtendedSubCalendar.toJson(SubCalendarsResponseEntity.java:428)
	at com.atlassian.confluence.extra.calendar3.rest.SubCalendarsResponseEntity.toJson(SubCalendarsResponseEntity.java:79)
	at com.atlassian.confluence.extra.calendar3.rest.CalendarResource$26.doInTransaction(CalendarResource.java:1838)
	at com.atlassian.confluence.extra.calendar3.rest.CalendarResource$26.doInTransaction(CalendarResource.java:1793)
	at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25)
	at com.atlassian.sal.spring.component.SpringHostContextAccessor$1.doInTransaction(SpringHostContextAccessor.java:88)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)

診断

The above stacktrace came from Team Calendars for Confluence 4.3.13 and the related source code indicates that it was doing an user comparison for sub-calendar restrictions:

Source Code

       private static class PermittedUserComparator implements Comparator<PermittedUser>
        {
            @Override
            public int compare(PermittedUser leftUser, PermittedUser rightUser)
            {
                int result = leftUser.getFullName().compareTo(rightUser.getFullName());    //line 574 NPE
                if (0 == result)
                    result = leftUser.getId().compareTo(rightUser.getId());
                
                return result;
            }

原因

  1. When viewing Team Calendars for Confluence, it makes a check for view and edit restrictions. During this check, it hits a NPE indicating that an user reference does not exist.
  2. A second scenario may occur relating to subscriptions, see here:  TEAMCAL-1759 - Getting issue details... STATUS

ソリューション

Backup the database before attempting any of the below instructions

  1. Identify the reference that may be pointing at an non-existent user:

    select * from "AO_950DC3_TC_SUBCALS_PRIV_USR" c left join user_mapping u on c."USER_KEY"=u.user_key where lower_username not in (select lower_user_name from cwd_user);
    1. Any results returned are restrictions set for users that do not exist in the user listing

  2. Remove the restriction references AO_950DC3_TC_SUBCALS_PRIV_USR

    delete from "AO_950DC3_TC_SUBCALS_PRIV_USR" where "ID" = XXXXX;
     
    Replace XXXXX with the proper ID returned from the first SQL query.
  3. Flush Confluence's caches: Confluence Admin > Administration > Cache Statstics > Flush All

 

Last modified on Mar 30, 2016

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.