{"record":{"id":"609f31da7c685ed3","repo":"hashicorp/vagrant","slug":"the-metadata-associated-with-the-box-name-app","errorCode":null,"errorMessage":"The metadata associated with the box '%{name}' appears corrupted. This is most often caused by a disk issue or system crash. Please remove the box, re-add it, and try again.","messagePattern":"The metadata associated with the box '%(.+?)' appears corrupted\\. This is most often caused by a disk issue or system crash\\. Please remove the box, re-add it, and try again\\.","errorType":"exception","errorClass":"Vagrant::Errors::BoxMetadataCorrupted","httpStatus":null,"severity":"error","filePath":"lib/vagrant/box.rb","lineNumber":90,"sourceCode":"    # @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,\n            all_fields: REQUIRED_METADATA_FIELDS.join(\", \")\n        end\n      end\n    end\n\n    # This deletes the box. This is NOT undoable.","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/box.rb#L72-L108","documentation":"BoxMetadataCorrupted is raised in Box#initialize (lib/vagrant/box.rb:90) when JSON.parse on the box directory's metadata.json raises JSON::ParserError. The file exists but is not valid JSON, which Vagrant attributes to disk problems or a crash mid-write.","triggerScenarios":"Box.new on a directory whose metadata.json exists but JSON.parse(directory.join('metadata.json').read) throws — truncated file, empty file, binary garbage, or text with a stray BOM/quote. The rescue converts it to this error naming the box.","commonSituations":"Host crashed or lost power during a 'vagrant box add'; disk-full conditions truncating writes; synced/cloud-synced VAGRANT_HOME (Dropbox/OneDrive) producing conflicted or half-synced files; manual edits leaving invalid JSON.","solutions":["Remove and re-add the box: 'vagrant box remove <name>' then 'vagrant box add ...' from the original source","If the file looks editable, open ~/.vagrant.d/boxes/<name>/0/<provider>/metadata.json and fix the JSON syntax (validate with 'python -m json.tool' or jq)","Check host disk health/space (df -h) and stop syncing VAGRANT_HOME through a file-sync service"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"require 'json'\nmeta_path = File.join(box_dir, 'metadata.json')\nbegin\n  JSON.parse(File.read(meta_path))\nrescue JSON::ParserError\n  raise 'metadata.json corrupt — re-add the box before starting' # run vagrant box remove/add\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep VAGRANT_HOME on reliable local disks; exclude it from sync clients","Ensure disk space before box operations to avoid truncated writes"],"tags":["vagrant","box","metadata","json","corruption"],"backgroundTag":"corrupt-json-file","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}