instructure/canvas-lms · error · Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter

Requested ResourceLink has an unexpected content type

Error message

Requested ResourceLink has an unexpected content type

What it means

Guard in MembershipsProvider#validate_tool!: the ContentTag attached to the rlid's resource link is neither an external-tool assignment tag nor a valid content tag for launches, i.e. the ResourceLink points at unexpected content, so the request is rejected with InvalidResourceLinkIdFilter.

Solutions

  1. Point the resource link/content tag at an external-tool item created via the LTI deep-linking flow
  2. Re-create the link with the proper content type
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/controllers/lti/ims/providers/memberships_provider.rb:178 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at app/controllers/lti/ims/providers/memberships_provider.rb:178

    end

    def assignment?
      assignment&.present?
    end

    def validate_tool!
      raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter unless resource_link

      if assignment? && !assignment.external_tool?
        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(
          "Assignment (id: #{assignment&.id}, rlid: #{rlid}) is not configured for submissions via external tool",
          api_message: "Requested assignment not configured for external tool launches"
        )
      end

      tool_tag = assignment&.external_tool_tag || content_tag
      if tool_tag.blank?
        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(
          "ContentTag (rlid: #{rlid}) not found",
          api_message: "Requested ResourceLink was not found"
        )
      end
      if tool_tag.content_type != "ContextExternalTool"
        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(
          "ResourceLink (rlid: #{rlid}) needs content tag type 'ContextExternalTool' but found #{tool_tag.content_type}",
          api_message: "Requested ResourceLink has an unexpected content type"
        )
      end

      unless tool.can_access_content_tag?(tool_tag)
        raise Lti::IMS::AdvantageErrors::InvalidResourceLinkIdFilter.new(
          "ResourceLink (rlid: #{rlid}) needs binding to external tool #{tool.id} but found #{tool_tag.content_id}",
          api_message: "Requested ResourceLink bound to unexpected external tool"
        )
      end
    end

View on GitHub (pinned to 1c9f0bb801)