{"record":{"id":"37de10c5d42928df","repo":"hashicorp/vagrant","slug":"the-metadata-json-file-for-the-box-name-was","errorCode":null,"errorMessage":"The \"metadata.json\" file for the box '%{name}' was not found. Boxes require this file in order for Vagrant to determine the provider it was made for. If you made the box, please add a \"metadata.json\" file to it. If someone else made the box, please notify the box creator that the box is corrupt. Documentation for box file format can be found at the URL below:\n\nhttps://www.vagrantup.com/docs/boxes/format.html","messagePattern":"The \"metadata\\.json\" file for the box '%(.+?)' was not found\\. Boxes require this file in order for Vagrant to determine the provider it was made for\\. If you made the box, please add a \"metadata\\.json\" file to it\\. If someone else made the box, please notify the box creator that the box is corrupt\\. Documentation for box file format can be found at the URL below:\n\nhttps://www\\.vagrantup\\.com/docs/boxes/format\\.html","errorType":"exception","errorClass":"Vagrant::Errors::BoxMetadataFileNotFound","httpStatus":null,"severity":"error","filePath":"lib/vagrant/box.rb","lineNumber":84,"sourceCode":"    #\n    # @param [String] name Logical name of the box.\n    # @param [Symbol] provider The provider that this box implements.\n    # @param [Pathname] directory The directory where this box exists on\n    #   disk.\n    # @param [String] architecture Architecture the box was built for\n    # @param [String] metadata_url Metadata URL for box\n    # @param [Hook] hook A hook to apply to the box downloader, for example, for authentication\n    def initialize(name, provider, version, directory, architecture: nil, metadata_url: nil, hook: nil)\n      @name      = name\n      @version   = version\n      @provider  = provider\n      @directory = directory\n      @architecture = architecture\n      @metadata_url = metadata_url\n      @hook = hook\n\n      metadata_file = directory.join(\"metadata.json\")\n      raise Errors::BoxMetadataFileNotFound, name: @name if !metadata_file.file?\n\n      begin\n        @metadata = JSON.parse(directory.join(\"metadata.json\").read)\n        validate_metadata_json(@metadata)\n      rescue JSON::ParserError\n        raise Errors::BoxMetadataCorrupted, name: @name\n      end\n\n      @logger = Log4r::Logger.new(\"vagrant::box\")\n    end\n\n    def validate_metadata_json(metadata)\n      metatdata_fields = metadata.keys\n      REQUIRED_METADATA_FIELDS.each do |field|\n        if !metatdata_fields.include?(field)\n          raise Errors::BoxMetadataMissingRequiredFields,\n            name: @name,\n            required_field: field,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/box.rb#L66-L102","documentation":"BoxMetadataFileNotFound is raised in Box#initialize (lib/vagrant/box.rb:84) when the box's on-disk directory does not contain a metadata.json file. Vagrant requires this manifest (it must at least declare the provider) to know what the box targets, so a directory without it is treated as an invalid/corrupt box.","triggerScenarios":"Box.new(name, provider, version, directory) is instantiated on a directory where directory.join('metadata.json').file? is false — typically after 'vagrant box add' unpacked an archive lacking metadata.json, or when a box directory under ~/.vagrant.d/boxes was copied/manually created without the manifest.","commonSituations":"Hand-copied box directories between machines; a .box tarball built without metadata.json; interrupted box add leaving a partial directory; scripts that rsync VAGRANT_HOME and skip the file.","solutions":["Remove the broken box ('vagrant box remove <name> --provider <p>') and re-add it from a known-good .box or catalog URL","If you built the box yourself, add a metadata.json containing at least {\"provider\": \"<provider>\"} to the box and repackage","Inspect the box directory (ls ~/.vagrant.d/boxes/<name>/0/<provider>) to confirm the file is truly missing rather than misnamed ('Metadata.json', 'metadata.json.txt')"],"exampleFix":"# before: box dir missing manifest\n~/vagrant.d/boxes/mybox/0/virtualbox/\n  box.ovf  disk.vmdk\n\n# after: add manifest\n~/vagrant.d/boxes/mybox/0/virtualbox/\n  box.ovf  disk.vmdk  metadata.json\n# metadata.json\n{\"provider\": \"virtualbox\"}","handlingStrategy":"validation","validationCode":"dir = collection.directory.join('boxes', name, version_dir, provider)\nunless dir.join('metadata.json').file?\n  raise \"Box #{name} missing metadata.json — remove and re-add before use\"\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only add boxes from trusted sources so the archive always ships metadata.json","Never hand-copy box directories; use 'vagrant box add' / repackage via 'vagrant package'"],"tags":["vagrant","box","metadata","missing-file","manifest"],"backgroundTag":"missing-manifest-file","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}