instructure/canvas-lms · error · ArgumentError
app '# ' must be one of: #
Error message
app '#{app}' must be one of: #{SUPPORTED_APPS.join(", ")} What it means
Raised by validate_params! when an override entry's app key is not in SUPPORTED_APPS. Only allow-listed applications may have their release tag/assets_url overridden, so unknown app names are rejected as ArgumentError.
Solutions
- Use an app name exactly matching one in SUPPORTED_APPS (check the controller constant)
- Add the new app to SUPPORTED_APPS if it is a legitimate microfrontend
- Fix casing/typos in the app key
- Confirm blank assets_url entries are intentional (those are skipped) rather than masking the real app name
Example fix
// before
{ override: { 'dashboard2': 'https://cdn.example.com' } }
// after
{ override: { 'k5': 'https://cdn.example.com' } } // k5 is in SUPPORTED_APPS Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED_APPS = ['k5','...'];
for (const app of Object.keys(override)) if (!SUPPORTED_APPS.includes(app)) throw new Error(`unsupported app ${app}`); Try / catch
begin
validate_params!
rescue ArgumentError => e
render json: { error: e.message, supported: SUPPORTED_APPS }, status: :bad_request
end Prevention
- Read SUPPORTED_APPS from source before overriding
- Sync app renames between frontend config and allow-list
- Centralize the allow-list to avoid drift
When it happens
Trigger: POSTing params[:override] containing an app name not listed in SUPPORTED_APPS (typo, new app not yet allow-listed, wrong casing); iterating over config that includes internal app keys.
Common situations: Ops scripts overriding releases for a newly added microfrontend before SUPPORTED_APPS was updated; renaming apps in frontend config without syncing the controller's allow-list.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- An institutional tag category did not pass validation
- cannot change column: captions - locked by Master Course
- Cannot validate existence for resource type: #
- Caption cannot be empty.
- e.message
AI-assisted analysis of instructure/canvas-lms@1c9f0bb801 (2026-09-15).
Data as JSON: /api/errors/b96ab1305f8ba2e2.
Report an issue: GitHub.
Appendix: source
Thrown at app/controllers/microfrontends_release_tag_override_controller.rb:69
private
def validate_environment
not_found unless Setting.get("allow_microfrontend_release_tag_override", "false") == "true"
end
def validate_params!
override_params = params[:override]
unless override_params.respond_to?(:each)
raise ArgumentError, "override parameter must be a hash"
end
override_params.each do |app, assets_url|
next if assets_url.blank?
unless SUPPORTED_APPS.include?(app)
raise ArgumentError, "app '#{app}' must be one of: #{SUPPORTED_APPS.join(", ")}"
end
begin
uri = URI.parse(assets_url)
unless ALLOWED_HOSTS.include?(uri.host)
raise ArgumentError, "assets_url host for '#{app}' must be one of: #{ALLOWED_HOSTS.join(", ")}"
end
rescue URI::InvalidURIError
raise ArgumentError, "assets_url for '#{app}' must be a valid URL"
end
end
end
end
View on GitHub (pinned to 1c9f0bb801)