{"record":{"id":"16abb1e01de1de65","repo":"instructure/canvas-lms","slug":"no-region-specified-for-category-inspect","errorCode":null,"errorMessage":"No region specified for: #{category.inspect}","messagePattern":"No region specified for: #(.+?)","errorType":"validation","errorClass":"InvalidConfig","httpStatus":null,"severity":"error","filePath":"lib/canvas/dynamo_db/database_builder.rb","lineNumber":71,"sourceCode":"            @clients[key] = CanvasDynamoDB::Database.new(\n              fingerprint,\n              prefix: config[:table_prefix],\n              client_opts: opts,\n              logger: Rails.logger\n            )\n          rescue => e\n            Rails.logger.error \"Failed to create DynamoDB client for #{key}: #{e}\"\n            nil # don't save this nil into @clients[key], so we can retry later\n          end\n        end\n      end\n\n      def self.validate_config(config)\n        unless config[:table_prefix].present?\n          raise InvalidConfig, \"No table prefix specified for: #{category.inspect}\"\n        end\n        unless config[:region].present?\n          raise InvalidConfig, \"No region specified for: #{category.inspect}\"\n        end\n      end\n\n      def self.default_environment\n        Rails.env\n      end\n\n      def self.configs(environment = default_environment)\n        ConfigFile.load(\"dynamodb\", environment) || {}\n      end\n\n      def self.categories\n        configs.keys\n      end\n    end\n  end\nend\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/canvas/dynamo_db/database_builder.rb#L53-L89","documentation":"Canvas::DynamoDB::DatabaseBuilder.validate_config checks that a DynamoDB table configuration for a given category includes a table prefix and an AWS region. This error is raised as Canvas::DynamoDB::InvalidConfig when config[:region] is blank, meaning Canvas cannot determine which AWS region to create/connect to tables in.","triggerScenarios":"Calling Canvas::DynamoDB::DatabaseBuilder.configure/validate_config with a config hash lacking :region, typically from dynamodb.yml environment entries missing a region key for the current Rails environment or a category.","commonSituations":"Incomplete dynamodb.yml after upgrade, environment-specific overrides omitting region, per-category config with only table_name/table_prefix set, AWS region not set in defaults block.","solutions":["Add a region key (e.g. us-east-1) to the category's config in config/dynamodb.yml for the active Rails environment","Inherit region from the defaults section of dynamodb.yml so all environments/categories get it","Verify the config actually loaded: check Canvas::DynamoDB.config for the category before booting jobs","If using DynamicSettings/consul overrides, ensure the merged value includes region"],"exampleFix":"# before (config/dynamodb.yml)\nproduction:\n  live_events:\n    table_prefix: canvas-live-events\n// after\nproduction:\n  live_events:\n    table_prefix: canvas-live-events\n    region: us-east-1","handlingStrategy":"validation","validationCode":"cfg = Canvas::DynamoDB.config_for(category) rescue nil\nraise 'region missing' unless cfg && cfg[:region].present?","typeGuard":"valid = cfg.respond_to?(:[]) && cfg[:region].present?","tryCatchPattern":"begin\n  Canvas::DynamoDB::DatabaseBuilder.read_table_config(category)\nrescue Canvas::DynamoDB::InvalidConfig => e\n  Rails.logger.fatal(e.message)\n  raise\nend","preventionTips":["Include region in dynamodb.yml defaults so every environment inherits it","Validate config in CI with a boot-time check script","Keep environment overrides minimal to avoid dropping required keys"],"tags":["aws","dynamodb","configuration","ruby"],"backgroundTag":"missing-required-config-field","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"}