{"record":{"id":"5b7c4ee68a37fa3e","repo":"jdx/mise","slug":"unknown-config-file-type","errorCode":null,"errorMessage":"Unknown config file type: {}","messagePattern":"Unknown config file type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/config_file/mod.rs","lineNumber":279,"sourceCode":"        if runtimes.iter().any(|r| r.tvr.is_none()) {\n            return Err(eyre!(\n                \"invalid input, specify a version for each tool. Or just specify one tool to print the current version\"\n            ));\n        }\n        Ok(false)\n    }\n}\n\nasync fn init(path: &Path) -> Arc<dyn ConfigFile> {\n    match detect_config_file_type(path).await {\n        Some(ConfigFileType::MiseToml) => Arc::new(MiseToml::init(path)),\n        Some(ConfigFileType::ToolVersions) => Arc::new(ToolVersions::init(path)),\n        Some(ConfigFileType::IdiomaticVersion(backends)) => Arc::new(\n            IdiomaticVersionFile::parse(path.to_path_buf(), backends)\n                .await\n                .expect(\"failed to parse idiomatic version file\"),\n        ),\n        _ => panic!(\"Unknown config file type: {}\", path.display()),\n    }\n}\n\npub async fn parse_or_init(path: &Path) -> eyre::Result<Arc<dyn ConfigFile>> {\n    let path = if path.is_dir() {\n        path.join(&*env::MISE_DEFAULT_CONFIG_FILENAME)\n    } else {\n        path.into()\n    };\n    let cf = match path.exists() {\n        true => parse(&path).await?,\n        false => init(&path).await,\n    };\n    Ok(cf)\n}\n\n/// Lock a config file for a read-modify-write operation, then read its latest contents.\n///","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/config/config_file/mod.rs#L261-L297","documentation":"Raised by shim_unsupported! in mise's Homebrew cask shim (src/system/packages/brew/cask_shim.rb). mise evaluates cask definitions with a minimal Ruby DSL reimplementation instead of real Homebrew; any cask stanza or method the shim does not implement (reached directly, or via method_missing at line 359-361) raises ShimUnsupportedError with the feature name. It is a deliberate fail-loud guard: the shim would rather abort than silently skip an install step like sudo moves, system_command side effects, or OS-version conditionals it cannot evaluate.","triggerScenarios":"Running mise's brew cask installation path (system packages) on a cask that uses: system_command with extra keyword keys (line 324), an unrecognized DSL method (method_missing, line 359), an on_system_conditional missing its version key (line 271), or an unsupported on_<macos_version> method form (line 392, e.g. anything besides plain/:or_older/:or_newer).","commonSituations":"Installing a GUI app cask whose Ruby definition uses newer or rarely-used Homebrew DSL; casks needing sudo with system_packages.sudo = \"deny\" (default); upstream cask updated to use a stanza mise's shim has not covered yet after a Homebrew bump; pinning to a cask version that relied on install-time helpers.","solutions":["Install that cask with real Homebrew instead (brew install --cask <token>) and keep mise managing only formula-level tools","Update mise to the latest release — shim coverage for cask DSL grows over time — then retry","If the cask needs elevation, set system_packages.sudo = \"interactive\" (or \"noninteractive\") so the shim can elevate instead of failing","Check the feature name in the message against cask_shim.rb to see which stanza is unsupported, and report it as a mise issue with the cask token","Pin a different version of the app whose cask uses only supported stanzas (app/binary/zap, on_<version> blocks with plain/:or_older/:or_newer)"],"exampleFix":"# before: cask uses a stanza the shim cannot run\n# .rb definition: system_command \"/usr/bin/tccutil\", args: [\"--reset\", \"Camera\"]\nmise x -- brew-installed-cask   # fails: cask uses `system_command ...`\n\n# after: let real Homebrew handle it\nbrew install --cask <token>","handlingStrategy":"fallback","validationCode":"# heuristic pre-check: does the cask use stanzas the shim lacks?\nbrew cat --cask <token> 2>/dev/null | grep -nE 'system_command|on_[a-z_]+ +:[a-z_]+|livecheck|uninstall_early' && \\\n  echo \"likely unsupported by mise cask shim -> use real brew\"","typeGuard":"def shim_supported_cask?(path)\n  src = File.read(path)\n  unsupported = [/system_command\\s+.*,(?!.*argv)/, /on_\\w+\\s+:((?!or_older|or_newer)\\w+)/]\n  unsupported.none? { |re| re.match?(src) }\nend","tryCatchPattern":"If you embed the shim: begin ... rescue ShimUnsupportedError => e; warn e.message; fall back to shelling out to `brew install --cask <token>`; end — never rescue-and-continue as if the cask installed.","preventionTips":["Route complex/GUI casks through real Homebrew; reserve mise system packages for simple casks (app/binary stanzas)","Keep mise current so shim DSL coverage tracks Homebrew changes","Set system_packages.sudo explicitly if your casks need elevation, instead of relying on the default deny"],"tags":["homebrew","cask","ruby","system-packages","shim","macos"],"backgroundTag":"unsupported-dsl-feature","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}