{"record":{"id":"1253819e3abbbcf1","repo":"jdx/mise","slug":"flatpak-cannot-upgrade-a-pinned-version-pkg","errorCode":null,"errorMessage":"flatpak cannot upgrade a pinned version ('{pkg}')","messagePattern":"flatpak cannot upgrade a pinned version \\('(.+?)'\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/flatpak.rs","lineNumber":168,"sourceCode":"        let mut args = vec![\n            \"install\".to_string(),\n            self.scope_arg().to_string(),\n            \"--noninteractive\".to_string(),\n        ];\n        args.extend(pkgs.iter().map(|pkg| pkg.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"flatpak {}\", args.join(\" \"));\n            return Ok(());\n        }\n        run_flatpak(&args, \"install\").await\n    }\n\n    async fn upgrade(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if pkgs.is_empty() {\n            return Ok(());\n        }\n        if let Some(pkg) = pkgs.iter().find(|pkg| pkg.version.is_some()) {\n            bail!(\"flatpak cannot upgrade a pinned version ('{pkg}')\");\n        }\n        let mut args = vec![\n            \"update\".to_string(),\n            self.scope_arg().to_string(),\n            \"--noninteractive\".to_string(),\n        ];\n        args.extend(pkgs.iter().map(|pkg| pkg.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"flatpak {}\", args.join(\" \"));\n            return Ok(());\n        }\n        run_flatpak(&args, \"update\").await\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/flatpak.rs#L150-L186","documentation":"The flatpak package backend refuses to run `flatpak update` when any requested PackageRequest pins a specific version. Flatpak itself has no concept of upgrading a ref to a chosen older/newer version — updates move an installed app to whatever the remote currently offers. The backend fails fast rather than silently ignoring the pin.","triggerScenarios":"Calling `upgrade` on the flatpak backend with a pkgs slice containing at least one PackageRequest whose `version` field is Some. Empty request lists short-circuit to Ok(()) before this check.","commonSituations":"A config or lockfile records a concrete version for a flatpak-installed app (e.g. from a cross-backend toolset snapshot) and the user runs an upgrade-all flow; tooling that generically passes resolved versions to every package backend.","solutions":["Remove the version pin from the flatpak PackageRequest so `version` is None, then retry the upgrade.","If you need the exact pinned version, uninstall and `flatpak install` the specific commit/version instead of using upgrade.","Filter pinned packages out of the upgrade batch in the caller and only pass unpinned requests to the flatpak backend."],"exampleFix":"// before\nlet pkgs = vec![PackageRequest { name: \"org.gimp.GIMP\".into(), version: Some(\"2.10\".into()) }];\nbackend.upgrade(&pkgs, &opts).await?;\n// after\nlet pkgs = vec![PackageRequest { name: \"org.gimp.GIMP\".into(), version: None }];\nbackend.upgrade(&pkgs, &opts).await?;","handlingStrategy":"validation","validationCode":"let unpinned: Vec<_> = pkgs.iter().filter(|p| p.version.is_none()).collect();\nif unpinned.len() != pkgs.len() { /* strip pins or handle separately before calling upgrade */ }","typeGuard":"fn is_unpinned(p: &PackageRequest) -> bool { p.version.is_none() }","tryCatchPattern":null,"preventionTips":["Keep flatpak entries version-free in configs and lockfiles.","Before batch upgrades, split requests per backend and drop pins for flatpak.","Document that flatpak upgrades always track the remote's latest."],"tags":["flatpak","version-pinning","upgrade","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}