{"record":{"id":"3835f392908b5c87","repo":"socketry/falcon","slug":"unsupported-application-configuration-path","errorCode":null,"errorMessage":"Unsupported application configuration: #{path}!","messagePattern":"Unsupported application configuration: #(.+?)!","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/falcon/environment/serve.rb","lineNumber":68,"sourceCode":"\t\t\t\tend\n\t\t\t\t\n\t\t\t\traise ArgumentError, \"Could not find config/serve.rb or config.ru in #{root}!\"\n\t\t\tend\n\t\t\t\n\t\t\t# Load and wrap the configured application.\n\t\t\t# @returns [Protocol::HTTP::Middleware] The middleware stack.\n\t\t\tdef middleware\n\t\t\t\tpath = resolved_configuration_path\n\t\t\t\t\n\t\t\t\tcase File.extname(path)\n\t\t\t\twhen \".rb\"\n\t\t\t\t\tapplication = ::Protocol::HTTP::Middleware.load(path)\n\t\t\t\t\treturn ::Falcon::Server.protocol_middleware(application, verbose: verbose, cache: cache)\n\t\t\t\twhen \".ru\"\n\t\t\t\t\tapplication = ::Protocol::Rack::Adapter.parse_file(path)\n\t\t\t\t\treturn ::Falcon::Server.rack_middleware(application, verbose: verbose, cache: cache)\n\t\t\t\telse\n\t\t\t\t\traise ArgumentError, \"Unsupported application configuration: #{path}!\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend\n","sourceCodeStart":50,"sourceCodeEnd":74,"githubUrl":"https://github.com/socketry/falcon/blob/5107b0713fd78dbe8b08ee123391b1f4bcffdf12/lib/falcon/environment/serve.rb#L50-L74","documentation":"After resolving the configuration path, Falcon::Environment::Serve#middleware dispatches on File.extname(path): '.rb' files load through Protocol::HTTP::Middleware.load and '.ru' files parse through Protocol::Rack::Adapter.parse_file (lib/falcon/environment/serve.rb:60-69). The extension is the explicit contract selecting the application interface, since both loaded objects simply respond to call. Any other extension — or no extension at all — hits the else branch and raises ArgumentError naming the offending path.","triggerScenarios":"Setting configuration_path (or having discovery land on) a file whose extname is not exactly .rb or .ru — e.g. config/app.yaml, config/falcon.json, config.ru.txt, or an extensionless config/app — then calling middleware on the serve environment.","commonSituations":"Pointing falcon at a YAML/JSON settings file expecting it to be read; editors, uploads, or backups renaming config.ru to config.ru.txt or app.ru.bak; extensionless entry scripts; case-mismatched extensions like .RU.","solutions":["Rename the file so it ends in .ru (Rack app) or .rb (Protocol::HTTP middleware)","If the file is configuration data (YAML/JSON), load it from inside a .ru/.rb entry file instead of pointing falcon at it","Verify with File.extname — '.ru' must be exact; config.ru.txt fails because extname is '.txt'"],"exampleFix":"# before\nclass MyAppEnvironment\n  include Falcon::Environment::Serve\n\n  def configuration_path\n    'config/falcon.yaml' # -> ArgumentError: Unsupported application configuration\n  end\nend\n\n# after\nclass MyAppEnvironment\n  include Falcon::Environment::Serve\n\n  def configuration_path\n    'config/falcon.ru' # .ru = Rack app; .rb = Protocol::HTTP middleware\n  end\nend","handlingStrategy":"validation","validationCode":"path = environment.resolved_configuration_path\nunless %w[.rb .ru].include?(File.extname(path))\n  abort \"#{path}: falcon only loads .rb or .ru app configs (got #{File.extname(path).inspect})\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  middleware = environment.middleware\nrescue ArgumentError => error\n  abort \"falcon serve: #{error.message}\"\nend","preventionTips":["Name rackup files *.ru and protocol-middleware files *.rb; treat the extension as the interface selector","Never point configuration_path at data files (yaml/json/toml) — load them from inside the entry file","Assert File.extname(resolved_configuration_path) is .rb or .ru in a preflight/deploy check"],"tags":["falcon","rack","file-extension","argument-error","configuration","ruby"],"backgroundTag":"unsupported-file-extension","analyzedSha":"5107b0713fd78dbe8b08ee123391b1f4bcffdf12","analyzedAt":"2026-08-23T14:31:56.885Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}