{"record":{"id":"7947fde3b6f36994","repo":"hashicorp/vagrant","slug":"no-valid-ids-were-given-to-the-nfs-synced-folder-i","errorCode":null,"errorMessage":"No valid IDs were given to the NFS synced folder implementation to\nprune. This is an internal bug with Vagrant and an issue should be\nfiled.","messagePattern":"No valid IDs were given to the NFS synced folder implementation to\nprune\\. This is an internal bug with Vagrant and an issue should be\nfiled\\.","errorType":"exception","errorClass":"Vagrant::Errors::NFSNoValidIds","httpStatus":null,"severity":"error","filePath":"plugins/synced_folders/nfs/synced_folder.rb","lineNumber":128,"sourceCode":"          ))\n        end\n\n        # Mount them!\n        if machine.guest.capability?(:nfs_pre)\n          machine.guest.capability(:nfs_pre)\n        end\n\n        machine.guest.capability(:mount_nfs_folder,\n          nfsopts[:nfs_host_ip], mount_folders)\n\n        if machine.guest.capability?(:nfs_post)\n          machine.guest.capability(:nfs_post)\n        end\n      end\n\n      def cleanup(machine, opts)\n        ids = opts[:nfs_valid_ids]\n        raise Vagrant::Errors::NFSNoValidIds if !ids\n\n        # Prune any of the unused machines\n        @logger.info(\"NFS pruning. Valid IDs: #{ids.inspect}\")\n        machine.env.host.capability(:nfs_prune, machine.ui, ids)\n      end\n\n      protected\n\n      def prepare_folder(machine, opts)\n        opts[:map_uid] = prepare_permission(machine, :uid, opts)\n        opts[:map_gid] = prepare_permission(machine, :gid, opts)\n        opts[:nfs_version] ||= 3\n        if !opts.key?(:nfs_udp)\n          opts[:nfs_udp] = !opts[:nfs_version].to_s.start_with?('4')\n        end\n\n        if opts[:nfs_version].to_s.start_with?('4') && opts[:nfs_udp]\n          machine.ui.info I18n.t(\"vagrant.actions.vm.nfs.v4_with_udp_warning\")","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/synced_folders/nfs/synced_folder.rb#L110-L146","documentation":"cleanup() prunes stale NFS exports using opts[:nfs_valid_ids], which the synced-folder cleanup middleware supplies (machine IDs that still hold NFS folders). If the key is absent, Vagrant raises NFSNoValidIds and the message explicitly calls it an internal bug that should be filed.","triggerScenarios":"A plugin or custom action invoking SyncedFolderNFS#cleanup without passing nfs_valid_ids, or a core middleware regression that fails to propagate the valid-ID list during destroy/halt/reload paths.","commonSituations":"Provider/synced-folder plugins hooking cleanup themselves; rare core regressions, usually alongside other middleware failures.","solutions":["File a Vagrant issue with --debug output as the message instructs","Update (or pin away from) the Vagrant version that regressed","Plugin authors: always pass opts[:nfs_valid_ids] when calling cleanup","Workaround: remove stale entries from /etc/exports manually and run exportfs -ra"],"exampleFix":"# plugin code\n# before\nsubject.cleanup(machine, {})\n\n# after\nsubject.cleanup(machine, { nfs_valid_ids: valid_machine_ids })","handlingStrategy":"try-catch","validationCode":"# plugin authors: supply valid IDs before cleanup\nids = env[:machine].env.active_machines.map { |m| m[0].to_s }\nopts[:nfs_valid_ids] ||= ids","typeGuard":"def nfs_cleanup_args_valid?(opts)\n  !opts[:nfs_valid_ids].nil?\nend","tryCatchPattern":"begin\n  subject.cleanup(machine, opts)\nrescue Vagrant::Errors::NFSNoValidIds => e\n  # internal bug per the message - collect debug output and file an issue\n  report_vagrant_bug(\"NFSNoValidIds\", e)\nend","preventionTips":["Pass nfs_valid_ids whenever invoking NFS cleanup from plugins","Keep core and plugins version-aligned","Know the manual recovery: prune /etc/exports and run exportfs -ra"],"tags":["nfs","synced-folders","internal-error","cleanup"],"backgroundTag":"internal-invariant-violated","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}