Unable to access work items after project rename and group move

Project namespace parent_id and traversal_ids not updated after project transfer

Summary

After gitlab-org/theseus was transferred into a newly created gitlab-org/theseus group (and renamed back to theseus, giving gitlab-org/theseus/theseus), the project's work items became inaccessible via the work item list. The issues themselves are not lost, but the project namespace record was left in an inconsistent state: parent_id and traversal_ids on the namespaces row still point at the old parent.

Steps taken that led to this

On 2026-08-06 19:34 UTC:

  1. gitlab-org/theseus (project) renamed to theseus_tmp
  2. New group gitlab-org/theseus created
  3. Project transferred into the new group
  4. Project renamed back to theseus, giving gitlab-org/theseus/theseus

Current state

project(fullPath: "gitlab-org/theseus/theseus") returns issues as expected. namespace(fullPath: "gitlab-org/theseus/theseus") returns null, which is what the work item list uses, so the work items list renders empty.

The namespaces data looks like this:

id parent_id traversal_ids path type
9970 {9970} gitlab-org Group
132612787 9970 {9970,132612787} theseus Project
139145892 9970 {9970,139145892} theseus Group

The project namespace (132612787) should have parent_id = 139145892 and traversal_ids = {9970,139145892,132612787}. Instead it still sits directly under gitlab-org.

Hypothesis

The transfer updated projects.namespace_id and the routes record, but the project namespace's parent_id / traversal_ids were never synced. That sync is application-level (Project#ensure_project_namespace_in_sync), so whatever performed the transfer either bypassed or failed that step.

Open questions:

  • Is this a race condition between the rename and the transfer? Both happened within minutes of each other, and we have been moving these operations to async workers recently.
  • Did the group and project sharing the same path (theseus) contribute? Renaming the project to theseus-docs and back did not resolve it, so a plain rename does not re-trigger the sync.
  • traversal_ids are repopulated by a separate worker. The WorkItems::TraversalIdsHealingCronWorker (FF work_items_traversal_ids_healing_service, default_enabled: true) has not healed this, which suggests the root cause is upstream of issues.namespace_traversal_ids — ie. the namespace hierarchy itself is wrong, not just the denormalised column on issues.

Proposed next steps

  1. Get rails-ro access on production via Teleport and confirm the state of the namespaces and routes records for gitlab-org/theseus/theseus.
  2. Confirm whether Namespace.find_by_full_path('gitlab-org/theseus/theseus') resolves at all, and if not, whether the routes record is also affected.
  3. Correct the data for this project so the customer's work items are visible again.
  4. Identify the code path that skipped ensure_project_namespace_in_sync and determine whether other projects are affected. If so, quantify the blast radius with a query for project namespaces whose parent_id does not match their project's namespace_id.
  5. Fix the underlying transfer path and add regression coverage.

Impact

Work items are invisible in the UI for any affected project. We do not yet know whether gitlab-org/theseus/theseus is the only one.

References

Edited by Matt Andrews