{"record":{"id":"cfb3c58bd3338999","repo":"instructure/canvas-lms","slug":"live-events-subscriptions-service-is-not-configured","errorCode":null,"errorMessage":"Live events subscriptions service is not configured","messagePattern":"Live events subscriptions service is not configured","errorType":"exception","errorClass":"PlagiarismSubscriptionError","httpStatus":null,"severity":"error","filePath":"lib/lti/plagiarism_subscriptions_helper.rb","lineNumber":53,"sourceCode":"      @tool_proxy = tool_proxy\n      @product_family = tool_proxy.product_family\n    end\n\n    def create_subscription\n      Rails.logger.info { \"in: PlagiarismSubscriptionsHelper::create_subscription, tool_proxy_id: #{tool_proxy.id}\" }\n      if Services::LiveEventsSubscriptionService.disabled?\n        Rails.logger.info { \"Live Event Subscription Service disabled.  No subscription created.\" }\n        return\n      end\n\n      if Services::LiveEventsSubscriptionService.available?\n        subscription = plagiarism_subscription(tool_proxy, product_family)\n        result = Services::LiveEventsSubscriptionService.create_tool_proxy_subscription(tool_proxy, subscription)\n        raise PlagiarismSubscriptionError, error_message unless result.ok?\n\n        result.parsed_response[\"Id\"]\n      else\n        raise PlagiarismSubscriptionError, I18n.t(\"Live events subscriptions service is not configured\")\n      end\n    end\n\n    def plagiarism_subscription(tool_proxy, _product_family)\n      {\n        SystemEventTypes: EVENT_TYPES,\n        UserEventTypes: EVENT_TYPES,\n        ContextType: \"root_account\",\n        ContextId: tool_proxy.context.root_account.uuid,\n        Format: format,\n        TransportType: transport_type,\n        TransportMetadata: transport_metadata,\n        AssociatedIntegrationId: tool_proxy.guid\n      }.with_indifferent_access\n    end\n\n    def destroy_subscription(subscription_id)\n      Rails.logger.info { \"in: PlagiarismSubscriptionsHelper::destroy_subscription, subscription_id: #{subscription_id}\" }","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/lti/plagiarism_subscriptions_helper.rb#L35-L71","documentation":"create_subscription first checks Services::LiveEventsSubscriptionService.available?. If the LiveEvents subscriptions service is not configured (missing URL or credentials in dynamic settings), the helper short-circuits and raises PlagiarismSubscriptionError with 'Live events subscriptions service is not configured' instead of attempting the HTTP call.","triggerScenarios":"Any call to Lti::PlagiarismSubscriptionsHelper#create_subscription in an environment where the LiveEvents subscription service settings (subscription service URL / key/secret in config/dynamic_settings.yml) are absent.","commonSituations":"Local development or self-hosted installs without the LiveEvents service configured; production environments where the subscriptions service block was omitted or keys were rotated out of dynamic settings; mispinned environment prefix in dynamic_settings.yml.","solutions":["Add the live events subscription service config (URL, app_key, app_secret) to config/dynamic_settings.yml under the correct environment prefix.","Restart/reload after changing dynamic settings so the service picks up configuration.","If plagiarism subscriptions are not needed, guard the caller so create_subscription is only invoked when the service is available."],"exampleFix":"// before (config/dynamic_settings.yml)\nconfig:\n  # no live events entry\n// after\nconfig:\n  live_events_subscription_service:\n    url: 'https://subscriptions.example.com'\n    app_key: 'key'\n    app_secret: 'secret'","handlingStrategy":"validation","validationCode":"unless Services::LiveEventsSubscriptionService.available?\n  skip_plagiarism_subscription 'service not configured'\nend","typeGuard":"null","tryCatchPattern":"begin\n  helper.create_subscription(tp, pf)\nrescue Lti::PlagiarismSubscriptionsHelper::PlagiarismSubscriptionError => e\n  Rails.logger.warn(e.message) # includes 'not configured' case\nend","preventionTips":["Add live_events_subscription_service settings to config/dynamic_settings.yml for each environment.","Gate plagiarism subscription code paths behind a service-availability check.","Validate dynamic settings on boot/deploy."],"tags":["live-events","configuration","plagiarism","subscription"],"backgroundTag":"missing-config-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"}