Bug: course index returns 500 when the user's clipboard holds content from an uninstalled XBlock

Author: rpenidoCreated Sep 25, 2026Updated Sep 25, 2026
Labelsbug

Description:

If the user's clipboard holds content from an uninstalled XBlock, GET /api/contentstore/v1/course_index/<course_key> returns a 500 for every course a given user can see, with:

xblock.plugin.PluginMissingError: <block_type>
  cms/djangoapps/contentstore/utils.py                # initial_user_clipboard
  openedx/core/djangoapps/content_staging/serializers.py   # get_block_type_display
  cms/djangoapps/contentstore/helpers.py              # XBlock.load_class(category)

StagedContentSerializer.get_block_type_display calls cms.djangoapps.contentstore.helpers.xblock_type_display_name, which calls XBlock.load_class unconditionally, so it raises PluginMissingError when the plugin for the block type is not installed.

This is reachable in normal operation: the clipboard stores a copy of a block (with its OLX), and the plugin providing that block type can be removed from the platform afterwards. The clipboard is then permanently unreadable, and because initial_user_clipboard is part of the course index payload, the user cannot open any course in Studio.

/api/content-staging/v1/clipboard/ fails the same way, and it only exposes GET and POST, so the author has no way to discard the stale clipboard either.

Steps to reproduce:

  1. Install a third-party XBlock, e.g. cover (any block type not shipped with the platform works).
  2. Copy a block of that type in Studio (select the block -> Copy).
  3. Remove the plugin from the platform and restart the LMS/CMS.
  4. As the user that copied it, open any course in Studio.

Expected behavior:

Studio opens the course, and the clipboard shows the copied content with its raw block type as the name (as already happens for v2 libraries, see openedx.core.djangoapps.xblock.api.xblock_type_display_name, which catches PluginMissingError and returns the block type).

Actual behavior:

500 from the course index API; Studio shows a server error. The same exception breaks /api/content-staging/v1/clipboard/.

Additional information:

  • Fix proposed in #39152: catch PluginMissingError in StagedContentSerializer.get_block_type_display and fall back to obj.block_type, plus a regression test.

Source: openedx/openedx-platform