instructure/canvas-lms · error · Canvas::Migration::UnsupportedPackage

Unsupported content package

Error message

Unsupported content package

What it means

Canvas::Migration::PackageIdentifier#find_converter searches registered :export_system plugins for one whose settings[:provides] maps the identified package @type to a converter class. If no plugin provides a converter for that type, Canvas::Migration::UnsupportedPackage is raised.

Solutions

  1. Enable the appropriate export_system plugin/plugin setting for the package type
  2. Confirm the package is a supported format (Canvas export .imscc, QTI zip, etc.); re-export from the source LMS in a supported format
  3. Check Canvas::Plugin.all_for_tag(:export_system) in console to see which types are provided
  4. Upgrade Canvas if the source format is newer than the installed version supports

Example fix

// before (caller)
klass = Canvas::Migration::PackageIdentifier.identify_package(path)
cm.convert
// after
begin
  klass = Canvas::Migration::PackageIdentifier.identify_package(path)
rescue Canvas::Migration::UnsupportedPackage
  flash[:error] = I18n.t('This content package type is not supported')
end
Defensive patterns

Strategy: try-catch

Validate before calling

provided = Canvas::Plugin.all_for_tag(:export_system).flat_map { |p| (p.settings[:provides] || {}).keys }
raise 'unsupported type' unless provided.include?(type)

Type guard

def supported?(type)
  Canvas::Plugin.all_for_tag(:export_system).any? { |p| (p.settings[:provides] || {})[type] }
end

Try / catch

begin
  cm.convert
rescue Canvas::Migration::UnsupportedPackage
  render_unsupported_package_notice
end

Prevention

When it happens

Trigger: Identify_package returned a type (or :unknown) for which no enabled export_system plugin (e.g. canvas_cartridge, qti, moodle, blackboard) provides a converter — e.g. an unsupported LMS export or unknown file.

Common situations: Importing a package from an unsupported LMS, plugin disabled in account settings, new package format not recognized, generic .zip with no QTI/manifest structure.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15). Data as JSON: /api/errors/829bd2334bb0b484. Report an issue: GitHub.

Appendix: source

Thrown at lib/canvas/migration/package_identifier.rb:125

      doc = create_xml_doc(File.read(@archive.file))
      if get_node_val(doc, "metadata schema") =~ COMMON_CARTRIDGE_REGEX &&
         get_node_val(doc, "metadata schemaversion") == "1.3.0"
        :common_cartridge_1_3
      else
        :unknown
      end
    end

    def has_namespace(node, namespace)
      node.namespaces.values.any? { |ns| ns =~ /#{namespace}/i }
    end

    def find_converter
      if (plugin = Canvas::Plugin.all_for_tag(:export_system).find { |p| p.settings[:provides] && p.settings[:provides][@type] })
        return plugin.settings[:provides][@type]
      end

      raise Canvas::Migration::UnsupportedPackage, I18n.t(:unsupported_package, "Unsupported content package")
    end
  end
end

View on GitHub (pinned to 1c9f0bb801)