{"record":{"id":"d1318ddcf771bf17","repo":"instructure/canvas-lms","slug":"invalid-item-type","errorCode":null,"errorMessage":"Invalid item type","messagePattern":"Invalid item type","errorType":"exception","errorClass":"OtherError","httpStatus":null,"severity":"error","filePath":"gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb","lineNumber":275,"sourceCode":"        list.item << NVPair.new(\"qdbAreas\", \"course\")\n        list.item << NVPair.new(\"qdbSupport\", \"publish,replace\")\n        list.item << NVPair.new(\"qdbQuestions\", \"multipleChoice,multipleResponse,trueFalse,essay,matchingSimple,matchingComplex,fillInBlank\")\n        list.item << NVPair.new(\"qdbSettings\", \"\")\n        list.item << NVPair.new(\"attachmentLinking\", \"resolve\")\n        list.item << NVPair.new(\"uploadTypes\", \"zipPackage\")\n      when \"course\"\n        raise(OtherError, \"Item type incompatible with selection state\") unless selection_state.empty?\n\n        @user.cached_currentish_enrollments(preload_courses: true).select(&:participating_admin?).map(&:course).uniq.each do |course|\n          list.item << NVPair.new(course.name, course.to_param)\n        end\n      when \"quiz\", \"qdb\"\n        coll = get_scope(session, itemType)\n        coll.each do |item|\n          list.item << NVPair.new(item.title, item.to_param)\n        end\n      else\n        raise OtherError, \"Invalid item type\"\n      end\n      raise(OtherError, \"No items found\") if list.item.empty? && ![\"quiz\", \"qdb\"].include?(itemType)\n\n      [list]\n    end\n\n    # SYNOPSIS\n    #   SelectServerItem(userName, password, context, itemType, itemID, clearState)\n    #\n    # ARGS\n    #   userName        C_String - {http://www.w3.org/2001/XMLSchema}string\n    #   password        C_String - {http://www.w3.org/2001/XMLSchema}string\n    #   context         C_String - {http://www.w3.org/2001/XMLSchema}string\n    #   itemType        C_String - {http://www.w3.org/2001/XMLSchema}string\n    #   itemID          C_String - {http://www.w3.org/2001/XMLSchema}string\n    #   clearState      C_String - {http://www.w3.org/2001/XMLSchema}string\n    #\n    # RETURNS","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb#L257-L293","documentation":"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.","triggerScenarios":"Calling getServerItems via the Respondus SOAP endpoint with an itemType other than \"quiz\" or \"qdb\" (e.g. \"course\", \"content\", or a typo like \"quizes\").","commonSituations":"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.","solutions":["Change the SOAP client request to use itemType \"quiz\" or \"qdb\" only in getServerItems","Verify the Respondus client version is configured for Canvas servers (correct server type in Respondus settings)","Check that the itemType string has no typos or extra whitespace"],"exampleFix":"// before\nclient.getItems(\"course\")\n// after\nclient.getItems(\"quiz\") // or \"qdb\"","handlingStrategy":"validation","validationCode":"const VALID = [\"quiz\", \"qdb\"];\nif (!VALID.includes(itemType)) throw new Error(`itemType must be quiz or qdb, got ${itemType}`);","typeGuard":null,"tryCatchPattern":"begin\n  list = servant.getServerItems(session, itemType)\nrescue RespondusApi::OtherError => e\n  retry with itemType = \"quiz\"\nend","preventionTips":["Whitelist only quiz/qdb item types in client code","Match the Respondus client server profile to Canvas","Trim/normalize itemType strings before the SOAP call"],"tags":["soap","invalid-argument","respondus"],"backgroundTag":"invalid-enum-value","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}