{"record":{"id":"f8101e71a9411621","repo":"instructure/canvas-lms","slug":"invalid-item-identifier","errorCode":null,"errorMessage":"Invalid item identifier","messagePattern":"Invalid item identifier","errorType":"exception","errorClass":"OtherError","httpStatus":null,"severity":"error","filePath":"gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb","lineNumber":315,"sourceCode":"    #\n    def selectServerItem(userName, password, context, itemType, itemID, clearState)\n      selection_state = session[\"selection_state\"] ||= []\n      if clearState == \"true\"\n        selection_state.clear\n      end\n      if itemType == \"none\"\n        return []\n      end\n\n      # call the unwrapped version of getServerItem\n      list, _ = _getServerItems(userName, password, context, itemType)\n\n      case itemType\n      when \"course\", \"content\"\n        if list.item.find { |i| i.value == itemID }\n          selection_state << itemID\n        else\n          raise OtherError, \"Invalid item identifier\"\n        end\n      else\n        raise OtherError, \"Invalid item type\"\n      end\n\n      []\n    end\n\n    # SYNOPSIS\n    #   PublishServerItem(userName, password, context, itemType, itemName, uploadType, fileName, fileData)\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    #   itemName        C_String - {http://www.w3.org/2001/XMLSchema}string\n    #   uploadType      C_String - {http://www.w3.org/2001/XMLSchema}string","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/gems/plugins/respondus_soap_endpoint/lib/respondus_soap_endpoint/urn_RespondusAPIServant.rb#L297-L333","documentation":"selectServerItem validates that the requested itemID exists in the previously fetched item list before appending it to the selection state. If no list entry's value matches the given itemID, the ID does not correspond to any visible course/content item, so OtherError is raised.","triggerScenarios":"Calling selectServerItem with itemType \"course\" or \"content\" and an itemID that was never returned by getServerItems for the current session, or an ID belonging to a course outside the session's scope.","commonSituations":"Stale Respondus client cache referencing a deleted or renamed course; client hard-coding item IDs from another Canvas account/shard; session scope changed between listing and selecting.","solutions":["Re-fetch the item list with getServerItems and select an itemID from that fresh list","Confirm the item exists and is visible to the authenticated teacher in the session scope","Clear the client's cached selection state and restart the Respondus wizard"],"exampleFix":"// before\nclient.selectItem(\"course\", \"123456\") // stale id\n// after\nitems = client.getItems(\"course\")\nclient.selectItem(\"course\", items.first.value)","handlingStrategy":"validation","validationCode":"valid_ids = getServerItems(session, \"course\").map(&:value)\nraise \"unknown item id\" unless valid_ids.include?(itemID)","typeGuard":null,"tryCatchPattern":"begin\n  servant.selectServerItem(session, \"course\", itemID)\nrescue RespondusApi::OtherError\n  refresh item list and reselect\nend","preventionTips":["Always select IDs from a freshly fetched list","Do not cache item IDs across sessions","Verify the item is visible to the authenticated user's scope"],"tags":["soap","respondus","invalid-identifier"],"backgroundTag":"resource-not-found","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"}