{"record":{"id":"e69c456c59a11e6a","repo":"hashicorp/vagrant","slug":"vagrant-is-automatically-disabling-direct-upload-t-e69c45","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/publish.rb","lineNumber":152,"sourceCode":"          1\n        end\n\n        # Upload the file for the given box provider\n        #\n        # @param [VagrantCloud::Box::Provider] provider Vagrant Cloud box version provider\n        # @param [String] box_file Path to local asset for upload\n        # @param [Hash] options\n        # @option options [Boolean] :direct_upload Upload directly to backend storage\n        # @return [nil]\n        def upload_box_file(provider, box_file, options={})\n          box_file = File.absolute_path(box_file)\n          @env.ui.info(I18n.t(\"cloud_command.publish.upload_provider\", file: box_file))\n          # Include size check on file and disable direct if over 5G\n          if options[:direct_upload]\n            fsize = File.stat(box_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_upload] = false\n            end\n          end\n\n          provider.upload(direct: options[:direct_upload]) do |upload_url|\n            Vagrant::Util::Uploader.new(upload_url, box_file, ui: @env.ui, method: :put).upload!\n          end\n          nil\n        end\n\n        # Release the box version\n        #\n        # @param [VagrantCloud::Box::Version] version Vagrant Cloud box version\n        # @return [nil]\n        def release_version(version)\n          @env.ui.info(I18n.t(\"cloud_command.publish.release\"))\n          version.release\n          nil","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/publish.rb#L134-L170","documentation":"Same direct-upload size guard, in the publish flow (publish.rb, upload_box_file). When options[:direct_upload] is true (publish defaults direct_upload: true in its option setup) and File.stat(box_file).size exceeds 5 GiB, it prints the size and sets options[:direct_upload] = false before calling provider.upload(direct: false), which uploads through the standard relayed URL instead of backend-direct storage.","triggerScenarios":"Running `vagrant cloud publish org/box 1.0.0 virtualbox ./big.box` (or with explicit --direct-upload) where big.box is over 5 GiB; note publish enables direct upload by default, so this fires without any flag on large artifacts.","commonSituations":"Publishing full-disk virtualbox images that exceed 5G and noticing slower uploads than expected; CI publish jobs assuming direct transfer always happens; teams surprised the default-on direct path quietly degrades.","solutions":["No action needed to succeed — the fallback upload still delivers the file; just expect longer transfer time.","Reduce artifact size below 5G (repackage/compress the box) to keep the faster direct path.","For predictable behavior pass the direct-upload flag explicitly based on measured size in your publish script.","Monitor the publish output for this warning to know which path was actually taken when tuning upload timeouts."],"exampleFix":"# before\nvagrant cloud publish myorg/app 1.0.0 virtualbox ./app-big.box --release\n# >5G file -> direct upload auto-disabled (slower relayed path)\n\n# after (pre-compress to stay under the limit and keep direct upload)\ngzip -k ./app-big.box   # or vagrant package with a trimmed disk\nvagrant cloud publish myorg/app 1.0.0 virtualbox ./app-big.box.gz --release","handlingStrategy":"validation","validationCode":"MAX=5368709120  # 5 GiB, publish enables direct_upload by default\nsize=$(stat -c %s \"$BOX_FILE\" 2>/dev/null || stat -f %z \"$BOX_FILE\")\nFLAG=--direct-upload\n[ \"$size\" -le \"$MAX\" ] || FLAG=\"\"\nvagrant cloud publish \"$ORG/$BOX\" \"$VER\" \"$PROVIDER\" \"$BOX_FILE\" $FLAG","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Measure box file size in the publish pipeline; remember direct upload is on by default and silently degrades over 5G.","Compress or split large artifacts at package time.","Parse publish output for 'automatically disabling direct upload' to record which transfer path ran."],"tags":["vagrant","vagrant-cloud","publish","upload","file-size-limit"],"backgroundTag":"file-size-limit-exceeded","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}