User is unable to add an Existing Calendar in My Calendars page
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
User is trying to add an existing calendar as described in Create, Add, and Edit Calendars, but despite being able to search for it, nothing happens after clicking Add
Environment
Confluence 7.19.X and earlier versions
Confluence 8.1.X
Diagnosis
This issue is related to certain UUID values containing multiple digit-only segments. Hence, to confirm if your user is affected by this issue, it is needed to review the UUID associated with this user's subscriptions.
PostgreSQL
SELECT user_key FROM user_mapping WHERE lower_username = '<username>';
SELECT *
FROM "AO_950DC3_TC_SUBCALS" tc
LEFT JOIN "user_mapping" um ON um."user_key" = tc."CREATOR"
WHERE um."user_key" = '<user_key_from_query1>'
AND "PARENT_ID" IS NULL AND "SUBSCRIPTION_ID" IS NOT NULL
ORDER BY 1,2
As an example, if the previous query retrieves the following three IDs, it is noticeable that Calendar2 has an UUID value which consist of multiple consecutive digit-only segments:
- d0e49560-b080-4543-b874-84b773cab3a6 (Calendar1)
- d980d7cc-66ac-4286-8826-7ad1290fce98 (Calendar2)
- 1a787934-97ce-449c-9ac6-90b0828ed2fd (Calendar3)
Cause
The problem is that Team Calendars cannot return the correct calendars for certain UUIDs even though they exist in the DB. This causes certain calendars to be inaccessible to certain users or groups of users. It can also cause affected calendars to be uneditable.
Further information is available in bug:
CONFSERVER-81477 - Team Calendar does not return expected records from DB
Please check our KB article A specific calendar disappears when adding another Calendar in My Calendars page as a different side effect of this same bug when the user is the Creator of the affected Calendar
Solution
The only solution that guarantees not to reproduce the issue anymore is to upgrade your instance to Confluence 8.2.0 or later version.
Workaround
It's possible to forcefully recreate the affected user's subscriptions in an attempt to get an unaffected ID, however, there is no guarantee that the issue will not reoccur afterwards.
The new subscriptions might generate new UUIDs which consist of a multiple consecutive digit-only segments, which will trigger the bug once more. The workaround can be executed multiple times until all the UUIDs are valid, but this does not prevent either that future subscriptions trigger the issue again.
Always Backup your data before performing any modifications to the database. If possible, test any ALTER, INSERT, UPDATE or DELETE SQL statements on a staging server first.
Generate an up-to-date backup of the user's Calendar data by saving the current calendar subscription information for this user on a .csv file:
SELECT user_key FROM user_mapping WHERE lower_username = '<username>';
SELECT * FROM OS_PROPERTYENTRY WHERE entity_name = 'USERPROPS-<user_key_from_query1>' AND entity_key = 'calendar';
SELECT * FROM "AO_950DC3_TC_SUBCALS" WHERE "CREATOR" = '<user_key_from_query1>' AND "SUBSCRIPTION_ID" IS NOT NULL;
- Shutdown Confluence
Delete all the data regarding this user's Team Calendar subscriptions:
SELECT user_key FROM user_mapping WHERE lower_username = '<username>';
DELETE FROM OS_PROPERTYENTRY WHERE entity_name = 'USERPROPS-<user_key_from_query1>' AND entity_key = 'calendar';
DELETE FROM "AO_950DC3_TC_SUBCALS" WHERE "CREATOR" = '<user_key_from_query1>' AND "SUBSCRIPTION_ID" IS NOT NULL;
- Commit the changes.
- Start Confluence
- Ask the user to manually resubscribe to the Team Calendars through the Confluence UI
If the user encounters an error when attempting to subscribe to calendars, it might be necessary for them to create a calendar first, and then attempt to subscribe to existing calendars again.