Team Calendars Who field is not saving events due to DB table incorrect casing

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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


The team calendar is unable to save new users to the WHO field.

You are able to search the users and add them to the field, but the changes will not be saved.

Environment

  • Confluence Server or Data Center 7.3.5 (it can happen in newer versions)
  • Team Calendar 6.0.53 (also verified in versions 6.0.47 and 6.0.50)
  • PostgreSQL Database

Diagnosis

  1. Open a calendar event (or create a new one)
  2. Attempt to add a person into the WHO field
  3. Save the event
  4. See that changes will not persist and no errors appear in the interface. 

It's necessary to enable the DB trace logs to identify the root cause. In this case, we can see 2 tables with the same name but different casing:

LOG:  execute <unnamed>: delete from "ao_950dc3_tc_events_invitees"
	where "ao_950dc3_tc_events_invitees"."EVENT_ID" = $1
LOG:  execute <unnamed>: SELECT * FROM "AO_950DC3_TC_EVENTS_INVITEES" WHERE "EVENT_ID" = $1
LOG:  execute <unnamed>: SELECT NEXTVAL('"AO_950DC3_TC_EVENTS_INVITEES_ID_seq"')
LOG:  execute <unnamed>: INSERT INTO "AO_950DC3_TC_EVENTS_INVITEES" ("INVITEE_ID","EVENT_ID","ID") VALUES ($1,$2,$3)

Per the example above, log in to Confluence Postgres schema and check if there are lower case team calendar tables using the following SQL command.

select table_schema,
       table_name
from information_schema.tables
where table_name like 'ao_950dc3_tc%';

If any results are returned by the query above, the tables must be transformed into upper case.

Cause

The issue is caused by the different casing in the name of Team Calendar tables. It's unknown at this point what caused the incorrect casing in the first place.

In a Postgres database, having lowercase letters on the Team Calendars table names can trigger this behavior.


Solution

Always back up the database before performing any modification for safety reasons. First, validate and test any changes on a staging instance before deploying on production.

  1. We need to ensure that the Team Calendar tables (AO_950DC3_TC*) are all upper case.
  2. If necessary, we can use the ALTER TABLE command to rename the lower case tables into upper case, as follows:
ALTER TABLE "ao_950dc3_tc_events_invitees" RENAME TO "AO_950DC3_TC_EVENTS_INVITEES"
  • In this example, we are renaming one of the Team Calendars tables, AO_950DC3_TC_EVENTS_INVITEES, that was lower case, to upper case.


Last modified on Oct 9, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.