{"record":{"id":"a85ebcb20e993fce","repo":"instructure/canvas-lms","slug":"requested-assignment-not-configured-for-external-tool","errorCode":null,"errorMessage":"Requested assignment not configured for external tool launches","messagePattern":"Requested assignment not configured for external tool launches","errorType":"exception","errorClass":"Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter","httpStatus":404,"severity":"error","filePath":"app/controllers/lti/ims/providers/memberships_provider.rb","lineNumber":170,"sourceCode":"      return nil unless rlid?\n      return @assignment if defined?(@assignment)\n\n      @assignment = Assignment.active.for_course(course.id)\n                              .joins(line_items: :resource_link)\n                              .where(lti_resource_links: { id: resource_link&.id })\n                              .distinct\n                              .take\n    end\n\n    def assignment?\n      assignment&.present?\n    end\n\n    def validate_tool!\n      raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter unless resource_link\n\n      if assignment? && !assignment.external_tool?\n        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(\n          \"Assignment (id: #{assignment&.id}, rlid: #{rlid}) is not configured for submissions via external tool\",\n          api_message: \"Requested assignment not configured for external tool launches\"\n        )\n      end\n\n      tool_tag = assignment&.external_tool_tag || content_tag\n      if tool_tag.blank?\n        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(\n          \"ContentTag (rlid: #{rlid}) not found\",\n          api_message: \"Requested ResourceLink was not found\"\n        )\n      end\n      if tool_tag.content_type != \"ContextExternalTool\"\n        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(\n          \"ResourceLink (rlid: #{rlid}) needs content tag type 'ContextExternalTool' but found #{tool_tag.content_type}\",\n          api_message: \"Requested ResourceLink has an unexpected content type\"\n        )\n      end","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/app/controllers/lti/ims/providers/memberships_provider.rb#L152-L188","documentation":"Guard in MembershipsProvider#validate_tool!: the rlid resolves to a resource link but the associated assignment is not an external-tool assignment (not configured for LTI launches), so the NRPS request is rejected with InvalidResourceLinkIdFilter; the api_message carries this user-facing text.","triggerScenarios":"Thrown at app/controllers/lti/ims/providers/memberships_provider.rb:170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure the assignment as an external-tool (LTI) assignment with a line item/resource link","Request memberships for a resource link that belongs to an LTI assignment or module item"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}