instructure/canvas-lms · error · OtherError

Invalid item type

Error message

Invalid item type

What it means

The Respondus SOAP API endpoint getServerItems only supports listing items of type "quiz" or "qdb" (question database). Any other itemType string in the SOAP request falls through the case statement to the else branch, raising OtherError. This guards the discovery API against unsupported item categories.

Solutions

  1. Change the SOAP client request to use itemType "quiz" or "qdb" only in getServerItems
  2. Verify the Respondus client version is configured for Canvas servers (correct server type in Respondus settings)
  3. Check that the itemType string has no typos or extra whitespace

Example fix

// before
client.getItems("course")
// after
client.getItems("quiz") // or "qdb"
Defensive patterns

Strategy: validation

Validate before calling

const VALID = ["quiz", "qdb"];
if (!VALID.includes(itemType)) throw new Error(`itemType must be quiz or qdb, got ${itemType}`);

Try / catch

begin
  list = servant.getServerItems(session, itemType)
rescue RespondusApi::OtherError => e
  retry with itemType = "quiz"
end

Prevention

When it happens

Trigger: Calling getServerItems via the Respondus SOAP endpoint with an itemType other than "quiz" or "qdb" (e.g. "course", "content", or a typo like "quizes").

Common situations: A Respondus client configured to browse a different server product (e.g. Blackboard item types) pointed at Canvas; custom scripts passing course/content as itemType when only selectServerItem supports those.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb:275

        list.item << NVPair.new("qdbAreas", "course")
        list.item << NVPair.new("qdbSupport", "publish,replace")
        list.item << NVPair.new("qdbQuestions", "multipleChoice,multipleResponse,trueFalse,essay,matchingSimple,matchingComplex,fillInBlank")
        list.item << NVPair.new("qdbSettings", "")
        list.item << NVPair.new("attachmentLinking", "resolve")
        list.item << NVPair.new("uploadTypes", "zipPackage")
      when "course"
        raise(OtherError, "Item type incompatible with selection state") unless selection_state.empty?

        @user.cached_currentish_enrollments(preload_courses: true).select(&:participating_admin?).map(&:course).uniq.each do |course|
          list.item << NVPair.new(course.name, course.to_param)
        end
      when "quiz", "qdb"
        coll = get_scope(session, itemType)
        coll.each do |item|
          list.item << NVPair.new(item.title, item.to_param)
        end
      else
        raise OtherError, "Invalid item type"
      end
      raise(OtherError, "No items found") if list.item.empty? && !["quiz", "qdb"].include?(itemType)

      [list]
    end

    # SYNOPSIS
    #   SelectServerItem(userName, password, context, itemType, itemID, clearState)
    #
    # ARGS
    #   userName        C_String - {http://www.w3.org/2001/XMLSchema}string
    #   password        C_String - {http://www.w3.org/2001/XMLSchema}string
    #   context         C_String - {http://www.w3.org/2001/XMLSchema}string
    #   itemType        C_String - {http://www.w3.org/2001/XMLSchema}string
    #   itemID          C_String - {http://www.w3.org/2001/XMLSchema}string
    #   clearState      C_String - {http://www.w3.org/2001/XMLSchema}string
    #
    # RETURNS

View on GitHub (pinned to 1c9f0bb801)