{"record":{"id":"364b7a56c1d121cf","repo":"hashicorp/vagrant","slug":"vagrant-is-automatically-disabling-direct-upload-t","errorCode":null,"errorMessage":"Vagrant is automatically disabling direct upload to backend storage.\nUploads directly to backend storage are currently only supported for\nfiles 5G in size or smaller. Box file to upload is: %{size}","messagePattern":"Vagrant is automatically disabling direct upload to backend storage\\.\nUploads directly to backend storage are currently only supported for\nfiles 5G in size or smaller\\. Box file to upload is: %(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/commands/cloud/provider/upload.rb","lineNumber":71,"sourceCode":"          # @param [String] provider Provider name\n          # @param [String] architecture Architecture name\n          # @param [String] file Path to asset\n          # @param [String] access_token User Vagrant Cloud access token\n          # @param [Hash] options\n          # @option options [Boolean] :direct Upload directly to backend storage\n          # @return [Integer]\n          def upload_provider(org, box, version, provider, architecture, file, access_token, options)\n            account = VagrantCloud::Account.new(\n              custom_server: api_server_url,\n              access_token: access_token\n            )\n\n            # Include size check on file and disable direct if over 5G\n            if options[:direct]\n              fsize = File.stat(file).size\n              if fsize > (5 * Vagrant::Util::Numeric::GIGABYTE)\n                box_size = Vagrant::Util::Numeric.bytes_to_string(fsize)\n                @env.ui.warn(I18n.t(\"cloud_command.provider.direct_disable\", size: box_size))\n                options[:direct] = false\n              end\n            end\n\n            with_provider(account: account, org: org, box: box, version: version, provider: provider, architecture: architecture) do |p|\n              p.upload(direct: options[:direct]) do |upload_url|\n                m = options[:direct] ? :put : :put\n                uploader = Vagrant::Util::Uploader.new(upload_url, file, ui: @env.ui, method: m)\n                ui = Vagrant::UI::Prefixed.new(@env.ui, \"cloud\")\n                ui.output(I18n.t(\"cloud_command.provider.upload\",\n                  org: org, box_name: box, version: version, provider: provider))\n                ui.info(\"Upload File: #{file}\")\n                uploader.upload!\n                ui.success(I18n.t(\"cloud_command.provider.upload_success\",\n                  org: org, box_name: box, version: version, provider: provider))\n              end\n              0\n            end","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/provider/upload.rb#L53-L89","documentation":"Warning from `vagrant cloud provider upload` (plugins/commands/cloud/provider/upload.rb) when --direct is requested but File.stat(file).size exceeds 5 GiB (5 * Vagrant::Util::Numeric::GIGABYTE). Vagrant prints the human-readable size (bytes_to_string) and automatically downgrades options[:direct] = false, so the upload is routed through the standard (server-mediated) upload path instead of direct-to-backend storage.","triggerScenarios":"Running `vagrant cloud provider upload ... --direct --file big.box` where big.box is larger than 5 GiB; the size probe runs before with_provider opens the upload session, and the chosen upload_url/mthod reflects the non-direct path.","commonSituations":"Large virtualbox/VMware boxes with bundled disk images exceeding 5G; CI publishing pipelines that always pass --direct for speed and silently lose that optimization on big artifacts; disk-full or sparse-file surprises where the apparent size crosses the threshold.","solutions":["Accept the automatic fallback — the upload still completes, just via the relay path (slower).","To genuinely use direct upload, shrink the artifact below 5G: repackage the box, compress, or split the disk.","Remove --direct from scripts if your boxes are routinely >5G so logs stay clean and behavior is deterministic.","Check the file size first (`stat -c %s file.box`) when you need predictable upload timing."],"exampleFix":"# before\nvagrant cloud provider upload myorg/app 1.0.0 virtualbox --architecture amd64 \\\n  --file ./app.box --direct   # >5G -> warning, falls back to relayed upload\n\n# after (verify size, only use direct when supported)\nSIZE=$(stat -c %s ./app.box)\nDIRECT=$([ \"$SIZE\" -le 5368709120 ] && echo --direct || echo \"\")\nvagrant cloud provider upload myorg/app 1.0.0 virtualbox --architecture amd64 \\\n  --file ./app.box $DIRECT","handlingStrategy":"validation","validationCode":"MAX=5368709120  # 5 GiB\nsize=$(stat -c %s \"$BOX_FILE\" 2>/dev/null || stat -f %z \"$BOX_FILE\")\nDIRECT_FLAG=\"\"\n[ \"$size\" -le \"$MAX\" ] && DIRECT_FLAG=--direct\nvagrant cloud provider upload ... --file \"$BOX_FILE\" $DIRECT_FLAG","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-check artifact size before choosing --direct.","Budget upload time for the relayed path when artifacts exceed 5G.","Strip/compress disk images during packaging to stay under thresholds."],"tags":["vagrant","vagrant-cloud","upload","file-size-limit","direct-upload"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}