Jira server throws DirectoryNotFoundException after migration from Cloud

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs 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

Symptoms

The following error appears in atlassian-jira.log during a directory sync:

1 2 3 4 5 6 7 8 9 015-02-10 20:35:21,387 atlassian-scheduler-quartz1.clustered_Worker-3 ERROR [com.atlassian.scheduler.JobRunnerResponse] Unable to synchronise directory com.atlassian.crowd.exception.DirectoryNotFoundException: Directory <2> does not exist at com.atlassian.jira.crowd.embedded.JiraDirectorySynchroniser.runJob(JiraDirectorySynchroniser.java:71) at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:135) at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:101) at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:80) at com.atlassian.scheduler.quartz1.Quartz1Job.execute(Quartz1Job.java:32) at org.quartz.core.JobRunShell.run(JobRunShell.java:223) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)

ℹ️ In this case, the directory id is 2. This is needed for the resolution

Cause

During migration from Cloud to Server, the internal directory used for cloud authentication was not automatically deleted. A fix for this is being tracked in JRASERVER-43223 - Exporting from JIRA Cloud does not remove Directory Synchronisation Job resulting in Directory does not exist errors.

Resolution

Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

The orphaned synchronization job will need to be manually deleted from the database with the following queries:

  1. Identify the directory that is causing the errors.

    1. In the stack trace above, we see that the Directory ID is "2"

  2. Using the found ID, remove the orphaned entries from the database:

    1 2 3 delete from jquartz_triggers where trigger_name = 'com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.2'; delete from jquartz_simple_triggers where trigger_name = 'com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.2'; delete from clusteredjob where job_id = 'com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.2';

    ℹ️ Note the '2' id used at the end of the query. Ensure to replace this with the proper ID as indicated by the error message of your system.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.